Skip to content

Commit 81aef6b

Browse files
wendanilguohan
authored andcommitted
[Qos] use dot1p to tc mapping for backend switches (#3422)
* Use dot1p to tc mapping for backend switches Signed-off-by: Wenda Ni <[email protected]> * Do not write DSCP to TC mapping into CONFIG_DB or config_db.json for storage switches Signed-off-by: Wenda Ni <[email protected]>
1 parent 97c675c commit 81aef6b

2 files changed

Lines changed: 21 additions & 1 deletion

File tree

files/build_templates/qos_config.j2

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929

3030

3131
{%- set pfc_to_pg_map_supported_asics = ['mellanox', 'barefoot', 'marvell'] -%}
32+
{%- set backend_device_types = ['BackEndToRRouter', 'BackEndLeafRouter'] -%}
3233

3334

3435
{
@@ -72,6 +73,20 @@
7273
"7": "7"
7374
}
7475
},
76+
{% if 'type' in DEVICE_METADATA['localhost'] and DEVICE_METADATA['localhost']['type'] in backend_device_types %}
77+
"DOT1P_TO_TC_MAP": {
78+
"AZURE": {
79+
"0": "0",
80+
"1": "1",
81+
"2": "2",
82+
"3": "3",
83+
"4": "4",
84+
"5": "5",
85+
"6": "6",
86+
"7": "7"
87+
}
88+
},
89+
{% else %}
7590
"DSCP_TO_TC_MAP": {
7691
"AZURE": {
7792
"0" : "1",
@@ -140,6 +155,7 @@
140155
"63": "1"
141156
}
142157
},
158+
{% endif %}
143159
"SCHEDULER": {
144160
"scheduler.0": {
145161
"type" : "DWRR",
@@ -160,7 +176,11 @@
160176
{% endif %}
161177
"PORT_QOS_MAP": {
162178
"{{ port_names_active }}": {
179+
{% if 'type' in DEVICE_METADATA['localhost'] and DEVICE_METADATA['localhost']['type'] in backend_device_types %}
180+
"dot1p_to_tc_map" : "[DOT1P_TO_TC_MAP|AZURE]",
181+
{% else %}
163182
"dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]",
183+
{% endif %}
164184
"tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]",
165185
"tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]",
166186
"pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]",

platform/vs/docker-sonic-vs/start.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ if [ -f /etc/sonic/config_db.json ]; then
1818
else
1919
# generate and merge buffers configuration into config file
2020
sonic-cfggen -t /usr/share/sonic/hwsku/buffers.json.j2 > /tmp/buffers.json
21-
sonic-cfggen -t /usr/share/sonic/hwsku/qos.json.j2 > /tmp/qos.json
21+
sonic-cfggen -j /etc/sonic/init_cfg.json -t /usr/share/sonic/hwsku/qos.json.j2 > /tmp/qos.json
2222
sonic-cfggen -p /usr/share/sonic/hwsku/port_config.ini -k $HWSKU --print-data > /tmp/ports.json
2323
sonic-cfggen -j /etc/sonic/init_cfg.json -j /tmp/buffers.json -j /tmp/qos.json -j /tmp/ports.json --print-data > /etc/sonic/config_db.json
2424
fi

0 commit comments

Comments
 (0)