Skip to content

Commit f3f4fc1

Browse files
bingwang-msskbarista
authored andcommitted
Add extra lossy PG profile for ports between T1 and T2 (sonic-net#11157)
Signed-off-by: bingwang <[email protected]> Why I did it This PR brings two changes Add lossy PG profile for PG2 and PG6 on T1 for ports between T1 and T2. After PR Update qos config to clear queues for bounced back traffic sonic-net#10176 , the DSCP_TO_TC_MAP and TC_TO_PG_MAP is updated when remapping is enable DSCP_TO_TC_MAP Before After Why do this change "2" : "1" "2" : "2" Only change for leaf router to map DSCP 2 to TC 2 as TC 2 will be used for lossless TC "6" : "1" "6" : "6" Only change for leaf router to map DSCP 6 to TC 6 as TC 6 will be used for lossless TC TC_TO_PRIORITY_GROUP_MAP Before After Why do this change "2" : "0" "2" : "2" Only change for leaf router to map TC 2 to PG 2 as PG 2 will be used for lossless PG "6" : "0" "6" : "6" Only change for leaf router to map TC 6 to PG 6 as PG 6 will be used for lossless PG So, we have two new lossy PGs (2 and 6) for the T2 facing ports on T1, and two new lossless PGs (2 and 6) for the T0 facing port on T1. However, there is no lossy PG profile for the T2 facing ports on T1. The lossless PGs for ports between T1 and T0 have been handled by buffermgrd .Therefore, We need to add lossy PG profiles for T2 facing ports on T1. We don't have this issue on T0 because PG 2 and PG 6 are lossless PGs, and there is no lossy traffic mapped to PG 2 and PG 6 Map port level TC7 to PG0 Before the PCBB change, DSCP48 -> TC 6 -> PG 0. After the PCBB change, DSCP48 -> TC 7 -> PG 7 Actually, we can map TC7 to PG0 to save a lossy PG. How I did it Update the qos and buffer template. How to verify it Verified by UT.
1 parent 1a04f35 commit f3f4fc1

File tree

11 files changed

+91
-10
lines changed

11 files changed

+91
-10
lines changed

device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-D48C8/qos.json.j2

+1-1
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@
145145
"4": "4",
146146
"5": "0",
147147
"6": "6",
148-
"7": "7",
148+
"7": "0",
149149
"8": "0"
150150
},
151151
"AZURE_TUNNEL": {

device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-C64/buffers_defaults_t1.j2

+6-2
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,12 @@
5555
},
5656
{%- endmacro %}
5757

58-
{% import 'buffers_extra_queues.j2' as defs with context %}
58+
{% import 'buffers_extra_queues.j2' as defs1 with context %}
59+
{% import 'buffers_extra_pgs.j2' as defs2 with context %}
5960

6061
{%- macro generate_queue_buffers_with_extra_lossless_queues(port_names, port_names_require_extra_buffer) %}
61-
{{ defs.generate_queue_buffers_with_extra_lossless_queues(port_names, port_names_require_extra_buffer) }}
62+
{{ defs1.generate_queue_buffers_with_extra_lossless_queues(port_names, port_names_require_extra_buffer) }}
63+
{%- endmacro %}
64+
{%- macro generate_pg_buffers_with_extra_lossy_pgs(port_names, port_names_require_no_extra_pgs) %}
65+
{{ defs2.generate_pg_buffers_with_extra_lossy_pgs(port_names, port_names_require_no_extra_pgs) }}
6266
{%- endmacro %}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{% if DEVICE_METADATA is defined and 'type' in DEVICE_METADATA['localhost'] and DEVICE_METADATA['localhost']['type'] == 'LeafRouter' %}
2+
{%- macro generate_pg_buffers_with_extra_lossy_pgs(port_names, port_names_require_no_extra_pg) %}
3+
"BUFFER_PG": {
4+
{% for port in port_names.split(',') %}
5+
{% if port not in port_names_require_no_extra_pg.split(',') %}
6+
"{{ port }}|2": {
7+
"profile" : "ingress_lossy_profile"
8+
},
9+
"{{ port }}|6": {
10+
"profile" : "ingress_lossy_profile"
11+
},
12+
{% endif %}
13+
"{{ port }}|0": {
14+
"profile" : "ingress_lossy_profile"
15+
}{% if not loop.last %},{% endif %}
16+
17+
{% endfor %}
18+
},
19+
{% endmacro %}
20+
{% endif %}

device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-C64/qos.json.j2

+2-2
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
"4": "4",
8080
"5": "0",
8181
"6": "6",
82-
"7": "7"
82+
"7": "0"
8383
}
8484
},
8585
{%- endmacro %}
@@ -230,7 +230,7 @@
230230
"4": "4",
231231
"5": "0",
232232
"6": "6",
233-
"7": "7",
233+
"7": "0",
234234
"8": "0"
235235
},
236236
"AZURE_TUNNEL": {

device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-Q64/buffers_defaults_t1.j2

+6-2
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,12 @@
4949
},
5050
{%- endmacro %}
5151

52-
{% import 'buffers_extra_queues.j2' as defs with context %}
52+
{% import 'buffers_extra_queues.j2' as defs1 with context %}
53+
{% import 'buffers_extra_pgs.j2' as defs2 with context %}
5354

5455
{%- macro generate_queue_buffers_with_extra_lossless_queues(port_names, port_names_require_extra_buffer) %}
55-
{{ defs.generate_queue_buffers_with_extra_lossless_queues(port_names, port_names_require_extra_buffer) }}
56+
{{ defs1.generate_queue_buffers_with_extra_lossless_queues(port_names, port_names_require_extra_buffer) }}
57+
{%- endmacro %}
58+
{%- macro generate_pg_buffers_with_extra_lossy_pgs(port_names, port_names_require_no_extra_pgs) %}
59+
{{ defs2.generate_pg_buffers_with_extra_lossy_pgs(port_names, port_names_require_no_extra_pgs) }}
5660
{%- endmacro %}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../Arista-7260CX3-C64/buffers_extra_pgs.j2

files/build_templates/buffers_config.j2

+4
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,10 @@ def
172172
{{ defs.generate_pg_profils(port_names_active) }}
173173
{% elif defs.generate_pg_profiles_with_inactive_ports is defined %}
174174
{{ defs.generate_pg_profiles_with_inactive_ports(port_names_active, port_names_inactive) }},
175+
{% elif (defs.generate_pg_buffers_with_extra_lossy_pgs is defined) and (port_names_extra_queues != '') %}
176+
{{ defs.generate_pg_buffers_with_extra_lossy_pgs(port_names_active, port_names_extra_queues) }}
177+
{% elif (defs.generate_pg_buffers_with_extra_lossy_pgs_with_inactive_ports is defined) and (port_names_extra_queues != '') %}
178+
{{ defs.generate_pg_buffers_with_extra_lossy_pgs_with_inactive_ports(port_names_active, port_names_extra_queues, port_names_inactive) }}
175179
{% else %}
176180
"BUFFER_PG": {
177181
{% for port in PORT_ACTIVE %}

src/sonic-config-engine/tests/sample_output/py3/buffer-arista7260-t1.json

+48
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,21 @@
112112
"Ethernet0|0": {
113113
"profile" : "ingress_lossy_profile"
114114
},
115+
"Ethernet0|2": {
116+
"profile" : "ingress_lossy_profile"
117+
},
118+
"Ethernet0|6": {
119+
"profile" : "ingress_lossy_profile"
120+
},
115121
"Ethernet4|0": {
116122
"profile" : "ingress_lossy_profile"
117123
},
124+
"Ethernet4|2": {
125+
"profile" : "ingress_lossy_profile"
126+
},
127+
"Ethernet4|6": {
128+
"profile" : "ingress_lossy_profile"
129+
},
118130
"Ethernet144|0": {
119131
"profile" : "ingress_lossy_profile"
120132
},
@@ -124,9 +136,21 @@
124136
"Ethernet16|0": {
125137
"profile" : "ingress_lossy_profile"
126138
},
139+
"Ethernet16|2": {
140+
"profile" : "ingress_lossy_profile"
141+
},
142+
"Ethernet16|6": {
143+
"profile" : "ingress_lossy_profile"
144+
},
127145
"Ethernet20|0": {
128146
"profile" : "ingress_lossy_profile"
129147
},
148+
"Ethernet20|2": {
149+
"profile" : "ingress_lossy_profile"
150+
},
151+
"Ethernet20|6": {
152+
"profile" : "ingress_lossy_profile"
153+
},
130154
"Ethernet152|0": {
131155
"profile" : "ingress_lossy_profile"
132156
},
@@ -136,9 +160,21 @@
136160
"Ethernet64|0": {
137161
"profile" : "ingress_lossy_profile"
138162
},
163+
"Ethernet64|2": {
164+
"profile" : "ingress_lossy_profile"
165+
},
166+
"Ethernet64|6": {
167+
"profile" : "ingress_lossy_profile"
168+
},
139169
"Ethernet68|0": {
140170
"profile" : "ingress_lossy_profile"
141171
},
172+
"Ethernet68|2": {
173+
"profile" : "ingress_lossy_profile"
174+
},
175+
"Ethernet68|6": {
176+
"profile" : "ingress_lossy_profile"
177+
},
142178
"Ethernet168|0": {
143179
"profile" : "ingress_lossy_profile"
144180
},
@@ -148,9 +184,21 @@
148184
"Ethernet80|0": {
149185
"profile" : "ingress_lossy_profile"
150186
},
187+
"Ethernet80|2": {
188+
"profile" : "ingress_lossy_profile"
189+
},
190+
"Ethernet80|6": {
191+
"profile" : "ingress_lossy_profile"
192+
},
151193
"Ethernet84|0": {
152194
"profile" : "ingress_lossy_profile"
153195
},
196+
"Ethernet84|2": {
197+
"profile" : "ingress_lossy_profile"
198+
},
199+
"Ethernet84|6": {
200+
"profile" : "ingress_lossy_profile"
201+
},
154202
"Ethernet180|0": {
155203
"profile" : "ingress_lossy_profile"
156204
},

src/sonic-config-engine/tests/sample_output/py3/qos-arista7050cx3-dualtor.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@
178178
"4": "4",
179179
"5": "0",
180180
"6": "6",
181-
"7": "7",
181+
"7": "0",
182182
"8": "0"
183183
},
184184
"AZURE_TUNNEL": {

src/sonic-config-engine/tests/sample_output/py3/qos-arista7260-dualtor.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@
178178
"4": "4",
179179
"5": "0",
180180
"6": "6",
181-
"7": "7",
181+
"7": "0",
182182
"8": "0"
183183
},
184184
"AZURE_TUNNEL": {

src/sonic-config-engine/tests/sample_output/py3/qos-arista7260-t1.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@
100100
"4": "4",
101101
"5": "0",
102102
"6": "6",
103-
"7": "7"
103+
"7": "0"
104104
}
105105
},
106106
"SCHEDULER": {

0 commit comments

Comments
 (0)