Skip to content

Commit 31ab164

Browse files
authored
[SmartSwitch] [Nvidia] Remove PG 3 and 4 for Internal Ports (#21888)
<!-- Please make sure you've read and understood our contributing guidelines: https://github.com/Azure/SONiC/blob/gh-pages/CONTRIBUTING.md failure_prs.log Make sure all your commits include a signature generated with `git commit -s` ** If this is a bug fix, make sure your description includes "fixes #xxxx", or "closes #xxxx" or "resolves #xxxx" Please provide the following information: --> #### Why I did it PG's 3 & 4 for Internal ports today have lossy buffer profiles attached, but this is redundant and can be removed as they occupy extra overhead even though it's not significant ##### Work item tracking - Microsoft ADO **(number only)**: #### How I did it Make the cable length for Dpc ports to 0m and create a new TC_PG_MAP for internal ports #### How to verify it Run config qos reload --no-dynamic-buffer, config save -y and config reload -y ``` redis-cli -n 4 hget "CABLE_LENGTH|AZURE" Ethernet224 "0m" redis-cli -n 4 hget "PORT_QOS_MAP|Ethernet232" tc_to_pg_map "AZURE_DPC" root@r-bobcat-01:/home/admin# sonic-db-cli CONFIG_DB HGETALL "TC_TO_PRIORITY_GROUP_MAP|AZURE_DPC" {'0': '0', '1': '0', '2': '0', '3': '0', '4': '0', '5': '0', '6': '0', '7': '7'} redis-cli -n 0 keys "BUFFER_PG*Ethernet232*" 1) "BUFFER_PG_TABLE:Ethernet232:0" redis-cli -n 0 keys "BUFFER_PG*Ethernet88*" 1) "BUFFER_PG_TABLE:Ethernet88:3-4" 2) "BUFFER_PG_TABLE:Ethernet88:0" ``` ``` 2025 Feb 14 11:36:15.333024 sonic NOTICE swss#buffermgrd: :- doSpeedUpdateTask: Not creating/updating PG profile for port Ethernet224. Cable length is set to 0m 2025 Feb 14 11:36:15.333024 sonic NOTICE swss#buffermgrd: :- doSpeedUpdateTask: Not creating/updating PG profile for port Ethernet232. Cable length is set to 0m 2025 Feb 14 11:36:15.333142 sonic NOTICE swss#buffermgrd: :- doSpeedUpdateTask: Not creating/updating PG profile for port Ethernet240. Cable length is set to 0m 2025 Feb 14 11:36:15.333142 sonic NOTICE swss#buffermgrd: :- doSpeedUpdateTask: Not creating/updating PG profile for port Ethernet248. Cable length is set to 0m ``` <!-- If PR needs to be backported, then the PR must be tested against the base branch and the earliest backport release branch and provide tested image version on these two branches. For example, if the PR is requested for master, 202211 and 202012, then the requester needs to provide test results on master and 202012. --> #### Which release branch to backport (provide reason below if selected) <!-- - Note we only backport fixes to a release branch, *not* features! - Please also provide a reason for the backporting below. - e.g. - [x] 202006 --> - [ ] 201811 - [ ] 201911 - [ ] 202006 - [ ] 202012 - [ ] 202106 - [ ] 202111 - [ ] 202205 - [ ] 202211 - [ ] 202305 #### Tested branch (Please provide the tested image version) <!-- - Please provide tested image version - e.g. - [x] 20201231.100 --> - [ ] <!-- image version 1 --> - [ ] <!-- image version 2 --> #### Description for the changelog <!-- Write a short (one line) summary that describes the changes in this pull request for inclusion in the changelog: --> <!-- Ensure to add label/tag for the feature raised. example - PR#2174 under sonic-utilities repo. where, Generic Config and Update feature has been labelled as GCU. --> #### Link to config_db schema for YANG module changes <!-- Provide a link to config_db schema for the table for which YANG model is defined Link should point to correct section on https://github.com/Azure/sonic-buildimage/blob/master/src/sonic-yang-models/doc/Configuration.md --> #### A picture of a cute animal (not mandatory but encouraged)
1 parent 54cd598 commit 31ab164

File tree

5 files changed

+32
-33
lines changed

5 files changed

+32
-33
lines changed

device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O28/buffers_defaults_objects.j2

+1-8
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,7 @@
9292
"BUFFER_PG": {
9393
"Dpc": {
9494
"active": {
95-
"dynamic": "ingress_lossy_profile",
96-
"static": "ingress_lossy_profile"
95+
"dynamic": "NULL"
9796
},
9897
"inactive": {
9998
"dynamic": "ingress_lossy_profile",
@@ -361,12 +360,6 @@
361360
"{{ port }}|3-4": {
362361
"profile" : {{find_profile_to_attach('BUFFER_PG', port, 'active', 'dynamic')}}
363362
},
364-
{% else %}
365-
{% if port in PORT_DPC %}
366-
"{{ port }}|3-4": {
367-
"profile" : {{find_profile_to_attach('BUFFER_PG', port, 'active', 'static')}}
368-
},
369-
{% endif %}
370363
{% endif %}
371364
"{{ port }}|0": {
372365
"profile" : "ingress_lossy_profile"

files/build_templates/buffers_config.j2

+3-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,9 @@ def
7979
{%- endif %}
8080
{%- endif %}
8181
{%- endfor %}
82-
{%- if cable_len -%}
82+
{%- if port_name in PORT_DPC -%}
83+
{{ '0m' }}
84+
{%- elif cable_len -%}
8385
{{ cable_len.0 }}
8486
{%- else %}
8587
{%- if 'torrouter' in switch_role.lower() and 'mgmt' not in switch_role.lower()%}

files/build_templates/qos_config.j2

+16
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,18 @@
101101
{{- generate_tc_to_pg_map_per_sku() }}
102102
{% else %}
103103
"TC_TO_PRIORITY_GROUP_MAP": {
104+
{% if PORT_DPC %}
105+
"AZURE_DPC": {
106+
"0": "0",
107+
"1": "0",
108+
"2": "0",
109+
"3": "0",
110+
"4": "0",
111+
"5": "0",
112+
"6": "0",
113+
"7": "7"
114+
},
115+
{% endif %}
104116
"AZURE": {
105117
"0": "0",
106118
"1": "0",
@@ -356,7 +368,11 @@
356368
{% endif %}
357369
"pfcwd_sw_enable" : "3,4",
358370
{% endif %}
371+
{% if port not in PORT_DPC %}
359372
"tc_to_pg_map" : "AZURE",
373+
{% else %}
374+
"tc_to_pg_map" : "AZURE_DPC",
375+
{% endif %}
360376
"pfc_to_queue_map": "AZURE"
361377
}{% if not loop.last %},{% endif %}
362378

src/sonic-config-engine/tests/sample_output/py3/qos-mellanox4700-o28-t1-smartswitch.json

+4-16
Original file line numberDiff line numberDiff line change
@@ -14,25 +14,25 @@
1414
"Ethernet224": {
1515
"dscp_to_tc_map": "AZURE",
1616
"tc_to_queue_map": "AZURE",
17-
"tc_to_pg_map": "AZURE",
17+
"tc_to_pg_map": "AZURE_DPC",
1818
"pfc_to_queue_map": "AZURE"
1919
},
2020
"Ethernet232": {
2121
"dscp_to_tc_map": "AZURE",
2222
"tc_to_queue_map": "AZURE",
23-
"tc_to_pg_map": "AZURE",
23+
"tc_to_pg_map": "AZURE_DPC",
2424
"pfc_to_queue_map": "AZURE"
2525
},
2626
"Ethernet240": {
2727
"dscp_to_tc_map": "AZURE",
2828
"tc_to_queue_map": "AZURE",
29-
"tc_to_pg_map": "AZURE",
29+
"tc_to_pg_map": "AZURE_DPC",
3030
"pfc_to_queue_map": "AZURE"
3131
},
3232
"Ethernet248": {
3333
"dscp_to_tc_map": "AZURE",
3434
"tc_to_queue_map": "AZURE",
35-
"tc_to_pg_map": "AZURE",
35+
"tc_to_pg_map": "AZURE_DPC",
3636
"pfc_to_queue_map": "AZURE"
3737
}
3838
},
@@ -415,27 +415,15 @@
415415
"Ethernet216|0": {
416416
"profile": "ingress_lossy_profile"
417417
},
418-
"Ethernet224|3-4": {
419-
"profile": "ingress_lossy_profile"
420-
},
421418
"Ethernet224|0": {
422419
"profile": "ingress_lossy_profile"
423420
},
424-
"Ethernet232|3-4": {
425-
"profile": "ingress_lossy_profile"
426-
},
427421
"Ethernet232|0": {
428422
"profile": "ingress_lossy_profile"
429423
},
430-
"Ethernet240|3-4": {
431-
"profile": "ingress_lossy_profile"
432-
},
433424
"Ethernet240|0": {
434425
"profile": "ingress_lossy_profile"
435426
},
436-
"Ethernet248|3-4": {
437-
"profile": "ingress_lossy_profile"
438-
},
439427
"Ethernet248|0": {
440428
"profile": "ingress_lossy_profile"
441429
},

src/sonic-config-engine/tests/sample_output/py3/qos-mellanox4700-o28-t1-smartswitch_dyn.json

+8-8
Original file line numberDiff line numberDiff line change
@@ -14,25 +14,25 @@
1414
"Ethernet224": {
1515
"dscp_to_tc_map": "AZURE",
1616
"tc_to_queue_map": "AZURE",
17-
"tc_to_pg_map": "AZURE",
17+
"tc_to_pg_map": "AZURE_DPC",
1818
"pfc_to_queue_map": "AZURE"
1919
},
2020
"Ethernet232": {
2121
"dscp_to_tc_map": "AZURE",
2222
"tc_to_queue_map": "AZURE",
23-
"tc_to_pg_map": "AZURE",
23+
"tc_to_pg_map": "AZURE_DPC",
2424
"pfc_to_queue_map": "AZURE"
2525
},
2626
"Ethernet240": {
2727
"dscp_to_tc_map": "AZURE",
2828
"tc_to_queue_map": "AZURE",
29-
"tc_to_pg_map": "AZURE",
29+
"tc_to_pg_map": "AZURE_DPC",
3030
"pfc_to_queue_map": "AZURE"
3131
},
3232
"Ethernet248": {
3333
"dscp_to_tc_map": "AZURE",
3434
"tc_to_queue_map": "AZURE",
35-
"tc_to_pg_map": "AZURE",
35+
"tc_to_pg_map": "AZURE_DPC",
3636
"pfc_to_queue_map": "AZURE"
3737
}
3838
},
@@ -391,25 +391,25 @@
391391
"profile": "ingress_lossy_profile"
392392
},
393393
"Ethernet224|3-4": {
394-
"profile": "ingress_lossy_profile"
394+
"profile": "NULL"
395395
},
396396
"Ethernet224|0": {
397397
"profile": "ingress_lossy_profile"
398398
},
399399
"Ethernet232|3-4": {
400-
"profile": "ingress_lossy_profile"
400+
"profile": "NULL"
401401
},
402402
"Ethernet232|0": {
403403
"profile": "ingress_lossy_profile"
404404
},
405405
"Ethernet240|3-4": {
406-
"profile": "ingress_lossy_profile"
406+
"profile": "NULL"
407407
},
408408
"Ethernet240|0": {
409409
"profile": "ingress_lossy_profile"
410410
},
411411
"Ethernet248|3-4": {
412-
"profile": "ingress_lossy_profile"
412+
"profile": "NULL"
413413
},
414414
"Ethernet248|0": {
415415
"profile": "ingress_lossy_profile"

0 commit comments

Comments
 (0)