Skip to content

Commit b9dd1df

Browse files
authored
Update qos config to clear queues for bounced back traffic (#10176)
* Update qos config to clear queues for bounced back traffic Signed-off-by: bingwang <[email protected]>
1 parent 64dc08a commit b9dd1df

21 files changed

+14780
-302
lines changed

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

-1
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../Arista-7050CX3-32S-D48C8/qos.json.j2
Original file line numberDiff line numberDiff line change
@@ -1 +1,102 @@
1+
{% if 'subtype' in DEVICE_METADATA['localhost'] and DEVICE_METADATA['localhost']['subtype'] == 'DualToR' %}
2+
{%- macro generate_dscp_to_tc_map() %}
3+
"DSCP_TO_TC_MAP": {
4+
"AZURE": {
5+
"0" : "1",
6+
"1" : "1",
7+
"2" : "1",
8+
"3" : "3",
9+
"4" : "4",
10+
"5" : "1",
11+
"6" : "1",
12+
"7" : "1",
13+
"8" : "0",
14+
"9" : "1",
15+
"10": "1",
16+
"11": "1",
17+
"12": "1",
18+
"13": "1",
19+
"14": "1",
20+
"15": "1",
21+
"16": "1",
22+
"17": "1",
23+
"18": "1",
24+
"19": "1",
25+
"20": "1",
26+
"21": "1",
27+
"22": "1",
28+
"23": "1",
29+
"24": "1",
30+
"25": "1",
31+
"26": "1",
32+
"27": "1",
33+
"28": "1",
34+
"29": "1",
35+
"30": "1",
36+
"31": "1",
37+
"32": "1",
38+
"33": "2",
39+
"34": "1",
40+
"35": "1",
41+
"36": "1",
42+
"37": "1",
43+
"38": "1",
44+
"39": "1",
45+
"40": "1",
46+
"41": "1",
47+
"42": "1",
48+
"43": "1",
49+
"44": "1",
50+
"45": "1",
51+
"46": "5",
52+
"47": "1",
53+
"48": "7",
54+
"49": "1",
55+
"50": "1",
56+
"51": "1",
57+
"52": "1",
58+
"53": "1",
59+
"54": "1",
60+
"55": "1",
61+
"56": "1",
62+
"57": "1",
63+
"58": "1",
64+
"59": "1",
65+
"60": "1",
66+
"61": "1",
67+
"62": "1",
68+
"63": "1"
69+
}
70+
},
71+
{%- endmacro %}
72+
{%- macro generate_tc_to_pg_map() %}
73+
"TC_TO_PRIORITY_GROUP_MAP": {
74+
"AZURE": {
75+
"0": "0",
76+
"1": "0",
77+
"2": "0",
78+
"3": "3",
79+
"4": "4",
80+
"5": "0",
81+
"6": "0",
82+
"7": "7"
83+
}
84+
},
85+
{%- endmacro %}
86+
{%- macro generate_tc_to_queue_map() %}
87+
"TC_TO_QUEUE_MAP": {
88+
"AZURE": {
89+
"0": "0",
90+
"1": "1",
91+
"2": "1",
92+
"3": "3",
93+
"4": "4",
94+
"5": "5",
95+
"6": "6",
96+
"7": "7"
97+
}
98+
},
99+
{%- endmacro %}
100+
{% endif %}
101+
1102
{%- include 'qos_config.j2' %}
Original file line numberDiff line numberDiff line change
@@ -1 +1,187 @@
1+
{% if ('type' in DEVICE_METADATA['localhost'] and DEVICE_METADATA['localhost']['type'] == 'LeafRouter') %}
2+
{%- macro generate_dscp_to_tc_map() %}
3+
"DSCP_TO_TC_MAP": {
4+
"AZURE": {
5+
"0" : "1",
6+
"1" : "1",
7+
"2" : "2",
8+
"3" : "3",
9+
"4" : "4",
10+
"5" : "1",
11+
"6" : "6",
12+
"7" : "1",
13+
"8" : "0",
14+
"9" : "1",
15+
"10": "1",
16+
"11": "1",
17+
"12": "1",
18+
"13": "1",
19+
"14": "1",
20+
"15": "1",
21+
"16": "1",
22+
"17": "1",
23+
"18": "1",
24+
"19": "1",
25+
"20": "1",
26+
"21": "1",
27+
"22": "1",
28+
"23": "1",
29+
"24": "1",
30+
"25": "1",
31+
"26": "1",
32+
"27": "1",
33+
"28": "1",
34+
"29": "1",
35+
"30": "1",
36+
"31": "1",
37+
"32": "1",
38+
"33": "1",
39+
"34": "1",
40+
"35": "1",
41+
"36": "1",
42+
"37": "1",
43+
"38": "1",
44+
"39": "1",
45+
"40": "1",
46+
"41": "1",
47+
"42": "1",
48+
"43": "1",
49+
"44": "1",
50+
"45": "1",
51+
"46": "5",
52+
"47": "1",
53+
"48": "7",
54+
"49": "1",
55+
"50": "1",
56+
"51": "1",
57+
"52": "1",
58+
"53": "1",
59+
"54": "1",
60+
"55": "1",
61+
"56": "1",
62+
"57": "1",
63+
"58": "1",
64+
"59": "1",
65+
"60": "1",
66+
"61": "1",
67+
"62": "1",
68+
"63": "1"
69+
}
70+
},
71+
{%- endmacro %}
72+
{%- macro generate_tc_to_pg_map() %}
73+
"TC_TO_PRIORITY_GROUP_MAP": {
74+
"AZURE": {
75+
"0": "0",
76+
"1": "0",
77+
"2": "2",
78+
"3": "3",
79+
"4": "4",
80+
"5": "0",
81+
"6": "6",
82+
"7": "7"
83+
}
84+
},
85+
{%- endmacro %}
86+
{% elif ('subtype' in DEVICE_METADATA['localhost'] and DEVICE_METADATA['localhost']['subtype'] == 'DualToR') %}
87+
{%- macro generate_dscp_to_tc_map() %}
88+
"DSCP_TO_TC_MAP": {
89+
"AZURE": {
90+
"0" : "1",
91+
"1" : "1",
92+
"2" : "1",
93+
"3" : "3",
94+
"4" : "4",
95+
"5" : "1",
96+
"6" : "1",
97+
"7" : "1",
98+
"8" : "0",
99+
"9" : "1",
100+
"10": "1",
101+
"11": "1",
102+
"12": "1",
103+
"13": "1",
104+
"14": "1",
105+
"15": "1",
106+
"16": "1",
107+
"17": "1",
108+
"18": "1",
109+
"19": "1",
110+
"20": "1",
111+
"21": "1",
112+
"22": "1",
113+
"23": "1",
114+
"24": "1",
115+
"25": "1",
116+
"26": "1",
117+
"27": "1",
118+
"28": "1",
119+
"29": "1",
120+
"30": "1",
121+
"31": "1",
122+
"32": "1",
123+
"33": "2",
124+
"34": "1",
125+
"35": "1",
126+
"36": "1",
127+
"37": "1",
128+
"38": "1",
129+
"39": "1",
130+
"40": "1",
131+
"41": "1",
132+
"42": "1",
133+
"43": "1",
134+
"44": "1",
135+
"45": "1",
136+
"46": "5",
137+
"47": "1",
138+
"48": "7",
139+
"49": "1",
140+
"50": "1",
141+
"51": "1",
142+
"52": "1",
143+
"53": "1",
144+
"54": "1",
145+
"55": "1",
146+
"56": "1",
147+
"57": "1",
148+
"58": "1",
149+
"59": "1",
150+
"60": "1",
151+
"61": "1",
152+
"62": "1",
153+
"63": "1"
154+
}
155+
},
156+
{%- endmacro %}
157+
{%- macro generate_tc_to_pg_map() %}
158+
"TC_TO_PRIORITY_GROUP_MAP": {
159+
"AZURE": {
160+
"0": "0",
161+
"1": "0",
162+
"2": "0",
163+
"3": "3",
164+
"4": "4",
165+
"5": "0",
166+
"6": "0",
167+
"7": "7"
168+
}
169+
},
170+
{%- endmacro %}
171+
{%- macro generate_tc_to_queue_map() %}
172+
"TC_TO_QUEUE_MAP": {
173+
"AZURE": {
174+
"0": "0",
175+
"1": "1",
176+
"2": "1",
177+
"3": "3",
178+
"4": "4",
179+
"5": "5",
180+
"6": "6",
181+
"7": "7"
182+
}
183+
},
184+
{%- endmacro %}
185+
{% endif %}
186+
1187
{%- include 'qos_config.j2' %}

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

-1
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../Arista-7260CX3-C64/qos.json.j2

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

-1
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../Arista-7260CX3-C64/qos.json.j2

files/build_templates/qos_config.j2

+29-1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,13 @@
2929
{%- endfor %}
3030
{%- set port_names_active = port_names_list_active | join(',') -%}
3131

32+
{%- set port_names_list_extra_queues = [] %}
33+
{%- for port in PORT_ACTIVE %}
34+
{% if (generate_dscp_to_tc_map is defined) and ('type' in DEVICE_METADATA['localhost'] and DEVICE_METADATA['localhost']['type'] == 'LeafRouter' and DEVICE_NEIGHBOR_METADATA is defined and DEVICE_NEIGHBOR[port].name in DEVICE_NEIGHBOR_METADATA and DEVICE_NEIGHBOR_METADATA[DEVICE_NEIGHBOR[port].name].type == 'ToRRouter') or
35+
('subtype' in DEVICE_METADATA['localhost'] and DEVICE_METADATA['localhost']['subtype'] == 'DualToR' and DEVICE_NEIGHBOR_METADATA is defined and DEVICE_NEIGHBOR[port].name in DEVICE_NEIGHBOR_METADATA and DEVICE_NEIGHBOR_METADATA[DEVICE_NEIGHBOR[port].name].type == 'LeafRouter') %}
36+
{%- if port_names_list_extra_queues.append(port) %}{%- endif %}
37+
{% endif %}
38+
{%- endfor %}
3239

3340
{%- set pfc_to_pg_map_supported_asics = ['mellanox', 'barefoot', 'marvell'] -%}
3441
{%- set backend_device_types = ['BackEndToRRouter', 'BackEndLeafRouter'] -%}
@@ -64,6 +71,9 @@
6471
"7": "7"
6572
}
6673
},
74+
{% if generate_tc_to_queue_map is defined %}
75+
{{- generate_tc_to_queue_map() }}
76+
{% else %}
6777
"TC_TO_QUEUE_MAP": {
6878
"AZURE": {
6979
"0": "0",
@@ -76,6 +86,7 @@
7686
"7": "7"
7787
}
7888
},
89+
{% endif %}
7990
{% if 'type' in DEVICE_METADATA['localhost'] and DEVICE_METADATA['localhost']['type'] in backend_device_types and 'storage_device' in DEVICE_METADATA['localhost'] and DEVICE_METADATA['localhost']['storage_device'] == 'true' %}
8091
"DOT1P_TO_TC_MAP": {
8192
"AZURE": {
@@ -89,6 +100,8 @@
89100
"7": "7"
90101
}
91102
},
103+
{% elif generate_dscp_to_tc_map is defined %}
104+
{{- generate_dscp_to_tc_map() }}
92105
{% else %}
93106
"DSCP_TO_TC_MAP": {
94107
"AZURE": {
@@ -208,7 +221,12 @@
208221
{% if asic_type in pfc_to_pg_map_supported_asics %}
209222
"pfc_to_pg_map" : "AZURE",
210223
{% endif %}
211-
"pfc_enable" : "3,4"
224+
{% if port in port_names_list_extra_queues %}
225+
"pfc_enable" : "2,3,4,6",
226+
{% else %}
227+
"pfc_enable" : "3,4",
228+
{% endif %}
229+
"pfcwd_sw_enable" : "3,4"
212230
}{% if not loop.last %},{% endif %}
213231

214232
{% endfor %}
@@ -268,7 +286,12 @@
268286
{% endfor %}
269287
{% for port in PORT_ACTIVE %}
270288
"{{ port }}|2": {
289+
{% if port in port_names_list_extra_queues %}
290+
"scheduler" : "scheduler.1",
291+
"wred_profile": "AZURE_LOSSLESS"
292+
{% else %}
271293
"scheduler": "scheduler.0"
294+
{% endif %}
272295
},
273296
{% endfor %}
274297
{% for port in PORT_ACTIVE %}
@@ -278,7 +301,12 @@
278301
{% endfor %}
279302
{% for port in PORT_ACTIVE %}
280303
"{{ port }}|6": {
304+
{% if port in port_names_list_extra_queues %}
305+
"scheduler" : "scheduler.1",
306+
"wred_profile": "AZURE_LOSSLESS"
307+
{% else %}
281308
"scheduler": "scheduler.0"
309+
{% endif %}
282310
}{% if not loop.last %},{% endif %}
283311

284312
{% endfor %}

0 commit comments

Comments
 (0)