Skip to content

Commit 5785cd5

Browse files
authored
Merge pull request sonic-net#115 from mssonicbld/sonicbld/202205-merge
[code sync] Merge code from sonic-net/sonic-buildimage:202205 to 202205
2 parents 37b9499 + 6cadf4e commit 5785cd5

File tree

1 file changed

+57
-0
lines changed

1 file changed

+57
-0
lines changed

files/build_templates/qos_config.j2

+57
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,12 @@
7979
{
8080
{% if (generate_tc_to_pg_map is defined) and tunnel_qos_remap_enable %}
8181
{{- generate_tc_to_pg_map() }}
82+
{% elif (generate_tc_to_pg_map is defined) and
83+
('type' in DEVICE_METADATA['localhost'] and
84+
DEVICE_METADATA['localhost']['type'] in backend_device_types) and
85+
('resource_type' in DEVICE_METADATA['localhost'] and
86+
DEVICE_METADATA['localhost']['resource_type'] == 'Compute-AI') %}
87+
{{- generate_tc_to_pg_map() }}
8288
{% else %}
8389
"TC_TO_PRIORITY_GROUP_MAP": {
8490
"AZURE": {
@@ -137,6 +143,12 @@
137143
},
138144
{% elif (generate_dscp_to_tc_map is defined) and tunnel_qos_remap_enable %}
139145
{{- generate_dscp_to_tc_map() }}
146+
{% elif (generate_dscp_to_tc_map is defined) and
147+
('type' in DEVICE_METADATA['localhost'] and
148+
DEVICE_METADATA['localhost']['type'] in backend_device_types) and
149+
('resource_type' in DEVICE_METADATA['localhost'] and
150+
DEVICE_METADATA['localhost']['resource_type'] == 'Compute-AI') %}
151+
{{- generate_dscp_to_tc_map() }}
140152
{% else %}
141153
"DSCP_TO_TC_MAP": {
142154
"AZURE": {
@@ -225,6 +237,29 @@
225237
"weight": "100"
226238
}
227239
},
240+
{% elif (generate_tc_to_pg_map is defined) and
241+
('type' in DEVICE_METADATA['localhost'] and
242+
DEVICE_METADATA['localhost']['type'] in backend_device_types) and
243+
('resource_type' in DEVICE_METADATA['localhost'] and
244+
DEVICE_METADATA['localhost']['resource_type'] == 'Compute-AI') %}
245+
"SCHEDULER": {
246+
"scheduler.0": {
247+
"type" : "DWRR",
248+
"weight": "40"
249+
},
250+
"scheduler.1": {
251+
"type" : "DWRR",
252+
"weight": "30"
253+
},
254+
"scheduler.2": {
255+
"type" : "DWRR",
256+
"weight": "25"
257+
},
258+
"scheduler.3": {
259+
"type" : "DWRR",
260+
"weight": "5"
261+
}
262+
},
228263
{% else %}
229264
"SCHEDULER": {
230265
"scheduler.0": {
@@ -368,6 +403,27 @@
368403
}
369404
{% else %}
370405
"QUEUE": {
406+
{% if 'type' in DEVICE_METADATA['localhost'] and
407+
DEVICE_METADATA['localhost']['type'] in backend_device_types and
408+
'resource_type' in DEVICE_METADATA['localhost'] and
409+
DEVICE_METADATA['localhost']['resource_type'] == 'Compute-AI' %}
410+
{% for port in PORT_ACTIVE %}
411+
"{{ port }}|0": {
412+
"scheduler": "scheduler.0"
413+
},
414+
"{{ port }}|1": {
415+
"scheduler": "scheduler.1"
416+
},
417+
"{{ port }}|3": {
418+
"scheduler" : "scheduler.2",
419+
"wred_profile": "AZURE_LOSSLESS"
420+
},
421+
"{{ port }}|4": {
422+
"scheduler" : "scheduler.3",
423+
"wred_profile": "AZURE_LOSSLESS"
424+
}{% if not loop.last %},{% endif %}
425+
{% endfor %}
426+
{% else %}
371427
{% for port in PORT_ACTIVE %}
372428
"{{ port }}|3": {
373429
"scheduler" : "scheduler.1",
@@ -431,6 +487,7 @@
431487
}{% if not loop.last %},{% endif %}
432488

433489
{% endfor %}
490+
{% endif %}
434491
}
435492
{% endif %}
436493
}

0 commit comments

Comments
 (0)