Skip to content

Commit 0c9bbee

Browse files
authored
Update qos template to support SYSTEM_DEFAULT table (#10936)
* Update qos template to support SYSTEM_DEFAULT table Signed-off-by: bingwang <[email protected]>
1 parent 0552d6b commit 0c9bbee

15 files changed

+13866
-58
lines changed

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

+16-12
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"30": "1",
3636
"31": "1",
3737
"32": "1",
38-
"33": "2",
38+
"33": "8",
3939
"34": "1",
4040
"35": "1",
4141
"36": "1",
@@ -101,7 +101,7 @@
101101
"30": "1",
102102
"31": "1",
103103
"32": "1",
104-
"33": "2",
104+
"33": "8",
105105
"34": "1",
106106
"35": "1",
107107
"36": "1",
@@ -140,12 +140,13 @@
140140
"AZURE": {
141141
"0": "0",
142142
"1": "0",
143-
"2": "0",
143+
"2": "2",
144144
"3": "3",
145145
"4": "4",
146146
"5": "0",
147-
"6": "0",
148-
"7": "7"
147+
"6": "6",
148+
"7": "7",
149+
"8": "0"
149150
},
150151
"AZURE_TUNNEL": {
151152
"0": "0",
@@ -155,7 +156,8 @@
155156
"4": "6",
156157
"5": "0",
157158
"6": "0",
158-
"7": "0"
159+
"7": "0",
160+
"8": "0"
159161
}
160162
},
161163
{%- endmacro %}
@@ -164,12 +166,13 @@
164166
"AZURE": {
165167
"0": "0",
166168
"1": "1",
167-
"2": "1",
169+
"2": "1",
168170
"3": "3",
169171
"4": "4",
170172
"5": "5",
171173
"6": "6",
172-
"7": "7"
174+
"7": "7",
175+
"8": "1"
173176
},
174177
"AZURE_TUNNEL": {
175178
"0": "0",
@@ -179,7 +182,8 @@
179182
"4": "6",
180183
"5": "5",
181184
"6": "1",
182-
"7": "7"
185+
"7": "7",
186+
"8": "1"
183187
}
184188
},
185189
{%- endmacro %}
@@ -188,15 +192,15 @@
188192
"AZURE_TUNNEL": {
189193
"0": "8",
190194
"1": "0",
191-
"2": "33",
195+
"2": "0",
192196
"3": "2",
193197
"4": "6",
194198
"5": "46",
195199
"6": "0",
196-
"7": "48"
200+
"7": "48",
201+
"8": "33"
197202
}
198203
},
199204
{%- endmacro %}
200205
{% endif %}
201-
202206
{%- include 'qos_config.j2' %}

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

+15-10
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@
120120
"30": "1",
121121
"31": "1",
122122
"32": "1",
123-
"33": "2",
123+
"33": "8",
124124
"34": "1",
125125
"35": "1",
126126
"36": "1",
@@ -186,7 +186,7 @@
186186
"30": "1",
187187
"31": "1",
188188
"32": "1",
189-
"33": "2",
189+
"33": "8",
190190
"34": "1",
191191
"35": "1",
192192
"36": "1",
@@ -225,12 +225,13 @@
225225
"AZURE": {
226226
"0": "0",
227227
"1": "0",
228-
"2": "0",
228+
"2": "2",
229229
"3": "3",
230230
"4": "4",
231231
"5": "0",
232-
"6": "0",
233-
"7": "7"
232+
"6": "6",
233+
"7": "7",
234+
"8": "0"
234235
},
235236
"AZURE_TUNNEL": {
236237
"0": "0",
@@ -240,7 +241,8 @@
240241
"4": "6",
241242
"5": "0",
242243
"6": "0",
243-
"7": "0"
244+
"7": "0",
245+
"8": "0"
244246
}
245247
},
246248
{%- endmacro %}
@@ -254,7 +256,8 @@
254256
"4": "4",
255257
"5": "5",
256258
"6": "6",
257-
"7": "7"
259+
"7": "7",
260+
"8": "1"
258261
},
259262
"AZURE_TUNNEL": {
260263
"0": "0",
@@ -264,7 +267,8 @@
264267
"4": "6",
265268
"5": "5",
266269
"6": "1",
267-
"7": "7"
270+
"7": "7",
271+
"8": "1"
268272
}
269273
},
270274
{%- endmacro %}
@@ -273,12 +277,13 @@
273277
"AZURE_TUNNEL": {
274278
"0": "8",
275279
"1": "0",
276-
"2": "33",
280+
"2": "0",
277281
"3": "2",
278282
"4": "6",
279283
"5": "46",
280284
"6": "0",
281-
"7": "48"
285+
"7": "48",
286+
"8": "33"
282287
}
283288
},
284289
{%- endmacro %}

files/build_templates/qos_config.j2

+20-14
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,18 @@
2929
{%- endfor %}
3030
{%- set port_names_active = port_names_list_active | join(',') -%}
3131

32+
{%- set tunnel_qos_remap_enable = false %}
33+
{%- if ((SYSTEM_DEFAULTS is defined) and ('tunnel_qos_remap' in SYSTEM_DEFAULTS) and (SYSTEM_DEFAULTS['tunnel_qos_remap']['status'] == 'enabled')) %}
34+
{%- set tunnel_qos_remap_enable = true %}
35+
{%- endif %}
36+
3237
{%- set port_names_list_extra_queues = [] %}
3338
{%- 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') %}
39+
{% if ((generate_dscp_to_tc_map is defined) and tunnel_qos_remap_enable) and
40+
(('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
41+
('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')) %}
3642
{%- if port_names_list_extra_queues.append(port) %}{%- endif %}
37-
{% endif %}
43+
{% endif %}
3844
{%- endfor %}
3945

4046
{%- set pfc_to_pg_map_supported_asics = ['mellanox', 'barefoot', 'marvell'] -%}
@@ -43,7 +49,7 @@
4349

4450

4551
{
46-
{% if generate_tc_to_pg_map is defined %}
52+
{% if (generate_tc_to_pg_map is defined) and tunnel_qos_remap_enable %}
4753
{{- generate_tc_to_pg_map() }}
4854
{% else %}
4955
"TC_TO_PRIORITY_GROUP_MAP": {
@@ -71,7 +77,7 @@
7177
"7": "7"
7278
}
7379
},
74-
{% if generate_tc_to_queue_map is defined %}
80+
{% if (generate_tc_to_queue_map is defined) and tunnel_qos_remap_enable %}
7581
{{- generate_tc_to_queue_map() }}
7682
{% else %}
7783
"TC_TO_QUEUE_MAP": {
@@ -100,7 +106,7 @@
100106
"7": "7"
101107
}
102108
},
103-
{% elif generate_dscp_to_tc_map is defined %}
109+
{% elif (generate_dscp_to_tc_map is defined) and tunnel_qos_remap_enable %}
104110
{{- generate_dscp_to_tc_map() }}
105111
{% else %}
106112
"DSCP_TO_TC_MAP": {
@@ -172,7 +178,7 @@
172178
}
173179
},
174180
{% endif %}
175-
{% if generate_tc_to_dscp_map is defined %}
181+
{% if (generate_tc_to_dscp_map is defined) and tunnel_qos_remap_enable %}
176182
{{- generate_tc_to_dscp_map() }}
177183
{% endif %}
178184
{% if 'resource_type' in DEVICE_METADATA['localhost'] and DEVICE_METADATA['localhost']['resource_type'] in apollo_resource_types %}
@@ -289,12 +295,12 @@
289295
{% endfor %}
290296
{% for port in PORT_ACTIVE %}
291297
"{{ port }}|2": {
292-
{% if port in port_names_list_extra_queues %}
298+
{% if port in port_names_list_extra_queues %}
293299
"scheduler" : "scheduler.1",
294300
"wred_profile": "AZURE_LOSSLESS"
295-
{% else %}
301+
{% else %}
296302
"scheduler": "scheduler.0"
297-
{% endif %}
303+
{% endif %}
298304
},
299305
{% endfor %}
300306
{% for port in PORT_ACTIVE %}
@@ -304,12 +310,12 @@
304310
{% endfor %}
305311
{% for port in PORT_ACTIVE %}
306312
"{{ port }}|6": {
307-
{% if port in port_names_list_extra_queues %}
313+
{% if port in port_names_list_extra_queues %}
308314
"scheduler" : "scheduler.1",
309-
"wred_profile": "AZURE_LOSSLESS"
310-
{% else %}
315+
"wred_profile": "AZURE_LOSSLESS"
316+
{% else %}
311317
"scheduler": "scheduler.0"
312-
{% endif %}
318+
{% endif %}
313319
}{% if not loop.last %},{% endif %}
314320

315321
{% endfor %}

0 commit comments

Comments
 (0)