Skip to content

Buffer and qos j2 file modularization #21102

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Mar 21, 2025

Conversation

zhixzhu
Copy link
Contributor

@zhixzhu zhixzhu commented Dec 10, 2024

Why I did it

It usually requires update on both upstream j2 files and platform j2 files, when there is new configuration.
This change is intend to reduce changes in upstream j2 files in future.

Work item tracking
  • Microsoft ADO (number only):

How I did it

For each config section, define a macro for it.

How to verify it

Verified with T0/T1/T2 config.

Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106
  • 202111
  • 202205
  • 202211
  • 202305

Tested branch (Please provide the tested image version)

Description for the changelog

Link to config_db schema for YANG module changes

A picture of a cute animal (not mandatory but encouraged)

@zhixzhu zhixzhu marked this pull request as ready for review December 19, 2024 05:53
@zhixzhu zhixzhu requested a review from lguohan as a code owner December 19, 2024 05:53
@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@zhixzhu zhixzhu changed the title qos j2 file modularization Buffer and qos j2 file modularization Dec 19, 2024
@@ -106,6 +115,9 @@
}
},
{% endif %}
{% if (generate_pfc_to_queue_map is defined) %}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any case we need to define generate_pfc_to_queue_map rather than use the default 1-1 PFC to queue mapping?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No specific override is defined. A placeholder for future.

@@ -82,7 +87,12 @@ def
{%- if cable_len -%}
{{ cable_len.0 }}
{%- else %}
{%- if 'torrouter' in switch_role.lower() and 'mgmt' not in switch_role.lower()%}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why we swap the if/else branch here?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is to handle the scenario where a device (including tor router) may have backplane ports.
In such a case, set the cable length of backplane port before the tor router check.

@@ -188,7 +190,16 @@ def
{%- if port_names_list_inactive.append(port) %}{%- endif %}
{%- endfor %}
{%- set port_names_inactive = port_names_list_inactive | join(',') %}

{%- set port_names_list_all = [] %}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shall we move code line 194-198 under the if branch {% if (defs.generate_cable_length_config is defined) %} at line 200?

Copy link
Contributor

@alpeshspatel alpeshspatel Dec 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, we can move under the if

@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@alpeshspatel
Copy link
Contributor

@kevinwangsk FYI

@zhixzhu
Copy link
Contributor Author

zhixzhu commented Jan 14, 2025

#21056 has similar change in qos_config.j2.

Signed-off-by: Zhixin Zhu <[email protected]>
@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@alpeshspatel
Copy link
Contributor

@kevinskwang @kperumalbfn FYI.

@alpeshspatel
Copy link
Contributor

@kevinskwang can you redo the /azp run Azure.sonic-buildimage

@kevinskwang
Copy link
Contributor

/azp run

Copy link

Commenter does not have sufficient privileges for PR 21102 in repo sonic-net/sonic-buildimage

@zhixzhu
Copy link
Contributor Author

zhixzhu commented Mar 6, 2025

@kevinskwang
Copy link
Contributor

@kperumalbfn could you help to review this?

@kevinskwang
Copy link
Contributor

/azp run

Copy link

Commenter does not have sufficient privileges for PR 21102 in repo sonic-net/sonic-buildimage

@@ -82,7 +87,12 @@ def
{%- if cable_len -%}
{{ cable_len.0 }}
{%- else %}
{%- if 'torrouter' in switch_role.lower() and 'mgmt' not in switch_role.lower()%}
{%- if port_name.startswith('Ethernet-BP') %}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alpeshspatel Are these internal ports?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, Ethernet-BP are internal ports.

@@ -82,7 +87,12 @@ def
{%- if cable_len -%}
{{ cable_len.0 }}
{%- else %}
{%- if 'torrouter' in switch_role.lower() and 'mgmt' not in switch_role.lower()%}
{%- if port_name.startswith('Ethernet-BP') %}
{%- if 'internal' not in ports2cable %}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this only for T2?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ethernet-BP is mostly for T2.
Some T0/T1 devices also have Ethernet-BP interfaces.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ethernet-BP is also for some smartswitches too, @kperumalbfn

{%- set LOSSLESS_TC = [] %}
{%- if generate_lossless_tc_list is defined %}
{{- generate_lossless_tc_list(LOSSLESS_TC) }}
{%- else %}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @alpeshspatel, this is good. If we need to have different set of LOSSLESS_TCs, we could use this macro inside SKUs.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes Kumaresh - that is the intent

@alpeshspatel
Copy link
Contributor

/azp run

Copy link

Commenter does not have sufficient privileges for PR 21102 in repo sonic-net/sonic-buildimage

@alpeshspatel
Copy link
Contributor

@kevinwangsk @kperumalbfn
Can you help with these two failures:

[Azure.sonic-buildimage](https://github.com/sonic-net/sonic-buildimage/pull/21102/checks?check_run_id=36323861335)
Azure.sonic-buildimageFailing after 281m — Build #build_Azure.sonic-buildimage_merge_20250128.20 failed
Required
[Azure.sonic-buildimage (Test kvmtest-t1-lag by Elastictest)](https://github.com/sonic-net/sonic-buildimage/pull/21102/checks?check_run_id=36322227333)
Azure.sonic-buildimage (Test kvmtest-t1-lag by Elastictest)Failing after 103m — Test kvmtest-t1-lag by Elastictest failed

Cannot see the logs as the run is pretty old (Jan 28)

@kevinskwang
Copy link
Contributor

/azp run

Copy link

Commenter does not have sufficient privileges for PR 21102 in repo sonic-net/sonic-buildimage

@zhixzhu
Copy link
Contributor Author

zhixzhu commented Mar 18, 2025

Commenter does not have sufficient privileges for PR 21102 in repo sonic-net/sonic-buildimage

@kevinskwang "/azp run" failed.

@kperumalbfn
Copy link
Contributor

/azp run

Copy link

You have several pipelines (over 10) configured to build pull requests in this repository. Specify which pipelines you would like to run by using /azp run [pipelines] command. You can specify multiple pipelines using a comma separated list.

@kperumalbfn
Copy link
Contributor

/azp run Azure.sonic-buildimage

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@zhixzhu
Copy link
Contributor Author

zhixzhu commented Mar 18, 2025

kvmtest-t0-sonic failed at snmpwalk timeout, not related with buffer/qos j2 files.

test case: macsec/test_interop_protocol.py::TestInteropProtocol::test_snmp[128_SCI]
invocation = {'module_args': {'_raw_params': 'docker exec snmp snmpwalk -v 2c -c public 10.1.0.32 .1.3.6.1.2.1.1.1.0', '_uses_shell': False, 'warn': False, 'stdin_add_newline': True, 'strip_empty_ends': True, 'argv': None, 'chdir': None, 'executable': None, 'creates': None, 'removes': None, 'stdin': None}}
_ansible_no_log = None
stdout =
stderr =
Timeout: No Response from 10.1.0.32

https://elastictest.org/scheduler/publictestplan/67d9148414a0c3680c255abe

{%- if 'torrouter' in switch_role.lower() and 'mgmt' not in switch_role.lower()%}
{%- if port_name.startswith('Ethernet-BP') %}
{%- if 'internal' not in ports2cable %}
{%- set _ = ports2cable.update({'internal': '5m'}) %}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zhixzhu @alpeshspatel Does internal port support lossless configs?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zhixzhu @alpeshspatel How about other QoS table mappings for internal ports?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kperumalbfn Internal ports (back plane ports) support lossless configs. Other qos table mappings are also applied to back plane ports, by adding back plane ports to PORT_ACTIVE list.

@kperumalbfn kperumalbfn enabled auto-merge (squash) March 21, 2025 21:53
@kperumalbfn kperumalbfn merged commit e6dc8dc into sonic-net:master Mar 21, 2025
22 checks passed
@zhixzhu zhixzhu deleted the buffer_qos_j2_modularization branch March 21, 2025 23:36
@alpeshspatel
Copy link
Contributor

@kperumalbfn @kevinskwang should this have a 202411 label?

@alpeshspatel
Copy link
Contributor

Hi @kperumalbfn @kevinskwang should this have a 202411 label?

@stephenxs
Copy link
Collaborator

Hi @kperumalbfn @kevinskwang @r12f
will this PR go to 202412?

@kperumalbfn
Copy link
Contributor

Thanks @alpeshspatel @stephenxs added 202412 tag.

@mssonicbld
Copy link
Collaborator

Cherry-pick PR to msft-202412: Azure/sonic-buildimage-msft#994

yanjundeng pushed a commit to yanjundeng/sonic-buildimage that referenced this pull request Apr 23, 2025
Buffer and qos j2 file modularization
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants