From 5ec6119df9b2f121fbddc098b7e98e0055c396d8 Mon Sep 17 00:00:00 2001 From: bingwang Date: Mon, 11 Apr 2022 05:25:06 +0000 Subject: [PATCH 1/3] Add AZURE_TUNNEL map Signed-off-by: bingwang --- .../Arista-7050CX3-32S-D48C8/qos.json.j2 | 100 ++++++++++++++++++ .../Arista-7260CX3-C64/qos.json.j2 | 100 ++++++++++++++++++ files/build_templates/qos_config.j2 | 3 + 3 files changed, 203 insertions(+) diff --git a/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-D48C8/qos.json.j2 b/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-D48C8/qos.json.j2 index 04fddf486ace..a80502478852 100644 --- a/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-D48C8/qos.json.j2 +++ b/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-D48C8/qos.json.j2 @@ -66,6 +66,72 @@ "61": "1", "62": "1", "63": "1" + }, + "AZURE_TUNNEL": { + "0" : "1", + "1" : "1", + "2" : "1", + "3" : "3", + "4" : "4", + "5" : "1", + "6" : "1", + "7" : "1", + "8" : "0", + "9" : "1", + "10": "1", + "11": "1", + "12": "1", + "13": "1", + "14": "1", + "15": "1", + "16": "1", + "17": "1", + "18": "1", + "19": "1", + "20": "1", + "21": "1", + "22": "1", + "23": "1", + "24": "1", + "25": "1", + "26": "1", + "27": "1", + "28": "1", + "29": "1", + "30": "1", + "31": "1", + "32": "1", + "33": "2", + "34": "1", + "35": "1", + "36": "1", + "37": "1", + "38": "1", + "39": "1", + "40": "1", + "41": "1", + "42": "1", + "43": "1", + "44": "1", + "45": "1", + "46": "5", + "47": "1", + "48": "7", + "49": "1", + "50": "1", + "51": "1", + "52": "1", + "53": "1", + "54": "1", + "55": "1", + "56": "1", + "57": "1", + "58": "1", + "59": "1", + "60": "1", + "61": "1", + "62": "1", + "63": "1" } }, {%- endmacro %} @@ -80,6 +146,16 @@ "5": "0", "6": "0", "7": "7" + }, + "AZURE_TUNNEL": { + "0": "0", + "1": "0", + "2": "0", + "3": "2", + "4": "6", + "5": "0", + "6": "0", + "7": "7" } }, {%- endmacro %} @@ -94,6 +170,30 @@ "5": "5", "6": "6", "7": "7" + }, + "AZURE_TUNNEL": { + "0": "0", + "1": "1", + "2": "1", + "3": "2", + "4": "6", + "5": "5", + "6": "6", + "7": "7" + } + }, +{%- endmacro %} +{%- macro generate_tc_to_dscp_map() %} + "TC_TO_DSCP_MAP": { + "AZURE_TUNNEL": { + "0": "8", + "1": "0", + "2": "33", + "3": "2", + "4": "6", + "5": "46", + "6": "0", + "7": "48" } }, {%- endmacro %} diff --git a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-C64/qos.json.j2 b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-C64/qos.json.j2 index 4178efbcb7aa..8fd59d397dd0 100644 --- a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-C64/qos.json.j2 +++ b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-C64/qos.json.j2 @@ -151,6 +151,72 @@ "61": "1", "62": "1", "63": "1" + }, + "AZURE_TUNNEL": { + "0" : "1", + "1" : "1", + "2" : "1", + "3" : "3", + "4" : "4", + "5" : "1", + "6" : "1", + "7" : "1", + "8" : "0", + "9" : "1", + "10": "1", + "11": "1", + "12": "1", + "13": "1", + "14": "1", + "15": "1", + "16": "1", + "17": "1", + "18": "1", + "19": "1", + "20": "1", + "21": "1", + "22": "1", + "23": "1", + "24": "1", + "25": "1", + "26": "1", + "27": "1", + "28": "1", + "29": "1", + "30": "1", + "31": "1", + "32": "1", + "33": "2", + "34": "1", + "35": "1", + "36": "1", + "37": "1", + "38": "1", + "39": "1", + "40": "1", + "41": "1", + "42": "1", + "43": "1", + "44": "1", + "45": "1", + "46": "5", + "47": "1", + "48": "7", + "49": "1", + "50": "1", + "51": "1", + "52": "1", + "53": "1", + "54": "1", + "55": "1", + "56": "1", + "57": "1", + "58": "1", + "59": "1", + "60": "1", + "61": "1", + "62": "1", + "63": "1" } }, {%- endmacro %} @@ -165,6 +231,16 @@ "5": "0", "6": "0", "7": "7" + }, + "AZURE_TUNNEL": { + "0": "0", + "1": "0", + "2": "0", + "3": "2", + "4": "6", + "5": "0", + "6": "0", + "7": "7" } }, {%- endmacro %} @@ -179,6 +255,30 @@ "5": "5", "6": "6", "7": "7" + }, + "AZURE_TUNNEL": { + "0": "0", + "1": "1", + "2": "1", + "3": "2", + "4": "6", + "5": "5", + "6": "6", + "7": "7" + } + }, +{%- endmacro %} +{%- macro generate_tc_to_dscp_map() %} + "TC_TO_DSCP_MAP": { + "AZURE_TUNNEL": { + "0": "8", + "1": "0", + "2": "33", + "3": "2", + "4": "6", + "5": "46", + "6": "0", + "7": "48" } }, {%- endmacro %} diff --git a/files/build_templates/qos_config.j2 b/files/build_templates/qos_config.j2 index 9df061283034..4062755827ab 100644 --- a/files/build_templates/qos_config.j2 +++ b/files/build_templates/qos_config.j2 @@ -172,6 +172,9 @@ } }, {% endif %} +{% if generate_tc_to_dscp_map is defined %} + {{- generate_tc_to_dscp_map() }} +{% endif %} {% if 'resource_type' in DEVICE_METADATA['localhost'] and DEVICE_METADATA['localhost']['resource_type'] in apollo_resource_types %} "SCHEDULER": { "scheduler.0": { From c25a0ca6eec8e243f3d832ea16e3c0a5d21fd19a Mon Sep 17 00:00:00 2001 From: bingwang Date: Wed, 13 Apr 2022 14:20:51 +0000 Subject: [PATCH 2/3] Fix UT Signed-off-by: bingwang --- .../Arista-7260CX3-C64/qos.json.j2 | 4 +- .../py3/qos-arista7050cx3-dualtor.json | 98 +++++++++++++++++++ .../py3/qos-arista7260-dualtor.json | 98 +++++++++++++++++++ 3 files changed, 198 insertions(+), 2 deletions(-) diff --git a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-C64/qos.json.j2 b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-C64/qos.json.j2 index 8fd59d397dd0..c775556d5a8c 100644 --- a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-C64/qos.json.j2 +++ b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-C64/qos.json.j2 @@ -249,13 +249,13 @@ "AZURE": { "0": "0", "1": "1", - "2": "1", + "2": "1", "3": "3", "4": "4", "5": "5", "6": "6", "7": "7" - }, + }, "AZURE_TUNNEL": { "0": "0", "1": "1", 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 84a2613df90d..76cc7e3139e3 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 @@ -21,6 +21,16 @@ "5": "5", "6": "6", "7": "7" + }, + "AZURE_TUNNEL": { + "0": "0", + "1": "1", + "2": "1", + "3": "2", + "4": "6", + "5": "5", + "6": "6", + "7": "7" } }, "DSCP_TO_TC_MAP": { @@ -89,6 +99,72 @@ "61": "1", "62": "1", "63": "1" + }, + "AZURE_TUNNEL": { + "0" : "1", + "1" : "1", + "2" : "1", + "3" : "3", + "4" : "4", + "5" : "1", + "6" : "1", + "7" : "1", + "8" : "0", + "9" : "1", + "10": "1", + "11": "1", + "12": "1", + "13": "1", + "14": "1", + "15": "1", + "16": "1", + "17": "1", + "18": "1", + "19": "1", + "20": "1", + "21": "1", + "22": "1", + "23": "1", + "24": "1", + "25": "1", + "26": "1", + "27": "1", + "28": "1", + "29": "1", + "30": "1", + "31": "1", + "32": "1", + "33": "2", + "34": "1", + "35": "1", + "36": "1", + "37": "1", + "38": "1", + "39": "1", + "40": "1", + "41": "1", + "42": "1", + "43": "1", + "44": "1", + "45": "1", + "46": "5", + "47": "1", + "48": "7", + "49": "1", + "50": "1", + "51": "1", + "52": "1", + "53": "1", + "54": "1", + "55": "1", + "56": "1", + "57": "1", + "58": "1", + "59": "1", + "60": "1", + "61": "1", + "62": "1", + "63": "1" } }, "TC_TO_PRIORITY_GROUP_MAP": { @@ -101,6 +177,28 @@ "5": "0", "6": "0", "7": "7" + }, + "AZURE_TUNNEL": { + "0": "0", + "1": "0", + "2": "0", + "3": "2", + "4": "6", + "5": "0", + "6": "0", + "7": "7" + } + }, + "TC_TO_DSCP_MAP": { + "AZURE_TUNNEL": { + "0": "8", + "1": "0", + "2": "33", + "3": "2", + "4": "6", + "5": "46", + "6": "0", + "7": "48" } }, "SCHEDULER": { 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 e8476cc0c865..a5315b940cdc 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 @@ -21,6 +21,16 @@ "5": "5", "6": "6", "7": "7" + }, + "AZURE_TUNNEL": { + "0": "0", + "1": "1", + "2": "1", + "3": "2", + "4": "6", + "5": "5", + "6": "6", + "7": "7" } }, "DSCP_TO_TC_MAP": { @@ -89,6 +99,72 @@ "61": "1", "62": "1", "63": "1" + }, + "AZURE_TUNNEL": { + "0" : "1", + "1" : "1", + "2" : "1", + "3" : "3", + "4" : "4", + "5" : "1", + "6" : "1", + "7" : "1", + "8" : "0", + "9" : "1", + "10": "1", + "11": "1", + "12": "1", + "13": "1", + "14": "1", + "15": "1", + "16": "1", + "17": "1", + "18": "1", + "19": "1", + "20": "1", + "21": "1", + "22": "1", + "23": "1", + "24": "1", + "25": "1", + "26": "1", + "27": "1", + "28": "1", + "29": "1", + "30": "1", + "31": "1", + "32": "1", + "33": "2", + "34": "1", + "35": "1", + "36": "1", + "37": "1", + "38": "1", + "39": "1", + "40": "1", + "41": "1", + "42": "1", + "43": "1", + "44": "1", + "45": "1", + "46": "5", + "47": "1", + "48": "7", + "49": "1", + "50": "1", + "51": "1", + "52": "1", + "53": "1", + "54": "1", + "55": "1", + "56": "1", + "57": "1", + "58": "1", + "59": "1", + "60": "1", + "61": "1", + "62": "1", + "63": "1" } }, "TC_TO_PRIORITY_GROUP_MAP": { @@ -101,6 +177,28 @@ "5": "0", "6": "0", "7": "7" + }, + "AZURE_TUNNEL": { + "0": "0", + "1": "0", + "2": "0", + "3": "2", + "4": "6", + "5": "0", + "6": "0", + "7": "7" + } + }, + "TC_TO_DSCP_MAP": { + "AZURE_TUNNEL": { + "0": "8", + "1": "0", + "2": "33", + "3": "2", + "4": "6", + "5": "46", + "6": "0", + "7": "48" } }, "SCHEDULER": { From 15b6a42487a774a685d413329a7276c117032dc2 Mon Sep 17 00:00:00 2001 From: bingwang Date: Tue, 19 Apr 2022 05:21:35 +0000 Subject: [PATCH 3/3] PG7->0 Queue6->1 Signed-off-by: bingwang --- .../Arista-7050CX3-32S-D48C8/qos.json.j2 | 4 ++-- .../x86_64-arista_7260cx3_64/Arista-7260CX3-C64/qos.json.j2 | 4 ++-- .../tests/sample_output/py3/qos-arista7050cx3-dualtor.json | 4 ++-- .../tests/sample_output/py3/qos-arista7260-dualtor.json | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-D48C8/qos.json.j2 b/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-D48C8/qos.json.j2 index a80502478852..413bd575413c 100644 --- a/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-D48C8/qos.json.j2 +++ b/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-D48C8/qos.json.j2 @@ -155,7 +155,7 @@ "4": "6", "5": "0", "6": "0", - "7": "7" + "7": "0" } }, {%- endmacro %} @@ -178,7 +178,7 @@ "3": "2", "4": "6", "5": "5", - "6": "6", + "6": "1", "7": "7" } }, diff --git a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-C64/qos.json.j2 b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-C64/qos.json.j2 index c775556d5a8c..27f6b531cb08 100644 --- a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-C64/qos.json.j2 +++ b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-C64/qos.json.j2 @@ -240,7 +240,7 @@ "4": "6", "5": "0", "6": "0", - "7": "7" + "7": "0" } }, {%- endmacro %} @@ -263,7 +263,7 @@ "3": "2", "4": "6", "5": "5", - "6": "6", + "6": "1", "7": "7" } }, 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 76cc7e3139e3..dbab298bb76a 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 @@ -29,7 +29,7 @@ "3": "2", "4": "6", "5": "5", - "6": "6", + "6": "1", "7": "7" } }, @@ -186,7 +186,7 @@ "4": "6", "5": "0", "6": "0", - "7": "7" + "7": "0" } }, "TC_TO_DSCP_MAP": { 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 a5315b940cdc..41f36a273d06 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 @@ -29,7 +29,7 @@ "3": "2", "4": "6", "5": "5", - "6": "6", + "6": "1", "7": "7" } }, @@ -186,7 +186,7 @@ "4": "6", "5": "0", "6": "0", - "7": "7" + "7": "0" } }, "TC_TO_DSCP_MAP": {