From 9959fdf09038e70b6b9f811e60f69b8cfcce46d0 Mon Sep 17 00:00:00 2001 From: bingwang Date: Thu, 9 Jun 2022 07:57:55 +0000 Subject: [PATCH 1/2] Generate switch level dscp_to_tc_map Signed-off-by: bingwang --- files/build_templates/qos_config.j2 | 7 +++++++ .../tests/sample_output/py2/qos-arista7050.json | 3 +++ .../tests/sample_output/py2/qos-arista7800r3-48cq2-lc.json | 3 +++ .../tests/sample_output/py2/qos-dell6100.json | 3 +++ .../tests/sample_output/py2/qos-dell9332.json | 3 +++ .../tests/sample_output/py3/qos-arista7050.json | 3 +++ .../py3/qos-arista7050cx3-dualtor-remap-disabled.json | 3 +++ .../tests/sample_output/py3/qos-arista7050cx3-dualtor.json | 3 +++ .../py3/qos-arista7260-dualtor-remap-disabled.json | 3 +++ .../tests/sample_output/py3/qos-arista7260-dualtor.json | 3 +++ .../py3/qos-arista7260-t1-remap-disabled.json | 3 +++ .../tests/sample_output/py3/qos-arista7260-t1.json | 3 +++ .../tests/sample_output/py3/qos-arista7800r3-48cq2-lc.json | 3 +++ .../tests/sample_output/py3/qos-dell6100.json | 3 +++ .../tests/sample_output/py3/qos-dell9332.json | 3 +++ 15 files changed, 49 insertions(+) diff --git a/files/build_templates/qos_config.j2 b/files/build_templates/qos_config.j2 index 3d95d333594b..06698883bf4c 100644 --- a/files/build_templates/qos_config.j2 +++ b/files/build_templates/qos_config.j2 @@ -217,6 +217,13 @@ }, {% endif %} "PORT_QOS_MAP": { +{% if generate_global_dscp_to_tc_map is defined %} + {{- generate_global_dscp_to_tc_map() }} +{% else %} + "global": { + "dscp_to_tc_map" : "AZURE" + }, +{% endif %} {% for port in PORT_ACTIVE %} "{{ port }}": { {% 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' %} diff --git a/src/sonic-config-engine/tests/sample_output/py2/qos-arista7050.json b/src/sonic-config-engine/tests/sample_output/py2/qos-arista7050.json index b15fcf7a36c1..6a09e605c3f2 100644 --- a/src/sonic-config-engine/tests/sample_output/py2/qos-arista7050.json +++ b/src/sonic-config-engine/tests/sample_output/py2/qos-arista7050.json @@ -114,6 +114,9 @@ } }, "PORT_QOS_MAP": { + "global": { + "dscp_to_tc_map" : "AZURE" + }, "Ethernet4": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", diff --git a/src/sonic-config-engine/tests/sample_output/py2/qos-arista7800r3-48cq2-lc.json b/src/sonic-config-engine/tests/sample_output/py2/qos-arista7800r3-48cq2-lc.json index 92ba2caf8d17..48b3a293e02b 100644 --- a/src/sonic-config-engine/tests/sample_output/py2/qos-arista7800r3-48cq2-lc.json +++ b/src/sonic-config-engine/tests/sample_output/py2/qos-arista7800r3-48cq2-lc.json @@ -114,6 +114,9 @@ } }, "PORT_QOS_MAP": { + "global": { + "dscp_to_tc_map" : "AZURE" + }, "Ethernet0": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", diff --git a/src/sonic-config-engine/tests/sample_output/py2/qos-dell6100.json b/src/sonic-config-engine/tests/sample_output/py2/qos-dell6100.json index 27bea8cd32d3..bf28af765e17 100644 --- a/src/sonic-config-engine/tests/sample_output/py2/qos-dell6100.json +++ b/src/sonic-config-engine/tests/sample_output/py2/qos-dell6100.json @@ -114,6 +114,9 @@ } }, "PORT_QOS_MAP": { + "global": { + "dscp_to_tc_map" : "AZURE" + }, "Ethernet0": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", diff --git a/src/sonic-config-engine/tests/sample_output/py2/qos-dell9332.json b/src/sonic-config-engine/tests/sample_output/py2/qos-dell9332.json index 8130a455497a..a3dd5cbeea2b 100644 --- a/src/sonic-config-engine/tests/sample_output/py2/qos-dell9332.json +++ b/src/sonic-config-engine/tests/sample_output/py2/qos-dell9332.json @@ -118,6 +118,9 @@ } }, "PORT_QOS_MAP": { + "global": { + "dscp_to_tc_map" : "AZURE" + }, "Ethernet0": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", diff --git a/src/sonic-config-engine/tests/sample_output/py3/qos-arista7050.json b/src/sonic-config-engine/tests/sample_output/py3/qos-arista7050.json index b15fcf7a36c1..6a09e605c3f2 100644 --- a/src/sonic-config-engine/tests/sample_output/py3/qos-arista7050.json +++ b/src/sonic-config-engine/tests/sample_output/py3/qos-arista7050.json @@ -114,6 +114,9 @@ } }, "PORT_QOS_MAP": { + "global": { + "dscp_to_tc_map" : "AZURE" + }, "Ethernet4": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", diff --git a/src/sonic-config-engine/tests/sample_output/py3/qos-arista7050cx3-dualtor-remap-disabled.json b/src/sonic-config-engine/tests/sample_output/py3/qos-arista7050cx3-dualtor-remap-disabled.json index 68774f58563a..67669c169b16 100644 --- a/src/sonic-config-engine/tests/sample_output/py3/qos-arista7050cx3-dualtor-remap-disabled.json +++ b/src/sonic-config-engine/tests/sample_output/py3/qos-arista7050cx3-dualtor-remap-disabled.json @@ -114,6 +114,9 @@ } }, "PORT_QOS_MAP": { + "global": { + "dscp_to_tc_map" : "AZURE" + }, "Ethernet0": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", diff --git a/src/sonic-config-engine/tests/sample_output/py3/qos-arista7050cx3-dualtor.json b/src/sonic-config-engine/tests/sample_output/py3/qos-arista7050cx3-dualtor.json index 843e68a49c7d..a48656d57c0c 100644 --- a/src/sonic-config-engine/tests/sample_output/py3/qos-arista7050cx3-dualtor.json +++ b/src/sonic-config-engine/tests/sample_output/py3/qos-arista7050cx3-dualtor.json @@ -217,6 +217,9 @@ } }, "PORT_QOS_MAP": { + "global": { + "dscp_to_tc_map" : "AZURE" + }, "Ethernet0": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", diff --git a/src/sonic-config-engine/tests/sample_output/py3/qos-arista7260-dualtor-remap-disabled.json b/src/sonic-config-engine/tests/sample_output/py3/qos-arista7260-dualtor-remap-disabled.json index 27b7ebd7e494..49ed2038e71b 100644 --- a/src/sonic-config-engine/tests/sample_output/py3/qos-arista7260-dualtor-remap-disabled.json +++ b/src/sonic-config-engine/tests/sample_output/py3/qos-arista7260-dualtor-remap-disabled.json @@ -114,6 +114,9 @@ } }, "PORT_QOS_MAP": { + "global": { + "dscp_to_tc_map" : "AZURE" + }, "Ethernet0": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", diff --git a/src/sonic-config-engine/tests/sample_output/py3/qos-arista7260-dualtor.json b/src/sonic-config-engine/tests/sample_output/py3/qos-arista7260-dualtor.json index 1d8c2dbdfff6..cad403c93d2e 100644 --- a/src/sonic-config-engine/tests/sample_output/py3/qos-arista7260-dualtor.json +++ b/src/sonic-config-engine/tests/sample_output/py3/qos-arista7260-dualtor.json @@ -217,6 +217,9 @@ } }, "PORT_QOS_MAP": { + "global": { + "dscp_to_tc_map" : "AZURE" + }, "Ethernet0": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", diff --git a/src/sonic-config-engine/tests/sample_output/py3/qos-arista7260-t1-remap-disabled.json b/src/sonic-config-engine/tests/sample_output/py3/qos-arista7260-t1-remap-disabled.json index ae9fa775dc62..f4e639b3ddfe 100644 --- a/src/sonic-config-engine/tests/sample_output/py3/qos-arista7260-t1-remap-disabled.json +++ b/src/sonic-config-engine/tests/sample_output/py3/qos-arista7260-t1-remap-disabled.json @@ -114,6 +114,9 @@ } }, "PORT_QOS_MAP": { + "global": { + "dscp_to_tc_map" : "AZURE" + }, "Ethernet0": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", diff --git a/src/sonic-config-engine/tests/sample_output/py3/qos-arista7260-t1.json b/src/sonic-config-engine/tests/sample_output/py3/qos-arista7260-t1.json index 9db828a759e4..f850e3285bef 100644 --- a/src/sonic-config-engine/tests/sample_output/py3/qos-arista7260-t1.json +++ b/src/sonic-config-engine/tests/sample_output/py3/qos-arista7260-t1.json @@ -114,6 +114,9 @@ } }, "PORT_QOS_MAP": { + "global": { + "dscp_to_tc_map" : "AZURE" + }, "Ethernet0": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", diff --git a/src/sonic-config-engine/tests/sample_output/py3/qos-arista7800r3-48cq2-lc.json b/src/sonic-config-engine/tests/sample_output/py3/qos-arista7800r3-48cq2-lc.json index 92ba2caf8d17..48b3a293e02b 100644 --- a/src/sonic-config-engine/tests/sample_output/py3/qos-arista7800r3-48cq2-lc.json +++ b/src/sonic-config-engine/tests/sample_output/py3/qos-arista7800r3-48cq2-lc.json @@ -114,6 +114,9 @@ } }, "PORT_QOS_MAP": { + "global": { + "dscp_to_tc_map" : "AZURE" + }, "Ethernet0": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", diff --git a/src/sonic-config-engine/tests/sample_output/py3/qos-dell6100.json b/src/sonic-config-engine/tests/sample_output/py3/qos-dell6100.json index 27bea8cd32d3..bf28af765e17 100644 --- a/src/sonic-config-engine/tests/sample_output/py3/qos-dell6100.json +++ b/src/sonic-config-engine/tests/sample_output/py3/qos-dell6100.json @@ -114,6 +114,9 @@ } }, "PORT_QOS_MAP": { + "global": { + "dscp_to_tc_map" : "AZURE" + }, "Ethernet0": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", diff --git a/src/sonic-config-engine/tests/sample_output/py3/qos-dell9332.json b/src/sonic-config-engine/tests/sample_output/py3/qos-dell9332.json index 8130a455497a..a3dd5cbeea2b 100644 --- a/src/sonic-config-engine/tests/sample_output/py3/qos-dell9332.json +++ b/src/sonic-config-engine/tests/sample_output/py3/qos-dell9332.json @@ -118,6 +118,9 @@ } }, "PORT_QOS_MAP": { + "global": { + "dscp_to_tc_map" : "AZURE" + }, "Ethernet0": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", From 7bbf4cfc989f446983e286baefdfb6df7aadb84c Mon Sep 17 00:00:00 2001 From: bingwang Date: Thu, 16 Jun 2022 09:34:41 +0000 Subject: [PATCH 2/2] Fix vs test Signed-off-by: bingwang --- files/build_templates/qos_config.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/build_templates/qos_config.j2 b/files/build_templates/qos_config.j2 index 06698883bf4c..46cebb6e32d1 100644 --- a/files/build_templates/qos_config.j2 +++ b/files/build_templates/qos_config.j2 @@ -222,7 +222,7 @@ {% else %} "global": { "dscp_to_tc_map" : "AZURE" - }, + }{% if PORT_ACTIVE %},{% endif %} {% endif %} {% for port in PORT_ACTIVE %} "{{ port }}": {