From 5e31afb9f57cadd7de5ce1886af0a388f3c4b590 Mon Sep 17 00:00:00 2001 From: Wenda Date: Fri, 24 Aug 2018 23:36:13 +0000 Subject: [PATCH 01/13] Unify qos config with qos_config.j2 template Signed-off-by: Wenda --- files/build_templates/qos_config.j2 | 212 ++++++++++++++++++ .../build_templates/sonic_debian_extension.j2 | 3 + 2 files changed, 215 insertions(+) create mode 100644 files/build_templates/qos_config.j2 diff --git a/files/build_templates/qos_config.j2 b/files/build_templates/qos_config.j2 new file mode 100644 index 000000000000..58d3ed8bde16 --- /dev/null +++ b/files/build_templates/qos_config.j2 @@ -0,0 +1,212 @@ +{%- set PORT_ALL = [] %} + +{%- if PORT is not defined %} + {%- if generate_port_lists(PORT_ALL) %}{% endif %} +{%- else %} + {%- for port in PORT %} + {%- if PORT_ALL.append(port) %}{% endif %} + {%- endfor %} +{%- endif %} + +{%- set port_names_list_all = [] %} +{%- for port in PORT_ALL %} + {%- if port_names_list_all.append(port) %}{% endif %} +{%- endfor %} +{%- set port_names_all = port_names_list_all | join(',') -%} + + +{%- set PORT_ACTIVE = [] %} +{%- if DEVICE_NEIGHBOR is not defined %} + {%- set PORT_ACTIVE = PORT_ALL %} +{%- else %} + {%- for port in DEVICE_NEIGHBOR.keys() %} + {%- if PORT_ACTIVE.append(port) %}{%- endif %} + {%- endfor %} +{%- endif %} + +{%- set port_names_list_active = [] %} +{%- for port in PORT_ACTIVE %} + {%- if port_names_list_active.append(port) %}{%- endif %} +{%- endfor %} +{%- set port_names_active = port_names_list_active | join(',') -%} + + +{ + "TC_TO_PRIORITY_GROUP_MAP": { + "AZURE": { + "0": "0", + "1": "1", + "2": "2", + "3": "3", + "4": "4", + "5": "5", + "6": "6", + "7": "7" + } + }, + "MAP_PFC_PRIORITY_TO_QUEUE": { + "AZURE": { + "0": "0", + "1": "1", + "2": "2", + "3": "3", + "4": "4", + "5": "5", + "6": "6", + "7": "7" + } + }, + "TC_TO_QUEUE_MAP": { + "AZURE": { + "0": "0", + "1": "1", + "2": "2", + "3": "3", + "4": "4", + "5": "5", + "6": "6", + "7": "7" + } + }, + "DSCP_TO_TC_MAP": { + "AZURE": { + "0" : "0", + "1" : "0", + "2" : "0", + "3" : "3", + "4" : "4", + "5" : "0", + "6" : "0", + "7" : "0", + "8" : "1", + "9" : "0", + "10": "0", + "11": "0", + "12": "0", + "13": "0", + "14": "0", + "15": "0", + "16": "0", + "17": "0", + "18": "0", + "19": "0", + "20": "0", + "21": "0", + "22": "0", + "23": "0", + "24": "0", + "25": "0", + "26": "0", + "27": "0", + "28": "0", + "29": "0", + "30": "0", + "31": "0", + "32": "0", + "33": "0", + "34": "0", + "35": "0", + "36": "0", + "37": "0", + "38": "0", + "39": "0", + "40": "0", + "41": "0", + "42": "0", + "43": "0", + "44": "0", + "45": "0", + "46": "0", + "47": "0", + "48": "0", + "49": "0", + "50": "0", + "51": "0", + "52": "0", + "53": "0", + "54": "0", + "55": "0", + "56": "0", + "57": "0", + "58": "0", + "59": "0", + "60": "0", + "61": "0", + "62": "0", + "63": "0" + } + }, + "SCHEDULER": { + "scheduler.0": { + "type" : "DWRR", + "weight": "25" + }, + "scheduler.1": { + "type" : "DWRR", + "weight": "30" + }, + "scheduler.2": { + "type" : "DWRR", + "weight": "20" + } + }, +{% if pfc_to_pg_map is defined and pfc_to_pg_map %} + "PFC_PRIORITY_TO_PRIORITY_GROUP_MAP": { + "AZURE": { + "0": "0", + "1": "1", + "3": "3", + "4": "4" + } + }, +{% endif %} + "PORT_QOS_MAP": { + "{{ port_names_all }}": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", +{% if pfc_to_pg_map is defined and pfc_to_pg_map %} + "pfc_to_pg_map" : "[PFC_PRIORITY_TO_PRIORITY_GROUP_MAP|AZURE]", +{% endif %} + "pfc_enable" : "3,4" + } + }, + "WRED_PROFILE": { + "AZURE_LOSSLESS" : { + "wred_green_enable" : "true", + "wred_yellow_enable" : "true", + "wred_red_enable" : "true", + "ecn" : "ecn_all", + "green_max_threshold" : "312000", + "green_min_threshold" : "104000", + "yellow_max_threshold": "312000", + "yellow_min_threshold": "104000", + "red_max_threshold" : "312000", + "red_min_threshold" : "104000" + } + }, + "QUEUE": { +{% for port in PORT_ACTIVE %} + "{{ port }}|3": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, +{% endfor %} +{% for port in PORT_ACTIVE %} + "{{ port }}|4": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, +{% endfor %} +{% for port in PORT_ACTIVE %} + "{{ port }}|0": { + "scheduler": "[SCHEDULER|scheduler.1]" + }, +{% endfor %} +{% for port in PORT_ACTIVE %} + "{{ port }}|1": { + "scheduler": "[SCHEDULER|scheduler.2]" + }{% if not loop.last %},{% endif %} + +{% endfor %} + } +} diff --git a/files/build_templates/sonic_debian_extension.j2 b/files/build_templates/sonic_debian_extension.j2 index 9a4af3c3c637..93d2a905a5b1 100644 --- a/files/build_templates/sonic_debian_extension.j2 +++ b/files/build_templates/sonic_debian_extension.j2 @@ -166,6 +166,9 @@ sudo cp $IMAGE_CONFIGS/hostcfgd/*.j2 $FILESYSTEM_ROOT_USR_SHARE_SONIC_TEMPLATES/ # Copy the buffer configuration template sudo cp $BUILD_TEMPLATES/buffers_config.j2 $FILESYSTEM_ROOT_USR_SHARE_SONIC_TEMPLATES/ +# Copy the qos configuration template +sudo cp $BUILD_TEMPLATES/qos_config.j2 $FILESYSTEM_ROOT_USR_SHARE_SONIC_TEMPLATES/ + # Copy hostname configuration scripts sudo cp $IMAGE_CONFIGS/hostname/hostname-config.service $FILESYSTEM_ROOT/etc/systemd/system/ sudo LANG=C chroot $FILESYSTEM_ROOT systemctl enable hostname-config.service From 0b62f8ca75df605ebeebf7472f82a3d38f3c5bba Mon Sep 17 00:00:00 2001 From: Wenda Date: Fri, 24 Aug 2018 23:41:53 +0000 Subject: [PATCH 02/13] Change 7050 to use qos config template Signed-off-by: Wenda modified: device/arista/x86_64-arista_7050_qx32/Arista-7050-QX32/qos.json.j2 modified: device/arista/x86_64-arista_7050_qx32s/Arista-7050-QX-32S/qos.json.j2 --- .../Arista-7050-QX32/qos.json.j2 | 156 +----------------- .../Arista-7050-QX-32S/qos.json.j2 | 156 +----------------- 2 files changed, 16 insertions(+), 296 deletions(-) diff --git a/device/arista/x86_64-arista_7050_qx32/Arista-7050-QX32/qos.json.j2 b/device/arista/x86_64-arista_7050_qx32/Arista-7050-QX32/qos.json.j2 index 698811c610ff..38ae7d9c881f 100644 --- a/device/arista/x86_64-arista_7050_qx32/Arista-7050-QX32/qos.json.j2 +++ b/device/arista/x86_64-arista_7050_qx32/Arista-7050-QX32/qos.json.j2 @@ -1,148 +1,8 @@ -{ - "TC_TO_PRIORITY_GROUP_MAP": { - "AZURE": { - "0": "0", - "1": "1", - "3": "3", - "4": "4" - } - }, - "MAP_PFC_PRIORITY_TO_QUEUE": { - "AZURE": { - "0": "0", - "1": "1", - "3": "3", - "4": "4" - } - }, - "TC_TO_QUEUE_MAP": { - "AZURE": { - "0": "0", - "1": "1", - "3": "3", - "4": "4" - } - }, - "DSCP_TO_TC_MAP": { - "AZURE": { - "0":"0", - "1":"0", - "2":"0", - "3":"3", - "4":"4", - "5":"0", - "6":"0", - "7":"0", - "8":"1", - "9":"0", - "10":"0", - "11":"0", - "12":"0", - "13":"0", - "14":"0", - "15":"0", - "16":"0", - "17":"0", - "18":"0", - "19":"0", - "20":"0", - "21":"0", - "22":"0", - "23":"0", - "24":"0", - "25":"0", - "26":"0", - "27":"0", - "28":"0", - "29":"0", - "30":"0", - "31":"0", - "32":"0", - "33":"0", - "34":"0", - "35":"0", - "36":"0", - "37":"0", - "38":"0", - "39":"0", - "40":"0", - "41":"0", - "42":"0", - "43":"0", - "44":"0", - "45":"0", - "46":"0", - "47":"0", - "48":"0", - "49":"0", - "50":"0", - "51":"0", - "52":"0", - "53":"0", - "54":"0", - "55":"0", - "56":"0", - "57":"0", - "58":"0", - "59":"0", - "60":"0", - "61":"0", - "62":"0", - "63":"0" - } - }, - "SCHEDULER": { - "scheduler.0" : { - "type":"DWRR", - "weight": "25" - }, - "scheduler.1" : { - "type":"DWRR", - "weight": "30" - }, - "scheduler.2" : { - "type":"DWRR", - "weight": "20" - } - }, - "PORT_QOS_MAP": { - "Ethernet0,Ethernet4,Ethernet8,Ethernet12,Ethernet16,Ethernet20,Ethernet24,Ethernet28,Ethernet32,Ethernet36,Ethernet40,Ethernet44,Ethernet48,Ethernet52,Ethernet56,Ethernet60,Ethernet64,Ethernet68,Ethernet72,Ethernet76,Ethernet80,Ethernet84,Ethernet88,Ethernet92,Ethernet96,Ethernet100,Ethernet104,Ethernet108,Ethernet112,Ethernet116,Ethernet120,Ethernet124": { - "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", - "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", - "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", - "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable": "3,4" - } - }, - "WRED_PROFILE": { - "AZURE_LOSSLESS" : { - "wred_green_enable":"true", - "wred_yellow_enable":"true", - "wred_red_enable":"true", - "ecn":"ecn_all", - "red_max_threshold":"312000", - "red_min_threshold":"104000", - "yellow_max_threshold":"312000", - "yellow_min_threshold":"104000", - "green_max_threshold":"312000", - "green_min_threshold":"104000" - } - }, - "QUEUE": { - "Ethernet0,Ethernet4,Ethernet8,Ethernet12,Ethernet16,Ethernet20,Ethernet24,Ethernet28,Ethernet32,Ethernet36,Ethernet40,Ethernet44,Ethernet48,Ethernet52,Ethernet56,Ethernet60,Ethernet64,Ethernet68,Ethernet72,Ethernet76,Ethernet80,Ethernet84,Ethernet88,Ethernet92,Ethernet96,Ethernet100,Ethernet104,Ethernet108,Ethernet112,Ethernet116,Ethernet120,Ethernet124|3-4" : { - "scheduler" : "[SCHEDULER|scheduler.0]" - }, - "Ethernet0,Ethernet4,Ethernet8,Ethernet12,Ethernet16,Ethernet20,Ethernet24,Ethernet28,Ethernet32,Ethernet36,Ethernet40,Ethernet44,Ethernet48,Ethernet52,Ethernet56,Ethernet60,Ethernet64,Ethernet68,Ethernet72,Ethernet76,Ethernet80,Ethernet84,Ethernet88,Ethernet92,Ethernet96,Ethernet100,Ethernet104,Ethernet108,Ethernet112,Ethernet116,Ethernet120,Ethernet124|3" : { - "wred_profile" : "[WRED_PROFILE|AZURE_LOSSLESS]" - }, - "Ethernet0,Ethernet4,Ethernet8,Ethernet12,Ethernet16,Ethernet20,Ethernet24,Ethernet28,Ethernet32,Ethernet36,Ethernet40,Ethernet44,Ethernet48,Ethernet52,Ethernet56,Ethernet60,Ethernet64,Ethernet68,Ethernet72,Ethernet76,Ethernet80,Ethernet84,Ethernet88,Ethernet92,Ethernet96,Ethernet100,Ethernet104,Ethernet108,Ethernet112,Ethernet116,Ethernet120,Ethernet124|4" : { - "wred_profile" : "[WRED_PROFILE|AZURE_LOSSLESS]" - }, - "Ethernet0,Ethernet4,Ethernet8,Ethernet12,Ethernet16,Ethernet20,Ethernet24,Ethernet28,Ethernet32,Ethernet36,Ethernet40,Ethernet44,Ethernet48,Ethernet52,Ethernet56,Ethernet60,Ethernet64,Ethernet68,Ethernet72,Ethernet76,Ethernet80,Ethernet84,Ethernet88,Ethernet92,Ethernet96,Ethernet100,Ethernet104,Ethernet108,Ethernet112,Ethernet116,Ethernet120,Ethernet124|0" : { - "scheduler" : "[SCHEDULER|scheduler.1]" - }, - "Ethernet0,Ethernet4,Ethernet8,Ethernet12,Ethernet16,Ethernet20,Ethernet24,Ethernet28,Ethernet32,Ethernet36,Ethernet40,Ethernet44,Ethernet48,Ethernet52,Ethernet56,Ethernet60,Ethernet64,Ethernet68,Ethernet72,Ethernet76,Ethernet80,Ethernet84,Ethernet88,Ethernet92,Ethernet96,Ethernet100,Ethernet104,Ethernet108,Ethernet112,Ethernet116,Ethernet120,Ethernet124|1" : { - "scheduler" : "[SCHEDULER|scheduler.2]" - } - } -} +{%- macro generate_port_lists(PORT_ALL) %} + {# Generate list of ports #} + {% for port_idx in range(0, 32) %} + {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{% endif %} + {% endfor %} +{%- endmacro %} + +{%- include 'qos_config.j2' %} diff --git a/device/arista/x86_64-arista_7050_qx32s/Arista-7050-QX-32S/qos.json.j2 b/device/arista/x86_64-arista_7050_qx32s/Arista-7050-QX-32S/qos.json.j2 index 698811c610ff..38ae7d9c881f 100644 --- a/device/arista/x86_64-arista_7050_qx32s/Arista-7050-QX-32S/qos.json.j2 +++ b/device/arista/x86_64-arista_7050_qx32s/Arista-7050-QX-32S/qos.json.j2 @@ -1,148 +1,8 @@ -{ - "TC_TO_PRIORITY_GROUP_MAP": { - "AZURE": { - "0": "0", - "1": "1", - "3": "3", - "4": "4" - } - }, - "MAP_PFC_PRIORITY_TO_QUEUE": { - "AZURE": { - "0": "0", - "1": "1", - "3": "3", - "4": "4" - } - }, - "TC_TO_QUEUE_MAP": { - "AZURE": { - "0": "0", - "1": "1", - "3": "3", - "4": "4" - } - }, - "DSCP_TO_TC_MAP": { - "AZURE": { - "0":"0", - "1":"0", - "2":"0", - "3":"3", - "4":"4", - "5":"0", - "6":"0", - "7":"0", - "8":"1", - "9":"0", - "10":"0", - "11":"0", - "12":"0", - "13":"0", - "14":"0", - "15":"0", - "16":"0", - "17":"0", - "18":"0", - "19":"0", - "20":"0", - "21":"0", - "22":"0", - "23":"0", - "24":"0", - "25":"0", - "26":"0", - "27":"0", - "28":"0", - "29":"0", - "30":"0", - "31":"0", - "32":"0", - "33":"0", - "34":"0", - "35":"0", - "36":"0", - "37":"0", - "38":"0", - "39":"0", - "40":"0", - "41":"0", - "42":"0", - "43":"0", - "44":"0", - "45":"0", - "46":"0", - "47":"0", - "48":"0", - "49":"0", - "50":"0", - "51":"0", - "52":"0", - "53":"0", - "54":"0", - "55":"0", - "56":"0", - "57":"0", - "58":"0", - "59":"0", - "60":"0", - "61":"0", - "62":"0", - "63":"0" - } - }, - "SCHEDULER": { - "scheduler.0" : { - "type":"DWRR", - "weight": "25" - }, - "scheduler.1" : { - "type":"DWRR", - "weight": "30" - }, - "scheduler.2" : { - "type":"DWRR", - "weight": "20" - } - }, - "PORT_QOS_MAP": { - "Ethernet0,Ethernet4,Ethernet8,Ethernet12,Ethernet16,Ethernet20,Ethernet24,Ethernet28,Ethernet32,Ethernet36,Ethernet40,Ethernet44,Ethernet48,Ethernet52,Ethernet56,Ethernet60,Ethernet64,Ethernet68,Ethernet72,Ethernet76,Ethernet80,Ethernet84,Ethernet88,Ethernet92,Ethernet96,Ethernet100,Ethernet104,Ethernet108,Ethernet112,Ethernet116,Ethernet120,Ethernet124": { - "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", - "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", - "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", - "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable": "3,4" - } - }, - "WRED_PROFILE": { - "AZURE_LOSSLESS" : { - "wred_green_enable":"true", - "wred_yellow_enable":"true", - "wred_red_enable":"true", - "ecn":"ecn_all", - "red_max_threshold":"312000", - "red_min_threshold":"104000", - "yellow_max_threshold":"312000", - "yellow_min_threshold":"104000", - "green_max_threshold":"312000", - "green_min_threshold":"104000" - } - }, - "QUEUE": { - "Ethernet0,Ethernet4,Ethernet8,Ethernet12,Ethernet16,Ethernet20,Ethernet24,Ethernet28,Ethernet32,Ethernet36,Ethernet40,Ethernet44,Ethernet48,Ethernet52,Ethernet56,Ethernet60,Ethernet64,Ethernet68,Ethernet72,Ethernet76,Ethernet80,Ethernet84,Ethernet88,Ethernet92,Ethernet96,Ethernet100,Ethernet104,Ethernet108,Ethernet112,Ethernet116,Ethernet120,Ethernet124|3-4" : { - "scheduler" : "[SCHEDULER|scheduler.0]" - }, - "Ethernet0,Ethernet4,Ethernet8,Ethernet12,Ethernet16,Ethernet20,Ethernet24,Ethernet28,Ethernet32,Ethernet36,Ethernet40,Ethernet44,Ethernet48,Ethernet52,Ethernet56,Ethernet60,Ethernet64,Ethernet68,Ethernet72,Ethernet76,Ethernet80,Ethernet84,Ethernet88,Ethernet92,Ethernet96,Ethernet100,Ethernet104,Ethernet108,Ethernet112,Ethernet116,Ethernet120,Ethernet124|3" : { - "wred_profile" : "[WRED_PROFILE|AZURE_LOSSLESS]" - }, - "Ethernet0,Ethernet4,Ethernet8,Ethernet12,Ethernet16,Ethernet20,Ethernet24,Ethernet28,Ethernet32,Ethernet36,Ethernet40,Ethernet44,Ethernet48,Ethernet52,Ethernet56,Ethernet60,Ethernet64,Ethernet68,Ethernet72,Ethernet76,Ethernet80,Ethernet84,Ethernet88,Ethernet92,Ethernet96,Ethernet100,Ethernet104,Ethernet108,Ethernet112,Ethernet116,Ethernet120,Ethernet124|4" : { - "wred_profile" : "[WRED_PROFILE|AZURE_LOSSLESS]" - }, - "Ethernet0,Ethernet4,Ethernet8,Ethernet12,Ethernet16,Ethernet20,Ethernet24,Ethernet28,Ethernet32,Ethernet36,Ethernet40,Ethernet44,Ethernet48,Ethernet52,Ethernet56,Ethernet60,Ethernet64,Ethernet68,Ethernet72,Ethernet76,Ethernet80,Ethernet84,Ethernet88,Ethernet92,Ethernet96,Ethernet100,Ethernet104,Ethernet108,Ethernet112,Ethernet116,Ethernet120,Ethernet124|0" : { - "scheduler" : "[SCHEDULER|scheduler.1]" - }, - "Ethernet0,Ethernet4,Ethernet8,Ethernet12,Ethernet16,Ethernet20,Ethernet24,Ethernet28,Ethernet32,Ethernet36,Ethernet40,Ethernet44,Ethernet48,Ethernet52,Ethernet56,Ethernet60,Ethernet64,Ethernet68,Ethernet72,Ethernet76,Ethernet80,Ethernet84,Ethernet88,Ethernet92,Ethernet96,Ethernet100,Ethernet104,Ethernet108,Ethernet112,Ethernet116,Ethernet120,Ethernet124|1" : { - "scheduler" : "[SCHEDULER|scheduler.2]" - } - } -} +{%- macro generate_port_lists(PORT_ALL) %} + {# Generate list of ports #} + {% for port_idx in range(0, 32) %} + {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{% endif %} + {% endfor %} +{%- endmacro %} + +{%- include 'qos_config.j2' %} From 5cba1feed36bd8e7e41f77c55f7d181b064333c2 Mon Sep 17 00:00:00 2001 From: Wenda Date: Wed, 5 Sep 2018 20:33:08 +0000 Subject: [PATCH 03/13] Change a7060, a7260, s6000, s6100, z9100 to use qos config template Signed-off-by: Wenda --- .../Arista-7060CX-32S-C32/qos.json.j2 | 163 +-------------- .../Arista-7060CX-32S-D48C8/qos.json.j2 | 163 +-------------- .../Arista-7060CX-32S-Q32/qos.json.j2 | 163 +-------------- .../Arista-7260CX3-D108C8/qos.json.j2 | 163 +-------------- .../Force10-S6000/qos.json.j2 | 151 +------------- .../Force10-S6100/qos.json.j2 | 190 +----------------- .../Force10-Z9100-T0/qos.json.j2 | 163 +-------------- .../Force10-Z9100/qos.json.j2 | 163 +-------------- files/build_templates/qos_config.j2 | 2 + src/sonic-config-engine/sonic-cfggen | 7 + 10 files changed, 73 insertions(+), 1255 deletions(-) diff --git a/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-C32/qos.json.j2 b/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-C32/qos.json.j2 index 84f74ecab3be..38ae7d9c881f 100644 --- a/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-C32/qos.json.j2 +++ b/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-C32/qos.json.j2 @@ -1,155 +1,8 @@ -{ - "TC_TO_PRIORITY_GROUP_MAP": { - "AZURE": { - "0": "0", - "1": "1", - "2": "2", - "3": "3", - "4": "4", - "5": "5", - "6": "6", - "7": "7" - } - }, - "MAP_PFC_PRIORITY_TO_QUEUE": { - "AZURE": { - "0": "0", - "1": "1", - "2": "2", - "3": "3", - "4": "4", - "5": "5", - "6": "6", - "7": "7" - } - }, - "TC_TO_QUEUE_MAP": { - "AZURE": { - "0": "0", - "1": "1", - "2": "2", - "3": "3", - "4": "4", - "5": "5", - "6": "6", - "7": "7" - } - }, - "DSCP_TO_TC_MAP": { - "AZURE": { - "0":"0", - "1":"0", - "2":"0", - "3":"3", - "4":"4", - "5":"0", - "6":"0", - "7":"0", - "8":"1", - "9":"0", - "10":"0", - "11":"0", - "12":"0", - "13":"0", - "14":"0", - "15":"0", - "16":"0", - "17":"0", - "18":"0", - "19":"0", - "20":"0", - "21":"0", - "22":"0", - "23":"0", - "24":"0", - "25":"0", - "26":"0", - "27":"0", - "28":"0", - "29":"0", - "30":"0", - "31":"0", - "32":"0", - "33":"0", - "34":"0", - "35":"0", - "36":"0", - "37":"0", - "38":"0", - "39":"0", - "40":"0", - "41":"0", - "42":"0", - "43":"0", - "44":"0", - "45":"0", - "46":"0", - "47":"0", - "48":"0", - "49":"0", - "50":"0", - "51":"0", - "52":"0", - "53":"0", - "54":"0", - "55":"0", - "56":"0", - "57":"0", - "58":"0", - "59":"0", - "60":"0", - "61":"0", - "62":"0", - "63":"0" - } - }, - "SCHEDULER": { - "scheduler.0" : { - "type":"DWRR", - "weight": "25" - }, - "scheduler.1" : { - "type":"DWRR", - "weight": "30" - }, - "scheduler.2" : { - "type":"DWRR", - "weight": "20" - } - }, - "PORT_QOS_MAP": { - "Ethernet0,Ethernet4,Ethernet8,Ethernet12,Ethernet16,Ethernet20,Ethernet24,Ethernet28,Ethernet32,Ethernet36,Ethernet40,Ethernet44,Ethernet48,Ethernet52,Ethernet56,Ethernet60,Ethernet64,Ethernet68,Ethernet72,Ethernet76,Ethernet80,Ethernet84,Ethernet88,Ethernet92,Ethernet96,Ethernet100,Ethernet104,Ethernet108,Ethernet112,Ethernet116,Ethernet120,Ethernet124": { - "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", - "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", - "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", - "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable": "3,4" - } - }, - "WRED_PROFILE": { - "AZURE_LOSSLESS" : { - "wred_green_enable":"true", - "wred_yellow_enable":"true", - "wred_red_enable":"true", - "ecn":"ecn_all", - "red_max_threshold":"312000", - "red_min_threshold":"104000", - "yellow_max_threshold":"312000", - "yellow_min_threshold":"104000", - "green_max_threshold": "312000", - "green_min_threshold": "104000" - } - }, - "QUEUE": { - "Ethernet0,Ethernet4,Ethernet8,Ethernet12,Ethernet16,Ethernet20,Ethernet24,Ethernet28,Ethernet32,Ethernet36,Ethernet40,Ethernet44,Ethernet48,Ethernet52,Ethernet56,Ethernet60,Ethernet64,Ethernet68,Ethernet72,Ethernet76,Ethernet80,Ethernet84,Ethernet88,Ethernet92,Ethernet96,Ethernet100,Ethernet104,Ethernet108,Ethernet112,Ethernet116,Ethernet120,Ethernet124|3-4" : { - "scheduler" : "[SCHEDULER|scheduler.0]", - "wred_profile" : "[WRED_PROFILE|AZURE_LOSSLESS]" - }, - "Ethernet0,Ethernet4,Ethernet8,Ethernet12,Ethernet16,Ethernet20,Ethernet24,Ethernet28,Ethernet32,Ethernet36,Ethernet40,Ethernet44,Ethernet48,Ethernet52,Ethernet56,Ethernet60,Ethernet64,Ethernet68,Ethernet72,Ethernet76,Ethernet80,Ethernet84,Ethernet88,Ethernet92,Ethernet96,Ethernet100,Ethernet104,Ethernet108,Ethernet112,Ethernet116,Ethernet120,Ethernet124|0" : { - "scheduler" : "[SCHEDULER|scheduler.1]" - }, - "Ethernet0,Ethernet4,Ethernet8,Ethernet12,Ethernet16,Ethernet20,Ethernet24,Ethernet28,Ethernet32,Ethernet36,Ethernet40,Ethernet44,Ethernet48,Ethernet52,Ethernet56,Ethernet60,Ethernet64,Ethernet68,Ethernet72,Ethernet76,Ethernet80,Ethernet84,Ethernet88,Ethernet92,Ethernet96,Ethernet100,Ethernet104,Ethernet108,Ethernet112,Ethernet116,Ethernet120,Ethernet124|1" : { - "scheduler" : "[SCHEDULER|scheduler.2]" - } - } -} +{%- macro generate_port_lists(PORT_ALL) %} + {# Generate list of ports #} + {% for port_idx in range(0, 32) %} + {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{% endif %} + {% endfor %} +{%- endmacro %} + +{%- include 'qos_config.j2' %} diff --git a/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-D48C8/qos.json.j2 b/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-D48C8/qos.json.j2 index 5142832ecae4..5ae2448a438f 100644 --- a/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-D48C8/qos.json.j2 +++ b/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-D48C8/qos.json.j2 @@ -1,155 +1,8 @@ -{ - "TC_TO_PRIORITY_GROUP_MAP": { - "AZURE": { - "0": "0", - "1": "1", - "2": "2", - "3": "3", - "4": "4", - "5": "5", - "6": "6", - "7": "7" - } - }, - "MAP_PFC_PRIORITY_TO_QUEUE": { - "AZURE": { - "0": "0", - "1": "1", - "2": "2", - "3": "3", - "4": "4", - "5": "5", - "6": "6", - "7": "7" - } - }, - "TC_TO_QUEUE_MAP": { - "AZURE": { - "0": "0", - "1": "1", - "2": "2", - "3": "3", - "4": "4", - "5": "5", - "6": "6", - "7": "7" - } - }, - "DSCP_TO_TC_MAP": { - "AZURE": { - "0":"0", - "1":"0", - "2":"0", - "3":"3", - "4":"4", - "5":"0", - "6":"0", - "7":"0", - "8":"1", - "9":"0", - "10":"0", - "11":"0", - "12":"0", - "13":"0", - "14":"0", - "15":"0", - "16":"0", - "17":"0", - "18":"0", - "19":"0", - "20":"0", - "21":"0", - "22":"0", - "23":"0", - "24":"0", - "25":"0", - "26":"0", - "27":"0", - "28":"0", - "29":"0", - "30":"0", - "31":"0", - "32":"0", - "33":"0", - "34":"0", - "35":"0", - "36":"0", - "37":"0", - "38":"0", - "39":"0", - "40":"0", - "41":"0", - "42":"0", - "43":"0", - "44":"0", - "45":"0", - "46":"0", - "47":"0", - "48":"0", - "49":"0", - "50":"0", - "51":"0", - "52":"0", - "53":"0", - "54":"0", - "55":"0", - "56":"0", - "57":"0", - "58":"0", - "59":"0", - "60":"0", - "61":"0", - "62":"0", - "63":"0" - } - }, - "SCHEDULER": { - "scheduler.0" : { - "type":"DWRR", - "weight": "25" - }, - "scheduler.1" : { - "type":"DWRR", - "weight": "30" - }, - "scheduler.2" : { - "type":"DWRR", - "weight": "20" - } - }, - "PORT_QOS_MAP": { - "Ethernet0,Ethernet2,Ethernet4,Ethernet6,Ethernet8,Ethernet10,Ethernet12,Ethernet14,Ethernet16,Ethernet18,Ethernet20,Ethernet22,Ethernet24,Ethernet28,Ethernet32,Ethernet36,Ethernet40,Ethernet42,Ethernet44,Ethernet46,Ethernet48,Ethernet50,Ethernet52,Ethernet54,Ethernet56,Ethernet58,Ethernet60,Ethernet62,Ethernet64,Ethernet66,Ethernet68,Ethernet70,Ethernet72,Ethernet74,Ethernet76,Ethernet78,Ethernet80,Ethernet82,Ethernet84,Ethernet86,Ethernet88,Ethernet92,Ethernet96,Ethernet100,Ethernet104,Ethernet106,Ethernet108,Ethernet110,Ethernet112,Ethernet114,Ethernet116,Ethernet118,Ethernet120,Ethernet122,Ethernet124,Ethernet126": { - "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", - "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", - "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", - "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable": "3,4" - } - }, - "WRED_PROFILE": { - "AZURE_LOSSLESS" : { - "wred_green_enable":"true", - "wred_yellow_enable":"true", - "wred_red_enable":"true", - "ecn":"ecn_all", - "red_max_threshold":"312000", - "red_min_threshold":"104000", - "yellow_max_threshold":"312000", - "yellow_min_threshold":"104000", - "green_max_threshold": "312000", - "green_min_threshold": "104000" - } - }, - "QUEUE": { - "Ethernet0,Ethernet2,Ethernet4,Ethernet6,Ethernet8,Ethernet10,Ethernet12,Ethernet14,Ethernet16,Ethernet18,Ethernet20,Ethernet22,Ethernet24,Ethernet28,Ethernet32,Ethernet36,Ethernet40,Ethernet42,Ethernet44,Ethernet46,Ethernet48,Ethernet50,Ethernet52,Ethernet54,Ethernet56,Ethernet58,Ethernet60,Ethernet62,Ethernet64,Ethernet66,Ethernet68,Ethernet70,Ethernet72,Ethernet74,Ethernet76,Ethernet78,Ethernet80,Ethernet82,Ethernet84,Ethernet86,Ethernet88,Ethernet92,Ethernet96,Ethernet100,Ethernet104,Ethernet106,Ethernet108,Ethernet110,Ethernet112,Ethernet114,Ethernet116,Ethernet118,Ethernet120,Ethernet122,Ethernet124,Ethernet126|3-4": { - "scheduler" : "[SCHEDULER|scheduler.0]", - "wred_profile" : "[WRED_PROFILE|AZURE_LOSSLESS]" - }, - "Ethernet0,Ethernet2,Ethernet4,Ethernet6,Ethernet8,Ethernet10,Ethernet12,Ethernet14,Ethernet16,Ethernet18,Ethernet20,Ethernet22,Ethernet24,Ethernet28,Ethernet32,Ethernet36,Ethernet40,Ethernet42,Ethernet44,Ethernet46,Ethernet48,Ethernet50,Ethernet52,Ethernet54,Ethernet56,Ethernet58,Ethernet60,Ethernet62,Ethernet64,Ethernet66,Ethernet68,Ethernet70,Ethernet72,Ethernet74,Ethernet76,Ethernet78,Ethernet80,Ethernet82,Ethernet84,Ethernet86,Ethernet88,Ethernet92,Ethernet96,Ethernet100,Ethernet104,Ethernet106,Ethernet108,Ethernet110,Ethernet112,Ethernet114,Ethernet116,Ethernet118,Ethernet120,Ethernet122,Ethernet124,Ethernet126|0": { - "scheduler" : "[SCHEDULER|scheduler.1]" - }, - "Ethernet0,Ethernet2,Ethernet4,Ethernet6,Ethernet8,Ethernet10,Ethernet12,Ethernet14,Ethernet16,Ethernet18,Ethernet20,Ethernet22,Ethernet24,Ethernet28,Ethernet32,Ethernet36,Ethernet40,Ethernet42,Ethernet44,Ethernet46,Ethernet48,Ethernet50,Ethernet52,Ethernet54,Ethernet56,Ethernet58,Ethernet60,Ethernet62,Ethernet64,Ethernet66,Ethernet68,Ethernet70,Ethernet72,Ethernet74,Ethernet76,Ethernet78,Ethernet80,Ethernet82,Ethernet84,Ethernet86,Ethernet88,Ethernet92,Ethernet96,Ethernet100,Ethernet104,Ethernet106,Ethernet108,Ethernet110,Ethernet112,Ethernet114,Ethernet116,Ethernet118,Ethernet120,Ethernet122,Ethernet124,Ethernet126|1": { - "scheduler" : "[SCHEDULER|scheduler.2]" - } - } -} +{%- macro generate_port_lists(PORT_ALL) %} + {# Generate list of ports #} + {% for port_idx in range(0, 128, 2) if port_idx not in [26, 30, 34, 38, 90, 94, 98, 102] %} + {% if PORT_ALL.append("Ethernet%d" % (port_idx)) %}{% endif %} + {% endfor %} +{%- endmacro %} + +{%- include 'qos_config.j2' %} diff --git a/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-Q32/qos.json.j2 b/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-Q32/qos.json.j2 index 84f74ecab3be..38ae7d9c881f 100644 --- a/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-Q32/qos.json.j2 +++ b/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-Q32/qos.json.j2 @@ -1,155 +1,8 @@ -{ - "TC_TO_PRIORITY_GROUP_MAP": { - "AZURE": { - "0": "0", - "1": "1", - "2": "2", - "3": "3", - "4": "4", - "5": "5", - "6": "6", - "7": "7" - } - }, - "MAP_PFC_PRIORITY_TO_QUEUE": { - "AZURE": { - "0": "0", - "1": "1", - "2": "2", - "3": "3", - "4": "4", - "5": "5", - "6": "6", - "7": "7" - } - }, - "TC_TO_QUEUE_MAP": { - "AZURE": { - "0": "0", - "1": "1", - "2": "2", - "3": "3", - "4": "4", - "5": "5", - "6": "6", - "7": "7" - } - }, - "DSCP_TO_TC_MAP": { - "AZURE": { - "0":"0", - "1":"0", - "2":"0", - "3":"3", - "4":"4", - "5":"0", - "6":"0", - "7":"0", - "8":"1", - "9":"0", - "10":"0", - "11":"0", - "12":"0", - "13":"0", - "14":"0", - "15":"0", - "16":"0", - "17":"0", - "18":"0", - "19":"0", - "20":"0", - "21":"0", - "22":"0", - "23":"0", - "24":"0", - "25":"0", - "26":"0", - "27":"0", - "28":"0", - "29":"0", - "30":"0", - "31":"0", - "32":"0", - "33":"0", - "34":"0", - "35":"0", - "36":"0", - "37":"0", - "38":"0", - "39":"0", - "40":"0", - "41":"0", - "42":"0", - "43":"0", - "44":"0", - "45":"0", - "46":"0", - "47":"0", - "48":"0", - "49":"0", - "50":"0", - "51":"0", - "52":"0", - "53":"0", - "54":"0", - "55":"0", - "56":"0", - "57":"0", - "58":"0", - "59":"0", - "60":"0", - "61":"0", - "62":"0", - "63":"0" - } - }, - "SCHEDULER": { - "scheduler.0" : { - "type":"DWRR", - "weight": "25" - }, - "scheduler.1" : { - "type":"DWRR", - "weight": "30" - }, - "scheduler.2" : { - "type":"DWRR", - "weight": "20" - } - }, - "PORT_QOS_MAP": { - "Ethernet0,Ethernet4,Ethernet8,Ethernet12,Ethernet16,Ethernet20,Ethernet24,Ethernet28,Ethernet32,Ethernet36,Ethernet40,Ethernet44,Ethernet48,Ethernet52,Ethernet56,Ethernet60,Ethernet64,Ethernet68,Ethernet72,Ethernet76,Ethernet80,Ethernet84,Ethernet88,Ethernet92,Ethernet96,Ethernet100,Ethernet104,Ethernet108,Ethernet112,Ethernet116,Ethernet120,Ethernet124": { - "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", - "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", - "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", - "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable": "3,4" - } - }, - "WRED_PROFILE": { - "AZURE_LOSSLESS" : { - "wred_green_enable":"true", - "wred_yellow_enable":"true", - "wred_red_enable":"true", - "ecn":"ecn_all", - "red_max_threshold":"312000", - "red_min_threshold":"104000", - "yellow_max_threshold":"312000", - "yellow_min_threshold":"104000", - "green_max_threshold": "312000", - "green_min_threshold": "104000" - } - }, - "QUEUE": { - "Ethernet0,Ethernet4,Ethernet8,Ethernet12,Ethernet16,Ethernet20,Ethernet24,Ethernet28,Ethernet32,Ethernet36,Ethernet40,Ethernet44,Ethernet48,Ethernet52,Ethernet56,Ethernet60,Ethernet64,Ethernet68,Ethernet72,Ethernet76,Ethernet80,Ethernet84,Ethernet88,Ethernet92,Ethernet96,Ethernet100,Ethernet104,Ethernet108,Ethernet112,Ethernet116,Ethernet120,Ethernet124|3-4" : { - "scheduler" : "[SCHEDULER|scheduler.0]", - "wred_profile" : "[WRED_PROFILE|AZURE_LOSSLESS]" - }, - "Ethernet0,Ethernet4,Ethernet8,Ethernet12,Ethernet16,Ethernet20,Ethernet24,Ethernet28,Ethernet32,Ethernet36,Ethernet40,Ethernet44,Ethernet48,Ethernet52,Ethernet56,Ethernet60,Ethernet64,Ethernet68,Ethernet72,Ethernet76,Ethernet80,Ethernet84,Ethernet88,Ethernet92,Ethernet96,Ethernet100,Ethernet104,Ethernet108,Ethernet112,Ethernet116,Ethernet120,Ethernet124|0" : { - "scheduler" : "[SCHEDULER|scheduler.1]" - }, - "Ethernet0,Ethernet4,Ethernet8,Ethernet12,Ethernet16,Ethernet20,Ethernet24,Ethernet28,Ethernet32,Ethernet36,Ethernet40,Ethernet44,Ethernet48,Ethernet52,Ethernet56,Ethernet60,Ethernet64,Ethernet68,Ethernet72,Ethernet76,Ethernet80,Ethernet84,Ethernet88,Ethernet92,Ethernet96,Ethernet100,Ethernet104,Ethernet108,Ethernet112,Ethernet116,Ethernet120,Ethernet124|1" : { - "scheduler" : "[SCHEDULER|scheduler.2]" - } - } -} +{%- macro generate_port_lists(PORT_ALL) %} + {# Generate list of ports #} + {% for port_idx in range(0, 32) %} + {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{% endif %} + {% endfor %} +{%- endmacro %} + +{%- include 'qos_config.j2' %} diff --git a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D108C8/qos.json.j2 b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D108C8/qos.json.j2 index 06efa3591771..953e9b592b10 100644 --- a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D108C8/qos.json.j2 +++ b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D108C8/qos.json.j2 @@ -1,155 +1,8 @@ -{ - "TC_TO_PRIORITY_GROUP_MAP": { - "AZURE": { - "0": "0", - "1": "1", - "2": "2", - "3": "3", - "4": "4", - "5": "5", - "6": "6", - "7": "7" - } - }, - "MAP_PFC_PRIORITY_TO_QUEUE": { - "AZURE": { - "0": "0", - "1": "1", - "2": "2", - "3": "3", - "4": "4", - "5": "5", - "6": "6", - "7": "7" - } - }, - "TC_TO_QUEUE_MAP": { - "AZURE": { - "0": "0", - "1": "1", - "2": "2", - "3": "3", - "4": "4", - "5": "5", - "6": "6", - "7": "7" - } - }, - "DSCP_TO_TC_MAP": { - "AZURE": { - "0":"0", - "1":"0", - "2":"0", - "3":"3", - "4":"4", - "5":"0", - "6":"0", - "7":"0", - "8":"1", - "9":"0", - "10":"0", - "11":"0", - "12":"0", - "13":"0", - "14":"0", - "15":"0", - "16":"0", - "17":"0", - "18":"0", - "19":"0", - "20":"0", - "21":"0", - "22":"0", - "23":"0", - "24":"0", - "25":"0", - "26":"0", - "27":"0", - "28":"0", - "29":"0", - "30":"0", - "31":"0", - "32":"0", - "33":"0", - "34":"0", - "35":"0", - "36":"0", - "37":"0", - "38":"0", - "39":"0", - "40":"0", - "41":"0", - "42":"0", - "43":"0", - "44":"0", - "45":"0", - "46":"0", - "47":"0", - "48":"0", - "49":"0", - "50":"0", - "51":"0", - "52":"0", - "53":"0", - "54":"0", - "55":"0", - "56":"0", - "57":"0", - "58":"0", - "59":"0", - "60":"0", - "61":"0", - "62":"0", - "63":"0" - } - }, - "SCHEDULER": { - "scheduler.0" : { - "type":"DWRR", - "weight": "25" - }, - "scheduler.1" : { - "type":"DWRR", - "weight": "30" - }, - "scheduler.2" : { - "type":"DWRR", - "weight": "20" - } - }, - "PORT_QOS_MAP": { - "Ethernet0,Ethernet2,Ethernet4,Ethernet6,Ethernet8,Ethernet10,Ethernet12,Ethernet14,Ethernet16,Ethernet18,Ethernet20,Ethernet22,Ethernet24,Ethernet26,Ethernet28,Ethernet30,Ethernet32,Ethernet34,Ethernet36,Ethernet38,Ethernet40,Ethernet42,Ethernet44,Ethernet46,Ethernet48,Ethernet52,Ethernet56,Ethernet60,Ethernet64,Ethernet68,Ethernet72,Ethernet76,Ethernet80,Ethernet82,Ethernet84,Ethernet86,Ethernet88,Ethernet90,Ethernet92,Ethernet94,Ethernet96,Ethernet98,Ethernet100,Ethernet102,Ethernet104,Ethernet106,Ethernet108,Ethernet110,Ethernet112,Ethernet114,Ethernet116,Ethernet118,Ethernet120,Ethernet122,Ethernet124,Ethernet126,Ethernet128,Ethernet130,Ethernet132,Ethernet134,Ethernet136,Ethernet138,Ethernet140,Ethernet142,Ethernet144,Ethernet146,Ethernet148,Ethernet150,Ethernet152,Ethernet154,Ethernet156,Ethernet158,Ethernet160,Ethernet162,Ethernet164,Ethernet166,Ethernet168,Ethernet170,Ethernet172,Ethernet174,Ethernet176,Ethernet178,Ethernet180,Ethernet182,Ethernet184,Ethernet186,Ethernet188,Ethernet190,Ethernet192,Ethernet194,Ethernet196,Ethernet198,Ethernet200,Ethernet202,Ethernet204,Ethernet206,Ethernet208,Ethernet210,Ethernet212,Ethernet214,Ethernet216,Ethernet218,Ethernet220,Ethernet222,Ethernet224,Ethernet226,Ethernet228,Ethernet230,Ethernet232,Ethernet234,Ethernet236,Ethernet238,Ethernet240,Ethernet242,Ethernet244,Ethernet246,Ethernet248,Ethernet250,Ethernet252,Ethernet254": { - "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", - "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", - "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", - "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable": "3,4" - } - }, - "WRED_PROFILE": { - "AZURE_LOSSLESS" : { - "wred_green_enable":"true", - "wred_yellow_enable":"true", - "wred_red_enable":"true", - "ecn":"ecn_all", - "red_max_threshold":"312000", - "red_min_threshold":"104000", - "yellow_max_threshold":"312000", - "yellow_min_threshold":"104000", - "green_max_threshold": "312000", - "green_min_threshold": "104000" - } - }, - "QUEUE": { - "Ethernet0,Ethernet2,Ethernet4,Ethernet6,Ethernet8,Ethernet10,Ethernet12,Ethernet14,Ethernet16,Ethernet18,Ethernet20,Ethernet22,Ethernet24,Ethernet26,Ethernet28,Ethernet30,Ethernet32,Ethernet34,Ethernet36,Ethernet38,Ethernet40,Ethernet42,Ethernet44,Ethernet46,Ethernet48,Ethernet52,Ethernet56,Ethernet60,Ethernet64,Ethernet68,Ethernet72,Ethernet76,Ethernet80,Ethernet82,Ethernet84,Ethernet86,Ethernet88,Ethernet90,Ethernet92,Ethernet94,Ethernet96,Ethernet98,Ethernet100,Ethernet102,Ethernet104,Ethernet106,Ethernet108,Ethernet110,Ethernet112,Ethernet114,Ethernet116,Ethernet118,Ethernet120,Ethernet122,Ethernet124,Ethernet126,Ethernet128,Ethernet130,Ethernet132,Ethernet134,Ethernet136,Ethernet138,Ethernet140,Ethernet142,Ethernet144,Ethernet146,Ethernet148,Ethernet150,Ethernet152,Ethernet154,Ethernet156,Ethernet158,Ethernet160,Ethernet162,Ethernet164,Ethernet166,Ethernet168,Ethernet170,Ethernet172,Ethernet174,Ethernet176,Ethernet178,Ethernet180,Ethernet182,Ethernet184,Ethernet186,Ethernet188,Ethernet190,Ethernet192,Ethernet194,Ethernet196,Ethernet198,Ethernet200,Ethernet202,Ethernet204,Ethernet206,Ethernet208,Ethernet210,Ethernet212,Ethernet214,Ethernet216,Ethernet218,Ethernet220,Ethernet222,Ethernet224,Ethernet226,Ethernet228,Ethernet230,Ethernet232,Ethernet234,Ethernet236,Ethernet238,Ethernet240,Ethernet242,Ethernet244,Ethernet246,Ethernet248,Ethernet250,Ethernet252,Ethernet254|3-4" : { - "scheduler" : "[SCHEDULER|scheduler.0]", - "wred_profile" : "[WRED_PROFILE|AZURE_LOSSLESS]" - }, - "Ethernet0,Ethernet2,Ethernet4,Ethernet6,Ethernet8,Ethernet10,Ethernet12,Ethernet14,Ethernet16,Ethernet18,Ethernet20,Ethernet22,Ethernet24,Ethernet26,Ethernet28,Ethernet30,Ethernet32,Ethernet34,Ethernet36,Ethernet38,Ethernet40,Ethernet42,Ethernet44,Ethernet46,Ethernet48,Ethernet52,Ethernet56,Ethernet60,Ethernet64,Ethernet68,Ethernet72,Ethernet76,Ethernet80,Ethernet82,Ethernet84,Ethernet86,Ethernet88,Ethernet90,Ethernet92,Ethernet94,Ethernet96,Ethernet98,Ethernet100,Ethernet102,Ethernet104,Ethernet106,Ethernet108,Ethernet110,Ethernet112,Ethernet114,Ethernet116,Ethernet118,Ethernet120,Ethernet122,Ethernet124,Ethernet126,Ethernet128,Ethernet130,Ethernet132,Ethernet134,Ethernet136,Ethernet138,Ethernet140,Ethernet142,Ethernet144,Ethernet146,Ethernet148,Ethernet150,Ethernet152,Ethernet154,Ethernet156,Ethernet158,Ethernet160,Ethernet162,Ethernet164,Ethernet166,Ethernet168,Ethernet170,Ethernet172,Ethernet174,Ethernet176,Ethernet178,Ethernet180,Ethernet182,Ethernet184,Ethernet186,Ethernet188,Ethernet190,Ethernet192,Ethernet194,Ethernet196,Ethernet198,Ethernet200,Ethernet202,Ethernet204,Ethernet206,Ethernet208,Ethernet210,Ethernet212,Ethernet214,Ethernet216,Ethernet218,Ethernet220,Ethernet222,Ethernet224,Ethernet226,Ethernet228,Ethernet230,Ethernet232,Ethernet234,Ethernet236,Ethernet238,Ethernet240,Ethernet242,Ethernet244,Ethernet246,Ethernet248,Ethernet250,Ethernet252,Ethernet254|0" : { - "scheduler" : "[SCHEDULER|scheduler.1]" - }, - "Ethernet0,Ethernet2,Ethernet4,Ethernet6,Ethernet8,Ethernet10,Ethernet12,Ethernet14,Ethernet16,Ethernet18,Ethernet20,Ethernet22,Ethernet24,Ethernet26,Ethernet28,Ethernet30,Ethernet32,Ethernet34,Ethernet36,Ethernet38,Ethernet40,Ethernet42,Ethernet44,Ethernet46,Ethernet48,Ethernet52,Ethernet56,Ethernet60,Ethernet64,Ethernet68,Ethernet72,Ethernet76,Ethernet80,Ethernet82,Ethernet84,Ethernet86,Ethernet88,Ethernet90,Ethernet92,Ethernet94,Ethernet96,Ethernet98,Ethernet100,Ethernet102,Ethernet104,Ethernet106,Ethernet108,Ethernet110,Ethernet112,Ethernet114,Ethernet116,Ethernet118,Ethernet120,Ethernet122,Ethernet124,Ethernet126,Ethernet128,Ethernet130,Ethernet132,Ethernet134,Ethernet136,Ethernet138,Ethernet140,Ethernet142,Ethernet144,Ethernet146,Ethernet148,Ethernet150,Ethernet152,Ethernet154,Ethernet156,Ethernet158,Ethernet160,Ethernet162,Ethernet164,Ethernet166,Ethernet168,Ethernet170,Ethernet172,Ethernet174,Ethernet176,Ethernet178,Ethernet180,Ethernet182,Ethernet184,Ethernet186,Ethernet188,Ethernet190,Ethernet192,Ethernet194,Ethernet196,Ethernet198,Ethernet200,Ethernet202,Ethernet204,Ethernet206,Ethernet208,Ethernet210,Ethernet212,Ethernet214,Ethernet216,Ethernet218,Ethernet220,Ethernet222,Ethernet224,Ethernet226,Ethernet228,Ethernet230,Ethernet232,Ethernet234,Ethernet236,Ethernet238,Ethernet240,Ethernet242,Ethernet244,Ethernet246,Ethernet248,Ethernet250,Ethernet252,Ethernet254|1" : { - "scheduler" : "[SCHEDULER|scheduler.2]" - } - } -} +{%- macro generate_port_lists(PORT_ALL) %} + {# Generate list of ports #} + {% for port_idx in range(0, 256, 2) if port_idx not in [50, 54, 58, 62, 66, 70, 74, 78] %} + {% if PORT_ALL.append("Ethernet%d" % (port_idx)) %}{% endif %} + {% endfor %} +{%- endmacro %} + +{%- include 'qos_config.j2' %} diff --git a/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000/qos.json.j2 b/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000/qos.json.j2 index 926911ab59d0..38ae7d9c881f 100644 --- a/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000/qos.json.j2 +++ b/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000/qos.json.j2 @@ -1,143 +1,8 @@ -{ - "TC_TO_PRIORITY_GROUP_MAP": { - "AZURE": { - "0": "0", - "1": "1", - "3": "3", - "4": "4" - } - }, - "MAP_PFC_PRIORITY_TO_QUEUE": { - "AZURE": { - "0": "0", - "1": "1", - "3": "3", - "4": "4" - } - }, - "TC_TO_QUEUE_MAP": { - "AZURE": { - "0": "0", - "1": "1", - "3": "3", - "4": "4" - } - }, - "DSCP_TO_TC_MAP": { - "AZURE": { - "0":"0", - "1":"0", - "2":"0", - "3":"3", - "4":"4", - "5":"0", - "6":"0", - "7":"0", - "8":"1", - "9":"0", - "10":"0", - "11":"0", - "12":"0", - "13":"0", - "14":"0", - "15":"0", - "16":"0", - "17":"0", - "18":"0", - "19":"0", - "20":"0", - "21":"0", - "22":"0", - "23":"0", - "24":"0", - "25":"0", - "26":"0", - "27":"0", - "28":"0", - "29":"0", - "30":"0", - "31":"0", - "32":"0", - "33":"0", - "34":"0", - "35":"0", - "36":"0", - "37":"0", - "38":"0", - "39":"0", - "40":"0", - "41":"0", - "42":"0", - "43":"0", - "44":"0", - "45":"0", - "46":"0", - "47":"0", - "48":"0", - "49":"0", - "50":"0", - "51":"0", - "52":"0", - "53":"0", - "54":"0", - "55":"0", - "56":"0", - "57":"0", - "58":"0", - "59":"0", - "60":"0", - "61":"0", - "62":"0", - "63":"0" - } - }, - "SCHEDULER": { - "scheduler.0" : { - "type":"DWRR", - "weight": "25" - }, - "scheduler.1" : { - "type":"DWRR", - "weight": "30" - }, - "scheduler.2" : { - "type":"DWRR", - "weight": "20" - } - }, - "PORT_QOS_MAP": { - "Ethernet0,Ethernet4,Ethernet8,Ethernet12,Ethernet16,Ethernet20,Ethernet24,Ethernet28,Ethernet32,Ethernet36,Ethernet40,Ethernet44,Ethernet48,Ethernet52,Ethernet56,Ethernet60,Ethernet64,Ethernet68,Ethernet72,Ethernet76,Ethernet80,Ethernet84,Ethernet88,Ethernet92,Ethernet96,Ethernet100,Ethernet104,Ethernet108,Ethernet112,Ethernet116,Ethernet120,Ethernet124": { - "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", - "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", - "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", - "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable": "3,4" - } - }, - "WRED_PROFILE": { - "AZURE_LOSSLESS" : { - "wred_green_enable":"true", - "wred_yellow_enable":"true", - "wred_red_enable":"true", - "ecn":"ecn_all", - "red_max_threshold":"312000", - "red_min_threshold":"104000", - "yellow_max_threshold":"312000", - "yellow_min_threshold":"104000", - "green_max_threshold":"312000", - "green_min_threshold":"104000" - } - }, - "QUEUE": { - "Ethernet0,Ethernet4,Ethernet8,Ethernet12,Ethernet16,Ethernet20,Ethernet24,Ethernet28,Ethernet32,Ethernet36,Ethernet40,Ethernet44,Ethernet48,Ethernet52,Ethernet56,Ethernet60,Ethernet64,Ethernet68,Ethernet72,Ethernet76,Ethernet80,Ethernet84,Ethernet88,Ethernet92,Ethernet96,Ethernet100,Ethernet104,Ethernet108,Ethernet112,Ethernet116,Ethernet120,Ethernet124|3-4" : { - "scheduler" : "[SCHEDULER|scheduler.0]", - "wred_profile" : "[WRED_PROFILE|AZURE_LOSSLESS]" - }, - "Ethernet0,Ethernet4,Ethernet8,Ethernet12,Ethernet16,Ethernet20,Ethernet24,Ethernet28,Ethernet32,Ethernet36,Ethernet40,Ethernet44,Ethernet48,Ethernet52,Ethernet56,Ethernet60,Ethernet64,Ethernet68,Ethernet72,Ethernet76,Ethernet80,Ethernet84,Ethernet88,Ethernet92,Ethernet96,Ethernet100,Ethernet104,Ethernet108,Ethernet112,Ethernet116,Ethernet120,Ethernet124|0" : { - "scheduler" : "[SCHEDULER|scheduler.1]" - }, - "Ethernet0,Ethernet4,Ethernet8,Ethernet12,Ethernet16,Ethernet20,Ethernet24,Ethernet28,Ethernet32,Ethernet36,Ethernet40,Ethernet44,Ethernet48,Ethernet52,Ethernet56,Ethernet60,Ethernet64,Ethernet68,Ethernet72,Ethernet76,Ethernet80,Ethernet84,Ethernet88,Ethernet92,Ethernet96,Ethernet100,Ethernet104,Ethernet108,Ethernet112,Ethernet116,Ethernet120,Ethernet124|1" : { - "scheduler" : "[SCHEDULER|scheduler.2]" - } - } -} +{%- macro generate_port_lists(PORT_ALL) %} + {# Generate list of ports #} + {% for port_idx in range(0, 32) %} + {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{% endif %} + {% endfor %} +{%- endmacro %} + +{%- include 'qos_config.j2' %} diff --git a/device/dell/x86_64-dell_s6100_c2538-r0/Force10-S6100/qos.json.j2 b/device/dell/x86_64-dell_s6100_c2538-r0/Force10-S6100/qos.json.j2 index 054a8f832cd4..23e42877b8ae 100644 --- a/device/dell/x86_64-dell_s6100_c2538-r0/Force10-S6100/qos.json.j2 +++ b/device/dell/x86_64-dell_s6100_c2538-r0/Force10-S6100/qos.json.j2 @@ -1,182 +1,8 @@ -{%- set PORT_ALL = [] %} - -{%- if PORT is not defined %} - {%- for port_idx in range(0,64) %} - {%- if PORT_ALL.append("Ethernet%d" % (port_idx)) %}{%- endif %} - {%- endfor %} -{%- else %} - {%- for port in PORT %} - {%- if PORT_ALL.append(port) %}{%- endif %} - {%- endfor %} -{%- endif %} - -{%- set PORT_ACTIVE = [] %} -{%- if DEVICE_NEIGHBOR is not defined %} - {%- set PORT_ACTIVE = PORT_ALL %} -{%- else %} - {%- for port in DEVICE_NEIGHBOR.keys() %} - {%- if PORT_ACTIVE.append(port) %}{%- endif %} - {%- endfor %} -{%- endif %} - -{%- set port_names_list_active = [] %} -{%- for port in PORT_ACTIVE %} - {%- if port_names_list_active.append(port) %}{%- endif %} -{%- endfor %} -{%- set port_names_active = port_names_list_active | join(',') %} - -{ - "TC_TO_PRIORITY_GROUP_MAP": { - "AZURE": { - "0": "0", - "1": "1", - "2": "2", - "3": "3", - "4": "4", - "5": "5", - "6": "6", - "7": "7" - } - }, - "MAP_PFC_PRIORITY_TO_QUEUE": { - "AZURE": { - "0": "0", - "1": "1", - "2": "2", - "3": "3", - "4": "4", - "5": "5", - "6": "6", - "7": "7" - } - }, - "TC_TO_QUEUE_MAP": { - "AZURE": { - "0": "0", - "1": "1", - "2": "2", - "3": "3", - "4": "4", - "5": "5", - "6": "6", - "7": "7" - } - }, - "DSCP_TO_TC_MAP": { - "AZURE": { - "0":"0", - "1":"0", - "2":"0", - "3":"3", - "4":"4", - "5":"0", - "6":"0", - "7":"0", - "8":"1", - "9":"0", - "10":"0", - "11":"0", - "12":"0", - "13":"0", - "14":"0", - "15":"0", - "16":"0", - "17":"0", - "18":"0", - "19":"0", - "20":"0", - "21":"0", - "22":"0", - "23":"0", - "24":"0", - "25":"0", - "26":"0", - "27":"0", - "28":"0", - "29":"0", - "30":"0", - "31":"0", - "32":"0", - "33":"0", - "34":"0", - "35":"0", - "36":"0", - "37":"0", - "38":"0", - "39":"0", - "40":"0", - "41":"0", - "42":"0", - "43":"0", - "44":"0", - "45":"0", - "46":"0", - "47":"0", - "48":"0", - "49":"0", - "50":"0", - "51":"0", - "52":"0", - "53":"0", - "54":"0", - "55":"0", - "56":"0", - "57":"0", - "58":"0", - "59":"0", - "60":"0", - "61":"0", - "62":"0", - "63":"0" - } - }, - "SCHEDULER": { - "scheduler.0" : { - "type":"DWRR", - "weight": "25" - }, - "scheduler.1" : { - "type":"DWRR", - "weight": "30" - }, - "scheduler.2" : { - "type":"DWRR", - "weight": "20" - } - }, - "PORT_QOS_MAP": { - "{{ port_names_active }}": { - "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", - "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", - "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", - "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable": "3,4" - } - }, - "WRED_PROFILE": { - "AZURE_LOSSLESS" : { - "wred_green_enable":"true", - "wred_yellow_enable":"true", - "wred_red_enable":"true", - "ecn":"ecn_all", - "red_max_threshold":"312000", - "red_min_threshold":"104000", - "yellow_max_threshold":"312000", - "yellow_min_threshold":"104000", - "green_max_threshold": "312000", - "green_min_threshold": "104000" - } - }, - "QUEUE": { - "{{ port_names_active }}|3-4" : { - "scheduler" : "[SCHEDULER|scheduler.0]", - "wred_profile" : "[WRED_PROFILE|AZURE_LOSSLESS]" - }, - "{{ port_names_active }}|0" : { - "scheduler" : "[SCHEDULER|scheduler.1]" - }, - "{{ port_names_active }}|1" : { - "scheduler" : "[SCHEDULER|scheduler.2]" - } - } -} +{%- macro generate_port_lists(PORT_ALL) %} + {# Generate list of ports #} + {% for port_idx in range(0, 64) %} + {% if PORT_ALL.append("Ethernet%d" % (port_idx)) %}{% endif %} + {% endfor %} +{%- endmacro %} + +{%- include 'qos_config.j2' %} diff --git a/device/dell/x86_64-dell_z9100_c2538-r0/Force10-Z9100-T0/qos.json.j2 b/device/dell/x86_64-dell_z9100_c2538-r0/Force10-Z9100-T0/qos.json.j2 index 57bb4c532177..24c8856d17c2 100644 --- a/device/dell/x86_64-dell_z9100_c2538-r0/Force10-Z9100-T0/qos.json.j2 +++ b/device/dell/x86_64-dell_z9100_c2538-r0/Force10-Z9100-T0/qos.json.j2 @@ -1,155 +1,8 @@ -{ - "TC_TO_PRIORITY_GROUP_MAP": { - "AZURE": { - "0": "0", - "1": "1", - "2": "2", - "3": "3", - "4": "4", - "5": "5", - "6": "6", - "7": "7" - } - }, - "MAP_PFC_PRIORITY_TO_QUEUE": { - "AZURE": { - "0": "0", - "1": "1", - "2": "2", - "3": "3", - "4": "4", - "5": "5", - "6": "6", - "7": "7" - } - }, - "TC_TO_QUEUE_MAP": { - "AZURE": { - "0": "0", - "1": "1", - "2": "2", - "3": "3", - "4": "4", - "5": "5", - "6": "6", - "7": "7" - } - }, - "DSCP_TO_TC_MAP": { - "AZURE": { - "0":"0", - "1":"0", - "2":"0", - "3":"3", - "4":"4", - "5":"0", - "6":"0", - "7":"0", - "8":"1", - "9":"0", - "10":"0", - "11":"0", - "12":"0", - "13":"0", - "14":"0", - "15":"0", - "16":"0", - "17":"0", - "18":"0", - "19":"0", - "20":"0", - "21":"0", - "22":"0", - "23":"0", - "24":"0", - "25":"0", - "26":"0", - "27":"0", - "28":"0", - "29":"0", - "30":"0", - "31":"0", - "32":"0", - "33":"0", - "34":"0", - "35":"0", - "36":"0", - "37":"0", - "38":"0", - "39":"0", - "40":"0", - "41":"0", - "42":"0", - "43":"0", - "44":"0", - "45":"0", - "46":"0", - "47":"0", - "48":"0", - "49":"0", - "50":"0", - "51":"0", - "52":"0", - "53":"0", - "54":"0", - "55":"0", - "56":"0", - "57":"0", - "58":"0", - "59":"0", - "60":"0", - "61":"0", - "62":"0", - "63":"0" - } - }, - "SCHEDULER": { - "scheduler.0" : { - "type":"DWRR", - "weight": "25" - }, - "scheduler.1" : { - "type":"DWRR", - "weight": "30" - }, - "scheduler.2" : { - "type":"DWRR", - "weight": "20" - } - }, - "PORT_QOS_MAP": { - "Ethernet0,Ethernet2,Ethernet4,Ethernet6,Ethernet8,Ethernet10,Ethernet12,Ethernet14,Ethernet16,Ethernet18,Ethernet20,Ethernet22,Ethernet24,Ethernet28,Ethernet32,Ethernet36,Ethernet40,Ethernet42,Ethernet44,Ethernet46,Ethernet48,Ethernet50,Ethernet52,Ethernet54,Ethernet56,Ethernet58,Ethernet60,Ethernet62,Ethernet64,Ethernet66,Ethernet68,Ethernet70,Ethernet72,Ethernet74,Ethernet76,Ethernet78,Ethernet80,Ethernet82,Ethernet84,Ethernet86,Ethernet88,Ethernet90,Ethernet92,Ethernet94,Ethernet96,Ethernet98,Ethernet100,Ethernet102,Ethernet104,Ethernet108,Ethernet112,Ethernet116,Ethernet120,Ethernet122,Ethernet124,Ethernet126": { - "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", - "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", - "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", - "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable": "3,4" - } - }, - "WRED_PROFILE": { - "AZURE_LOSSLESS" : { - "wred_green_enable":"true", - "wred_yellow_enable":"true", - "wred_red_enable":"true", - "ecn":"ecn_all", - "red_max_threshold":"312000", - "red_min_threshold":"104000", - "yellow_max_threshold":"312000", - "yellow_min_threshold":"104000", - "green_max_threshold": "312000", - "green_min_threshold": "104000" - } - }, - "QUEUE": { - "Ethernet0,Ethernet2,Ethernet4,Ethernet6,Ethernet8,Ethernet10,Ethernet12,Ethernet14,Ethernet16,Ethernet18,Ethernet20,Ethernet22,Ethernet24,Ethernet28,Ethernet32,Ethernet36,Ethernet40,Ethernet42,Ethernet44,Ethernet46,Ethernet48,Ethernet50,Ethernet52,Ethernet54,Ethernet56,Ethernet58,Ethernet60,Ethernet62,Ethernet64,Ethernet66,Ethernet68,Ethernet70,Ethernet72,Ethernet74,Ethernet76,Ethernet78,Ethernet80,Ethernet82,Ethernet84,Ethernet86,Ethernet88,Ethernet90,Ethernet92,Ethernet94,Ethernet96,Ethernet98,Ethernet100,Ethernet102,Ethernet104,Ethernet108,Ethernet112,Ethernet116,Ethernet120,Ethernet122,Ethernet124,Ethernet126|3-4": { - "scheduler" : "[SCHEDULER|scheduler.0]", - "wred_profile" : "[WRED_PROFILE|AZURE_LOSSLESS]" - }, - "Ethernet0,Ethernet2,Ethernet4,Ethernet6,Ethernet8,Ethernet10,Ethernet12,Ethernet14,Ethernet16,Ethernet18,Ethernet20,Ethernet22,Ethernet24,Ethernet28,Ethernet32,Ethernet36,Ethernet40,Ethernet42,Ethernet44,Ethernet46,Ethernet48,Ethernet50,Ethernet52,Ethernet54,Ethernet56,Ethernet58,Ethernet60,Ethernet62,Ethernet64,Ethernet66,Ethernet68,Ethernet70,Ethernet72,Ethernet74,Ethernet76,Ethernet78,Ethernet80,Ethernet82,Ethernet84,Ethernet86,Ethernet88,Ethernet90,Ethernet92,Ethernet94,Ethernet96,Ethernet98,Ethernet100,Ethernet102,Ethernet104,Ethernet108,Ethernet112,Ethernet116,Ethernet120,Ethernet122,Ethernet124,Ethernet126|0": { - "scheduler" : "[SCHEDULER|scheduler.1]" - }, - "Ethernet0,Ethernet2,Ethernet4,Ethernet6,Ethernet8,Ethernet10,Ethernet12,Ethernet14,Ethernet16,Ethernet18,Ethernet20,Ethernet22,Ethernet24,Ethernet28,Ethernet32,Ethernet36,Ethernet40,Ethernet42,Ethernet44,Ethernet46,Ethernet48,Ethernet50,Ethernet52,Ethernet54,Ethernet56,Ethernet58,Ethernet60,Ethernet62,Ethernet64,Ethernet66,Ethernet68,Ethernet70,Ethernet72,Ethernet74,Ethernet76,Ethernet78,Ethernet80,Ethernet82,Ethernet84,Ethernet86,Ethernet88,Ethernet90,Ethernet92,Ethernet94,Ethernet96,Ethernet98,Ethernet100,Ethernet102,Ethernet104,Ethernet108,Ethernet112,Ethernet116,Ethernet120,Ethernet122,Ethernet124,Ethernet126|1": { - "scheduler" : "[SCHEDULER|scheduler.2]" - } - } -} +{%- macro generate_port_lists(PORT_ALL) %} + {# Generate list of ports #} + {% for port_idx in range(0, 128, 2) if port_idx not in [26, 30, 34, 38, 106, 110, 114, 118] %} + {% if PORT_ALL.append("Ethernet%d" % (port_idx)) %}{% endif %} + {% endfor %} +{%- endmacro %} + +{%- include 'qos_config.j2' %} diff --git a/device/dell/x86_64-dell_z9100_c2538-r0/Force10-Z9100/qos.json.j2 b/device/dell/x86_64-dell_z9100_c2538-r0/Force10-Z9100/qos.json.j2 index 84f74ecab3be..38ae7d9c881f 100644 --- a/device/dell/x86_64-dell_z9100_c2538-r0/Force10-Z9100/qos.json.j2 +++ b/device/dell/x86_64-dell_z9100_c2538-r0/Force10-Z9100/qos.json.j2 @@ -1,155 +1,8 @@ -{ - "TC_TO_PRIORITY_GROUP_MAP": { - "AZURE": { - "0": "0", - "1": "1", - "2": "2", - "3": "3", - "4": "4", - "5": "5", - "6": "6", - "7": "7" - } - }, - "MAP_PFC_PRIORITY_TO_QUEUE": { - "AZURE": { - "0": "0", - "1": "1", - "2": "2", - "3": "3", - "4": "4", - "5": "5", - "6": "6", - "7": "7" - } - }, - "TC_TO_QUEUE_MAP": { - "AZURE": { - "0": "0", - "1": "1", - "2": "2", - "3": "3", - "4": "4", - "5": "5", - "6": "6", - "7": "7" - } - }, - "DSCP_TO_TC_MAP": { - "AZURE": { - "0":"0", - "1":"0", - "2":"0", - "3":"3", - "4":"4", - "5":"0", - "6":"0", - "7":"0", - "8":"1", - "9":"0", - "10":"0", - "11":"0", - "12":"0", - "13":"0", - "14":"0", - "15":"0", - "16":"0", - "17":"0", - "18":"0", - "19":"0", - "20":"0", - "21":"0", - "22":"0", - "23":"0", - "24":"0", - "25":"0", - "26":"0", - "27":"0", - "28":"0", - "29":"0", - "30":"0", - "31":"0", - "32":"0", - "33":"0", - "34":"0", - "35":"0", - "36":"0", - "37":"0", - "38":"0", - "39":"0", - "40":"0", - "41":"0", - "42":"0", - "43":"0", - "44":"0", - "45":"0", - "46":"0", - "47":"0", - "48":"0", - "49":"0", - "50":"0", - "51":"0", - "52":"0", - "53":"0", - "54":"0", - "55":"0", - "56":"0", - "57":"0", - "58":"0", - "59":"0", - "60":"0", - "61":"0", - "62":"0", - "63":"0" - } - }, - "SCHEDULER": { - "scheduler.0" : { - "type":"DWRR", - "weight": "25" - }, - "scheduler.1" : { - "type":"DWRR", - "weight": "30" - }, - "scheduler.2" : { - "type":"DWRR", - "weight": "20" - } - }, - "PORT_QOS_MAP": { - "Ethernet0,Ethernet4,Ethernet8,Ethernet12,Ethernet16,Ethernet20,Ethernet24,Ethernet28,Ethernet32,Ethernet36,Ethernet40,Ethernet44,Ethernet48,Ethernet52,Ethernet56,Ethernet60,Ethernet64,Ethernet68,Ethernet72,Ethernet76,Ethernet80,Ethernet84,Ethernet88,Ethernet92,Ethernet96,Ethernet100,Ethernet104,Ethernet108,Ethernet112,Ethernet116,Ethernet120,Ethernet124": { - "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", - "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", - "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", - "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable": "3,4" - } - }, - "WRED_PROFILE": { - "AZURE_LOSSLESS" : { - "wred_green_enable":"true", - "wred_yellow_enable":"true", - "wred_red_enable":"true", - "ecn":"ecn_all", - "red_max_threshold":"312000", - "red_min_threshold":"104000", - "yellow_max_threshold":"312000", - "yellow_min_threshold":"104000", - "green_max_threshold": "312000", - "green_min_threshold": "104000" - } - }, - "QUEUE": { - "Ethernet0,Ethernet4,Ethernet8,Ethernet12,Ethernet16,Ethernet20,Ethernet24,Ethernet28,Ethernet32,Ethernet36,Ethernet40,Ethernet44,Ethernet48,Ethernet52,Ethernet56,Ethernet60,Ethernet64,Ethernet68,Ethernet72,Ethernet76,Ethernet80,Ethernet84,Ethernet88,Ethernet92,Ethernet96,Ethernet100,Ethernet104,Ethernet108,Ethernet112,Ethernet116,Ethernet120,Ethernet124|3-4" : { - "scheduler" : "[SCHEDULER|scheduler.0]", - "wred_profile" : "[WRED_PROFILE|AZURE_LOSSLESS]" - }, - "Ethernet0,Ethernet4,Ethernet8,Ethernet12,Ethernet16,Ethernet20,Ethernet24,Ethernet28,Ethernet32,Ethernet36,Ethernet40,Ethernet44,Ethernet48,Ethernet52,Ethernet56,Ethernet60,Ethernet64,Ethernet68,Ethernet72,Ethernet76,Ethernet80,Ethernet84,Ethernet88,Ethernet92,Ethernet96,Ethernet100,Ethernet104,Ethernet108,Ethernet112,Ethernet116,Ethernet120,Ethernet124|0" : { - "scheduler" : "[SCHEDULER|scheduler.1]" - }, - "Ethernet0,Ethernet4,Ethernet8,Ethernet12,Ethernet16,Ethernet20,Ethernet24,Ethernet28,Ethernet32,Ethernet36,Ethernet40,Ethernet44,Ethernet48,Ethernet52,Ethernet56,Ethernet60,Ethernet64,Ethernet68,Ethernet72,Ethernet76,Ethernet80,Ethernet84,Ethernet88,Ethernet92,Ethernet96,Ethernet100,Ethernet104,Ethernet108,Ethernet112,Ethernet116,Ethernet120,Ethernet124|1" : { - "scheduler" : "[SCHEDULER|scheduler.2]" - } - } -} +{%- macro generate_port_lists(PORT_ALL) %} + {# Generate list of ports #} + {% for port_idx in range(0, 32) %} + {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{% endif %} + {% endfor %} +{%- endmacro %} + +{%- include 'qos_config.j2' %} diff --git a/files/build_templates/qos_config.j2 b/files/build_templates/qos_config.j2 index 58d3ed8bde16..1e7792fe87ff 100644 --- a/files/build_templates/qos_config.j2 +++ b/files/build_templates/qos_config.j2 @@ -7,6 +7,7 @@ {%- if PORT_ALL.append(port) %}{% endif %} {%- endfor %} {%- endif %} +{%- if PORT_ALL | sort_by_port_index %}{% endif %} {%- set port_names_list_all = [] %} {%- for port in PORT_ALL %} @@ -23,6 +24,7 @@ {%- if PORT_ACTIVE.append(port) %}{%- endif %} {%- endfor %} {%- endif %} +{%- if PORT_ACTIVE | sort_by_port_index %}{% endif %} {%- set port_names_list_active = [] %} {%- for port in PORT_ACTIVE %} diff --git a/src/sonic-config-engine/sonic-cfggen b/src/sonic-config-engine/sonic-cfggen index bdb3c804fc73..27eaf5d9a78f 100755 --- a/src/sonic-config-engine/sonic-cfggen +++ b/src/sonic-config-engine/sonic-cfggen @@ -35,6 +35,12 @@ from swsssdk import ConfigDBConnector from collections import OrderedDict from natsort import natsorted +def sort_by_port_index(value): + if not value: + return + if isinstance(value, list): + value.sort(key = lambda k: int(k[8:])) + def is_ipv4(value): if not value: return False @@ -221,6 +227,7 @@ def main(): loader = jinja2.FileSystemLoader(paths) env = jinja2.Environment(loader=loader, trim_blocks=True) + env.filters['sort_by_port_index'] = sort_by_port_index env.filters['ipv4'] = is_ipv4 env.filters['ipv6'] = is_ipv6 env.filters['unique_name'] = unique_name From 31decf6cb91e7ac491cd25c2c591e539da254f5b Mon Sep 17 00:00:00 2001 From: Wenda Date: Thu, 6 Sep 2018 00:44:41 +0000 Subject: [PATCH 04/13] Change mlnx devices to use qos config template Signed-off-by: Wenda modified: ../../../mellanox/x86_64-mlnx_msn2100-r0/ACS-MSN2100/qos.json.j2 modified: ../../../mellanox/x86_64-mlnx_msn2410-r0/ACS-MSN2410/qos.json.j2 modified: ../../../mellanox/x86_64-mlnx_msn2700-r0/ACS-MSN2700/qos.json.j2 modified: ../../../mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D48C8/qos.json.j2 --- .../ACS-MSN2100/qos.json.j2 | 197 +----------------- .../ACS-MSN2410/qos.json.j2 | 197 +----------------- .../ACS-MSN2700/qos.json.j2 | 197 +----------------- .../Mellanox-SN2700-D48C8/qos.json.j2 | 197 +----------------- 4 files changed, 32 insertions(+), 756 deletions(-) diff --git a/device/mellanox/x86_64-mlnx_msn2100-r0/ACS-MSN2100/qos.json.j2 b/device/mellanox/x86_64-mlnx_msn2100-r0/ACS-MSN2100/qos.json.j2 index a11c77f7cc24..a7662f215682 100644 --- a/device/mellanox/x86_64-mlnx_msn2100-r0/ACS-MSN2100/qos.json.j2 +++ b/device/mellanox/x86_64-mlnx_msn2100-r0/ACS-MSN2100/qos.json.j2 @@ -1,191 +1,10 @@ -{%- set PORT_ALL = [] %} +{%- set pfc_to_pg_map = true %} -{%- if PORT is not defined %} - {%- for port_idx in range(0,64) %} - {%- if PORT_ALL.append("Ethernet%d" % (port_idx)) %}{%- endif %} - {%- endfor %} -{%- else %} - {%- for port in PORT %} - {%- if PORT_ALL.append(port) %}{%- endif %} - {%- endfor %} -{%- endif %} +{%- macro generate_port_lists(PORT_ALL) %} + {# Generate list of ports #} + {% for port_idx in range(0, 64) %} + {% if PORT_ALL.append("Ethernet%d" % (port_idx)) %}{% endif %} + {% endfor %} +{%- endmacro %} -{%- set PORT_ACTIVE = [] %} -{%- if DEVICE_NEIGHBOR is not defined %} - {%- set PORT_ACTIVE = PORT_ALL %} -{%- else %} - {%- for port in DEVICE_NEIGHBOR.keys() %} - {%- if PORT_ACTIVE.append(port) %}{%- endif %} - {%- endfor %} -{%- endif %} - -{%- set port_names_list_active = [] %} -{%- for port in PORT_ACTIVE %} - {%- if port_names_list_active.append(port) %}{%- endif %} -{%- endfor %} -{%- set port_names_active = port_names_list_active | join(',') %} - -{ - "TC_TO_PRIORITY_GROUP_MAP": { - "AZURE": { - "0": "0", - "1": "1", - "3": "3", - "4": "4" - } - }, - "MAP_PFC_PRIORITY_TO_QUEUE": { - "AZURE": { - "0": "0", - "1": "1", - "3": "3", - "4": "4" - } - }, - "TC_TO_QUEUE_MAP": { - "AZURE": { - "0": "0", - "1": "1", - "3": "3", - "4": "4" - } - }, - "DSCP_TO_TC_MAP": { - "AZURE": { - "0":"0", - "1":"0", - "2":"0", - "3":"3", - "4":"4", - "5":"0", - "6":"0", - "7":"0", - "8":"1", - "9":"0", - "10":"0", - "11":"0", - "12":"0", - "13":"0", - "14":"0", - "15":"0", - "16":"0", - "17":"0", - "18":"0", - "19":"0", - "20":"0", - "21":"0", - "22":"0", - "23":"0", - "24":"0", - "25":"0", - "26":"0", - "27":"0", - "28":"0", - "29":"0", - "30":"0", - "31":"0", - "32":"0", - "33":"0", - "34":"0", - "35":"0", - "36":"0", - "37":"0", - "38":"0", - "39":"0", - "40":"0", - "41":"0", - "42":"0", - "43":"0", - "44":"0", - "45":"0", - "46":"0", - "47":"0", - "48":"0", - "49":"0", - "50":"0", - "51":"0", - "52":"0", - "53":"0", - "54":"0", - "55":"0", - "56":"0", - "57":"0", - "58":"0", - "59":"0", - "60":"0", - "61":"0", - "62":"0", - "63":"0" - } - }, - "SCHEDULER": { - "scheduler.0": { - "type":"DWRR", - "weight": "25" - }, - "scheduler.1": { - "type":"DWRR", - "weight": "30" - }, - "scheduler.2": { - "type":"DWRR", - "weight": "20" - } - }, - "PFC_PRIORITY_TO_PRIORITY_GROUP_MAP": { - "AZURE": { - "0": "0", - "1": "1", - "3": "3", - "4": "4" - } - }, - "PORT_QOS_MAP": { - "{{ port_names_active }}": { - "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", - "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", - "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", - "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_to_pg_map" : "[PFC_PRIORITY_TO_PRIORITY_GROUP_MAP|AZURE]", - "pfc_enable": "3,4" - } - }, - "WRED_PROFILE": { - "AZURE_LOSSY": { - "wred_green_enable":"true", - "wred_yellow_enable":"true", - "wred_red_enable":"true", - "ecn":"ecn_all", - "red_max_threshold":"516096", - "red_min_threshold":"516096", - "yellow_max_threshold":"516096", - "yellow_min_threshold":"516096", - "green_max_threshold": "184320", - "green_min_threshold": "184320" - }, - "AZURE_LOSSLESS": { - "wred_green_enable":"true", - "wred_yellow_enable":"true", - "wred_red_enable":"true", - "ecn":"ecn_all", - "red_max_threshold":"516096", - "red_min_threshold":"516096", - "yellow_max_threshold":"516096", - "yellow_min_threshold":"516096", - "green_max_threshold": "184320", - "green_min_threshold": "184320" - } - }, - "QUEUE": { - "{{ port_names_active }}|3-4" : { - "scheduler" : "[SCHEDULER|scheduler.0]", - "wred_profile" : "[WRED_PROFILE|AZURE_LOSSLESS]" - }, - "{{ port_names_active }}|0" : { - "scheduler" : "[SCHEDULER|scheduler.1]" - }, - "{{ port_names_active }}|1" : { - "scheduler" : "[SCHEDULER|scheduler.2]" - } - } -} +{%- include 'qos_config.j2' %} diff --git a/device/mellanox/x86_64-mlnx_msn2410-r0/ACS-MSN2410/qos.json.j2 b/device/mellanox/x86_64-mlnx_msn2410-r0/ACS-MSN2410/qos.json.j2 index a11c77f7cc24..a7662f215682 100644 --- a/device/mellanox/x86_64-mlnx_msn2410-r0/ACS-MSN2410/qos.json.j2 +++ b/device/mellanox/x86_64-mlnx_msn2410-r0/ACS-MSN2410/qos.json.j2 @@ -1,191 +1,10 @@ -{%- set PORT_ALL = [] %} +{%- set pfc_to_pg_map = true %} -{%- if PORT is not defined %} - {%- for port_idx in range(0,64) %} - {%- if PORT_ALL.append("Ethernet%d" % (port_idx)) %}{%- endif %} - {%- endfor %} -{%- else %} - {%- for port in PORT %} - {%- if PORT_ALL.append(port) %}{%- endif %} - {%- endfor %} -{%- endif %} +{%- macro generate_port_lists(PORT_ALL) %} + {# Generate list of ports #} + {% for port_idx in range(0, 64) %} + {% if PORT_ALL.append("Ethernet%d" % (port_idx)) %}{% endif %} + {% endfor %} +{%- endmacro %} -{%- set PORT_ACTIVE = [] %} -{%- if DEVICE_NEIGHBOR is not defined %} - {%- set PORT_ACTIVE = PORT_ALL %} -{%- else %} - {%- for port in DEVICE_NEIGHBOR.keys() %} - {%- if PORT_ACTIVE.append(port) %}{%- endif %} - {%- endfor %} -{%- endif %} - -{%- set port_names_list_active = [] %} -{%- for port in PORT_ACTIVE %} - {%- if port_names_list_active.append(port) %}{%- endif %} -{%- endfor %} -{%- set port_names_active = port_names_list_active | join(',') %} - -{ - "TC_TO_PRIORITY_GROUP_MAP": { - "AZURE": { - "0": "0", - "1": "1", - "3": "3", - "4": "4" - } - }, - "MAP_PFC_PRIORITY_TO_QUEUE": { - "AZURE": { - "0": "0", - "1": "1", - "3": "3", - "4": "4" - } - }, - "TC_TO_QUEUE_MAP": { - "AZURE": { - "0": "0", - "1": "1", - "3": "3", - "4": "4" - } - }, - "DSCP_TO_TC_MAP": { - "AZURE": { - "0":"0", - "1":"0", - "2":"0", - "3":"3", - "4":"4", - "5":"0", - "6":"0", - "7":"0", - "8":"1", - "9":"0", - "10":"0", - "11":"0", - "12":"0", - "13":"0", - "14":"0", - "15":"0", - "16":"0", - "17":"0", - "18":"0", - "19":"0", - "20":"0", - "21":"0", - "22":"0", - "23":"0", - "24":"0", - "25":"0", - "26":"0", - "27":"0", - "28":"0", - "29":"0", - "30":"0", - "31":"0", - "32":"0", - "33":"0", - "34":"0", - "35":"0", - "36":"0", - "37":"0", - "38":"0", - "39":"0", - "40":"0", - "41":"0", - "42":"0", - "43":"0", - "44":"0", - "45":"0", - "46":"0", - "47":"0", - "48":"0", - "49":"0", - "50":"0", - "51":"0", - "52":"0", - "53":"0", - "54":"0", - "55":"0", - "56":"0", - "57":"0", - "58":"0", - "59":"0", - "60":"0", - "61":"0", - "62":"0", - "63":"0" - } - }, - "SCHEDULER": { - "scheduler.0": { - "type":"DWRR", - "weight": "25" - }, - "scheduler.1": { - "type":"DWRR", - "weight": "30" - }, - "scheduler.2": { - "type":"DWRR", - "weight": "20" - } - }, - "PFC_PRIORITY_TO_PRIORITY_GROUP_MAP": { - "AZURE": { - "0": "0", - "1": "1", - "3": "3", - "4": "4" - } - }, - "PORT_QOS_MAP": { - "{{ port_names_active }}": { - "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", - "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", - "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", - "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_to_pg_map" : "[PFC_PRIORITY_TO_PRIORITY_GROUP_MAP|AZURE]", - "pfc_enable": "3,4" - } - }, - "WRED_PROFILE": { - "AZURE_LOSSY": { - "wred_green_enable":"true", - "wred_yellow_enable":"true", - "wred_red_enable":"true", - "ecn":"ecn_all", - "red_max_threshold":"516096", - "red_min_threshold":"516096", - "yellow_max_threshold":"516096", - "yellow_min_threshold":"516096", - "green_max_threshold": "184320", - "green_min_threshold": "184320" - }, - "AZURE_LOSSLESS": { - "wred_green_enable":"true", - "wred_yellow_enable":"true", - "wred_red_enable":"true", - "ecn":"ecn_all", - "red_max_threshold":"516096", - "red_min_threshold":"516096", - "yellow_max_threshold":"516096", - "yellow_min_threshold":"516096", - "green_max_threshold": "184320", - "green_min_threshold": "184320" - } - }, - "QUEUE": { - "{{ port_names_active }}|3-4" : { - "scheduler" : "[SCHEDULER|scheduler.0]", - "wred_profile" : "[WRED_PROFILE|AZURE_LOSSLESS]" - }, - "{{ port_names_active }}|0" : { - "scheduler" : "[SCHEDULER|scheduler.1]" - }, - "{{ port_names_active }}|1" : { - "scheduler" : "[SCHEDULER|scheduler.2]" - } - } -} +{%- include 'qos_config.j2' %} diff --git a/device/mellanox/x86_64-mlnx_msn2700-r0/ACS-MSN2700/qos.json.j2 b/device/mellanox/x86_64-mlnx_msn2700-r0/ACS-MSN2700/qos.json.j2 index a11c77f7cc24..a7662f215682 100644 --- a/device/mellanox/x86_64-mlnx_msn2700-r0/ACS-MSN2700/qos.json.j2 +++ b/device/mellanox/x86_64-mlnx_msn2700-r0/ACS-MSN2700/qos.json.j2 @@ -1,191 +1,10 @@ -{%- set PORT_ALL = [] %} +{%- set pfc_to_pg_map = true %} -{%- if PORT is not defined %} - {%- for port_idx in range(0,64) %} - {%- if PORT_ALL.append("Ethernet%d" % (port_idx)) %}{%- endif %} - {%- endfor %} -{%- else %} - {%- for port in PORT %} - {%- if PORT_ALL.append(port) %}{%- endif %} - {%- endfor %} -{%- endif %} +{%- macro generate_port_lists(PORT_ALL) %} + {# Generate list of ports #} + {% for port_idx in range(0, 64) %} + {% if PORT_ALL.append("Ethernet%d" % (port_idx)) %}{% endif %} + {% endfor %} +{%- endmacro %} -{%- set PORT_ACTIVE = [] %} -{%- if DEVICE_NEIGHBOR is not defined %} - {%- set PORT_ACTIVE = PORT_ALL %} -{%- else %} - {%- for port in DEVICE_NEIGHBOR.keys() %} - {%- if PORT_ACTIVE.append(port) %}{%- endif %} - {%- endfor %} -{%- endif %} - -{%- set port_names_list_active = [] %} -{%- for port in PORT_ACTIVE %} - {%- if port_names_list_active.append(port) %}{%- endif %} -{%- endfor %} -{%- set port_names_active = port_names_list_active | join(',') %} - -{ - "TC_TO_PRIORITY_GROUP_MAP": { - "AZURE": { - "0": "0", - "1": "1", - "3": "3", - "4": "4" - } - }, - "MAP_PFC_PRIORITY_TO_QUEUE": { - "AZURE": { - "0": "0", - "1": "1", - "3": "3", - "4": "4" - } - }, - "TC_TO_QUEUE_MAP": { - "AZURE": { - "0": "0", - "1": "1", - "3": "3", - "4": "4" - } - }, - "DSCP_TO_TC_MAP": { - "AZURE": { - "0":"0", - "1":"0", - "2":"0", - "3":"3", - "4":"4", - "5":"0", - "6":"0", - "7":"0", - "8":"1", - "9":"0", - "10":"0", - "11":"0", - "12":"0", - "13":"0", - "14":"0", - "15":"0", - "16":"0", - "17":"0", - "18":"0", - "19":"0", - "20":"0", - "21":"0", - "22":"0", - "23":"0", - "24":"0", - "25":"0", - "26":"0", - "27":"0", - "28":"0", - "29":"0", - "30":"0", - "31":"0", - "32":"0", - "33":"0", - "34":"0", - "35":"0", - "36":"0", - "37":"0", - "38":"0", - "39":"0", - "40":"0", - "41":"0", - "42":"0", - "43":"0", - "44":"0", - "45":"0", - "46":"0", - "47":"0", - "48":"0", - "49":"0", - "50":"0", - "51":"0", - "52":"0", - "53":"0", - "54":"0", - "55":"0", - "56":"0", - "57":"0", - "58":"0", - "59":"0", - "60":"0", - "61":"0", - "62":"0", - "63":"0" - } - }, - "SCHEDULER": { - "scheduler.0": { - "type":"DWRR", - "weight": "25" - }, - "scheduler.1": { - "type":"DWRR", - "weight": "30" - }, - "scheduler.2": { - "type":"DWRR", - "weight": "20" - } - }, - "PFC_PRIORITY_TO_PRIORITY_GROUP_MAP": { - "AZURE": { - "0": "0", - "1": "1", - "3": "3", - "4": "4" - } - }, - "PORT_QOS_MAP": { - "{{ port_names_active }}": { - "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", - "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", - "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", - "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_to_pg_map" : "[PFC_PRIORITY_TO_PRIORITY_GROUP_MAP|AZURE]", - "pfc_enable": "3,4" - } - }, - "WRED_PROFILE": { - "AZURE_LOSSY": { - "wred_green_enable":"true", - "wred_yellow_enable":"true", - "wred_red_enable":"true", - "ecn":"ecn_all", - "red_max_threshold":"516096", - "red_min_threshold":"516096", - "yellow_max_threshold":"516096", - "yellow_min_threshold":"516096", - "green_max_threshold": "184320", - "green_min_threshold": "184320" - }, - "AZURE_LOSSLESS": { - "wred_green_enable":"true", - "wred_yellow_enable":"true", - "wred_red_enable":"true", - "ecn":"ecn_all", - "red_max_threshold":"516096", - "red_min_threshold":"516096", - "yellow_max_threshold":"516096", - "yellow_min_threshold":"516096", - "green_max_threshold": "184320", - "green_min_threshold": "184320" - } - }, - "QUEUE": { - "{{ port_names_active }}|3-4" : { - "scheduler" : "[SCHEDULER|scheduler.0]", - "wred_profile" : "[WRED_PROFILE|AZURE_LOSSLESS]" - }, - "{{ port_names_active }}|0" : { - "scheduler" : "[SCHEDULER|scheduler.1]" - }, - "{{ port_names_active }}|1" : { - "scheduler" : "[SCHEDULER|scheduler.2]" - } - } -} +{%- include 'qos_config.j2' %} diff --git a/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D48C8/qos.json.j2 b/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D48C8/qos.json.j2 index a11c77f7cc24..a7662f215682 100644 --- a/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D48C8/qos.json.j2 +++ b/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D48C8/qos.json.j2 @@ -1,191 +1,10 @@ -{%- set PORT_ALL = [] %} +{%- set pfc_to_pg_map = true %} -{%- if PORT is not defined %} - {%- for port_idx in range(0,64) %} - {%- if PORT_ALL.append("Ethernet%d" % (port_idx)) %}{%- endif %} - {%- endfor %} -{%- else %} - {%- for port in PORT %} - {%- if PORT_ALL.append(port) %}{%- endif %} - {%- endfor %} -{%- endif %} +{%- macro generate_port_lists(PORT_ALL) %} + {# Generate list of ports #} + {% for port_idx in range(0, 64) %} + {% if PORT_ALL.append("Ethernet%d" % (port_idx)) %}{% endif %} + {% endfor %} +{%- endmacro %} -{%- set PORT_ACTIVE = [] %} -{%- if DEVICE_NEIGHBOR is not defined %} - {%- set PORT_ACTIVE = PORT_ALL %} -{%- else %} - {%- for port in DEVICE_NEIGHBOR.keys() %} - {%- if PORT_ACTIVE.append(port) %}{%- endif %} - {%- endfor %} -{%- endif %} - -{%- set port_names_list_active = [] %} -{%- for port in PORT_ACTIVE %} - {%- if port_names_list_active.append(port) %}{%- endif %} -{%- endfor %} -{%- set port_names_active = port_names_list_active | join(',') %} - -{ - "TC_TO_PRIORITY_GROUP_MAP": { - "AZURE": { - "0": "0", - "1": "1", - "3": "3", - "4": "4" - } - }, - "MAP_PFC_PRIORITY_TO_QUEUE": { - "AZURE": { - "0": "0", - "1": "1", - "3": "3", - "4": "4" - } - }, - "TC_TO_QUEUE_MAP": { - "AZURE": { - "0": "0", - "1": "1", - "3": "3", - "4": "4" - } - }, - "DSCP_TO_TC_MAP": { - "AZURE": { - "0":"0", - "1":"0", - "2":"0", - "3":"3", - "4":"4", - "5":"0", - "6":"0", - "7":"0", - "8":"1", - "9":"0", - "10":"0", - "11":"0", - "12":"0", - "13":"0", - "14":"0", - "15":"0", - "16":"0", - "17":"0", - "18":"0", - "19":"0", - "20":"0", - "21":"0", - "22":"0", - "23":"0", - "24":"0", - "25":"0", - "26":"0", - "27":"0", - "28":"0", - "29":"0", - "30":"0", - "31":"0", - "32":"0", - "33":"0", - "34":"0", - "35":"0", - "36":"0", - "37":"0", - "38":"0", - "39":"0", - "40":"0", - "41":"0", - "42":"0", - "43":"0", - "44":"0", - "45":"0", - "46":"0", - "47":"0", - "48":"0", - "49":"0", - "50":"0", - "51":"0", - "52":"0", - "53":"0", - "54":"0", - "55":"0", - "56":"0", - "57":"0", - "58":"0", - "59":"0", - "60":"0", - "61":"0", - "62":"0", - "63":"0" - } - }, - "SCHEDULER": { - "scheduler.0": { - "type":"DWRR", - "weight": "25" - }, - "scheduler.1": { - "type":"DWRR", - "weight": "30" - }, - "scheduler.2": { - "type":"DWRR", - "weight": "20" - } - }, - "PFC_PRIORITY_TO_PRIORITY_GROUP_MAP": { - "AZURE": { - "0": "0", - "1": "1", - "3": "3", - "4": "4" - } - }, - "PORT_QOS_MAP": { - "{{ port_names_active }}": { - "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", - "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", - "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", - "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_to_pg_map" : "[PFC_PRIORITY_TO_PRIORITY_GROUP_MAP|AZURE]", - "pfc_enable": "3,4" - } - }, - "WRED_PROFILE": { - "AZURE_LOSSY": { - "wred_green_enable":"true", - "wred_yellow_enable":"true", - "wred_red_enable":"true", - "ecn":"ecn_all", - "red_max_threshold":"516096", - "red_min_threshold":"516096", - "yellow_max_threshold":"516096", - "yellow_min_threshold":"516096", - "green_max_threshold": "184320", - "green_min_threshold": "184320" - }, - "AZURE_LOSSLESS": { - "wred_green_enable":"true", - "wred_yellow_enable":"true", - "wred_red_enable":"true", - "ecn":"ecn_all", - "red_max_threshold":"516096", - "red_min_threshold":"516096", - "yellow_max_threshold":"516096", - "yellow_min_threshold":"516096", - "green_max_threshold": "184320", - "green_min_threshold": "184320" - } - }, - "QUEUE": { - "{{ port_names_active }}|3-4" : { - "scheduler" : "[SCHEDULER|scheduler.0]", - "wred_profile" : "[WRED_PROFILE|AZURE_LOSSLESS]" - }, - "{{ port_names_active }}|0" : { - "scheduler" : "[SCHEDULER|scheduler.1]" - }, - "{{ port_names_active }}|1" : { - "scheduler" : "[SCHEDULER|scheduler.2]" - } - } -} +{%- include 'qos_config.j2' %} From 827b53df0462bd64f539cdc8d9cb10d045065142 Mon Sep 17 00:00:00 2001 From: Wenda Date: Thu, 6 Sep 2018 01:20:06 +0000 Subject: [PATCH 05/13] Change barefoot devices to use qos config template Signed-off-by: Wenda modified: barefoot/x86_64-accton_wedge100bf_32x-r0/montara/qos.json.j2 modified: barefoot/x86_64-accton_wedge100bf_65x-r0/mavericks/qos.json.j2 --- .../montara/qos.json.j2 | 171 +----------------- .../mavericks/qos.json.j2 | 171 +----------------- 2 files changed, 20 insertions(+), 322 deletions(-) diff --git a/device/barefoot/x86_64-accton_wedge100bf_32x-r0/montara/qos.json.j2 b/device/barefoot/x86_64-accton_wedge100bf_32x-r0/montara/qos.json.j2 index 7b8732e2e125..dbbb2b59c96e 100644 --- a/device/barefoot/x86_64-accton_wedge100bf_32x-r0/montara/qos.json.j2 +++ b/device/barefoot/x86_64-accton_wedge100bf_32x-r0/montara/qos.json.j2 @@ -1,161 +1,10 @@ -{ - "TC_TO_PRIORITY_GROUP_MAP": { - "AZURE": { - "3": "3", - "4": "4" - } - }, - "MAP_PFC_PRIORITY_TO_QUEUE": { - "AZURE": { - "0": "0", - "1": "1", - "3": "3", - "4": "4" - } - }, - "TC_TO_QUEUE_MAP": { - "AZURE": { - "0": "0", - "1": "1", - "3": "3", - "4": "4" - } - }, - "DSCP_TO_TC_MAP": { - "AZURE": { - "0":"0", - "1":"0", - "2":"0", - "3":"3", - "4":"4", - "5":"0", - "6":"0", - "7":"0", - "8":"1", - "9":"0", - "10":"0", - "11":"0", - "12":"0", - "13":"0", - "14":"0", - "15":"0", - "16":"0", - "17":"0", - "18":"0", - "19":"0", - "20":"0", - "21":"0", - "22":"0", - "23":"0", - "24":"0", - "25":"0", - "26":"0", - "27":"0", - "28":"0", - "29":"0", - "30":"0", - "31":"0", - "32":"0", - "33":"0", - "34":"0", - "35":"0", - "36":"0", - "37":"0", - "38":"0", - "39":"0", - "40":"0", - "41":"0", - "42":"0", - "43":"0", - "44":"0", - "45":"0", - "46":"0", - "47":"0", - "48":"0", - "49":"0", - "50":"0", - "51":"0", - "52":"0", - "53":"0", - "54":"0", - "55":"0", - "56":"0", - "57":"0", - "58":"0", - "59":"0", - "60":"0", - "61":"0", - "62":"0", - "63":"0" - } - }, - "SCHEDULER": { - "scheduler.0": { - "type":"DWRR", - "weight": "25" - }, - "scheduler.1": { - "type":"DWRR", - "weight": "30" - }, - "scheduler.2": { - "type":"DWRR", - "weight": "20" - } - }, - "PFC_PRIORITY_TO_PRIORITY_GROUP_MAP": { - "AZURE": { - "3": "3", - "4": "4" - } - }, - "PORT_QOS_MAP": { - "Ethernet0,Ethernet4,Ethernet8,Ethernet12,Ethernet16,Ethernet20,Ethernet24,Ethernet28,Ethernet32,Ethernet36,Ethernet40,Ethernet44,Ethernet48,Ethernet52,Ethernet56,Ethernet60,Ethernet64,Ethernet68,Ethernet72,Ethernet76,Ethernet80,Ethernet84,Ethernet88,Ethernet92,Ethernet96,Ethernet100,Ethernet104,Ethernet108,Ethernet112,Ethernet116,Ethernet120,Ethernet124": { - "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", - "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", - "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", - "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_to_pg_map" : "[PFC_PRIORITY_TO_PRIORITY_GROUP_MAP|AZURE]", - "pfc_enable": "3,4" - } - }, - "WRED_PROFILE": { - "AZURE_LOSSY": { - "wred_green_enable":"true", - "wred_yellow_enable":"true", - "ecn":"ecn_all", - "red_max_threshold":"516096", - "red_min_threshold":"516096", - "yellow_max_threshold":"516096", - "yellow_min_threshold":"516096", - "green_max_threshold": "184320", - "green_min_threshold": "184320" - }, - "AZURE_LOSSLESS": { - "wred_green_enable":"true", - "wred_yellow_enable":"true", - "ecn":"ecn_all", - "red_max_threshold":"516096", - "red_min_threshold":"516096", - "yellow_max_threshold":"516096", - "yellow_min_threshold":"516096", - "green_max_threshold": "184320", - "green_min_threshold": "184320" - } - }, - "QUEUE": { - "Ethernet0,Ethernet4,Ethernet8,Ethernet12,Ethernet16,Ethernet20,Ethernet24,Ethernet28,Ethernet32,Ethernet36,Ethernet40,Ethernet44,Ethernet48,Ethernet52,Ethernet56,Ethernet60,Ethernet64,Ethernet68,Ethernet72,Ethernet76,Ethernet80,Ethernet84,Ethernet88,Ethernet92,Ethernet96,Ethernet100,Ethernet104,Ethernet108,Ethernet112,Ethernet116,Ethernet120,Ethernet124|0": { - "scheduler" : "[SCHEDULER|scheduler.1]" - }, - "Ethernet0,Ethernet4,Ethernet8,Ethernet12,Ethernet16,Ethernet20,Ethernet24,Ethernet28,Ethernet32,Ethernet36,Ethernet40,Ethernet44,Ethernet48,Ethernet52,Ethernet56,Ethernet60,Ethernet64,Ethernet68,Ethernet72,Ethernet76,Ethernet80,Ethernet84,Ethernet88,Ethernet92,Ethernet96,Ethernet100,Ethernet104,Ethernet108,Ethernet112,Ethernet116,Ethernet120,Ethernet124|1": { - "scheduler" : "[SCHEDULER|scheduler.2]" - }, - "Ethernet0,Ethernet4,Ethernet8,Ethernet12,Ethernet16,Ethernet20,Ethernet24,Ethernet28,Ethernet32,Ethernet36,Ethernet40,Ethernet44,Ethernet48,Ethernet52,Ethernet56,Ethernet60,Ethernet64,Ethernet68,Ethernet72,Ethernet76,Ethernet80,Ethernet84,Ethernet88,Ethernet92,Ethernet96,Ethernet100,Ethernet104,Ethernet108,Ethernet112,Ethernet116,Ethernet120,Ethernet124|0-1": { - "wred_profile" : "[WRED_PROFILE|AZURE_LOSSY]" - }, - "Ethernet0,Ethernet4,Ethernet8,Ethernet12,Ethernet16,Ethernet20,Ethernet24,Ethernet28,Ethernet32,Ethernet36,Ethernet40,Ethernet44,Ethernet48,Ethernet52,Ethernet56,Ethernet60,Ethernet64,Ethernet68,Ethernet72,Ethernet76,Ethernet80,Ethernet84,Ethernet88,Ethernet92,Ethernet96,Ethernet100,Ethernet104,Ethernet108,Ethernet112,Ethernet116,Ethernet120,Ethernet124|3-4": { - "scheduler" : "[SCHEDULER|scheduler.0]", - "wred_profile" : "[WRED_PROFILE|AZURE_LOSSLESS]" - } - } -} +{%- set pfc_to_pg_map = true %} + +{%- macro generate_port_lists(PORT_ALL) %} + {# Generate list of ports #} + {% for port_idx in range(0, 32) %} + {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{% endif %} + {% endfor %} +{%- endmacro %} + +{%- include 'qos_config.j2' %} diff --git a/device/barefoot/x86_64-accton_wedge100bf_65x-r0/mavericks/qos.json.j2 b/device/barefoot/x86_64-accton_wedge100bf_65x-r0/mavericks/qos.json.j2 index 7b8732e2e125..dbbb2b59c96e 100644 --- a/device/barefoot/x86_64-accton_wedge100bf_65x-r0/mavericks/qos.json.j2 +++ b/device/barefoot/x86_64-accton_wedge100bf_65x-r0/mavericks/qos.json.j2 @@ -1,161 +1,10 @@ -{ - "TC_TO_PRIORITY_GROUP_MAP": { - "AZURE": { - "3": "3", - "4": "4" - } - }, - "MAP_PFC_PRIORITY_TO_QUEUE": { - "AZURE": { - "0": "0", - "1": "1", - "3": "3", - "4": "4" - } - }, - "TC_TO_QUEUE_MAP": { - "AZURE": { - "0": "0", - "1": "1", - "3": "3", - "4": "4" - } - }, - "DSCP_TO_TC_MAP": { - "AZURE": { - "0":"0", - "1":"0", - "2":"0", - "3":"3", - "4":"4", - "5":"0", - "6":"0", - "7":"0", - "8":"1", - "9":"0", - "10":"0", - "11":"0", - "12":"0", - "13":"0", - "14":"0", - "15":"0", - "16":"0", - "17":"0", - "18":"0", - "19":"0", - "20":"0", - "21":"0", - "22":"0", - "23":"0", - "24":"0", - "25":"0", - "26":"0", - "27":"0", - "28":"0", - "29":"0", - "30":"0", - "31":"0", - "32":"0", - "33":"0", - "34":"0", - "35":"0", - "36":"0", - "37":"0", - "38":"0", - "39":"0", - "40":"0", - "41":"0", - "42":"0", - "43":"0", - "44":"0", - "45":"0", - "46":"0", - "47":"0", - "48":"0", - "49":"0", - "50":"0", - "51":"0", - "52":"0", - "53":"0", - "54":"0", - "55":"0", - "56":"0", - "57":"0", - "58":"0", - "59":"0", - "60":"0", - "61":"0", - "62":"0", - "63":"0" - } - }, - "SCHEDULER": { - "scheduler.0": { - "type":"DWRR", - "weight": "25" - }, - "scheduler.1": { - "type":"DWRR", - "weight": "30" - }, - "scheduler.2": { - "type":"DWRR", - "weight": "20" - } - }, - "PFC_PRIORITY_TO_PRIORITY_GROUP_MAP": { - "AZURE": { - "3": "3", - "4": "4" - } - }, - "PORT_QOS_MAP": { - "Ethernet0,Ethernet4,Ethernet8,Ethernet12,Ethernet16,Ethernet20,Ethernet24,Ethernet28,Ethernet32,Ethernet36,Ethernet40,Ethernet44,Ethernet48,Ethernet52,Ethernet56,Ethernet60,Ethernet64,Ethernet68,Ethernet72,Ethernet76,Ethernet80,Ethernet84,Ethernet88,Ethernet92,Ethernet96,Ethernet100,Ethernet104,Ethernet108,Ethernet112,Ethernet116,Ethernet120,Ethernet124": { - "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", - "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", - "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", - "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_to_pg_map" : "[PFC_PRIORITY_TO_PRIORITY_GROUP_MAP|AZURE]", - "pfc_enable": "3,4" - } - }, - "WRED_PROFILE": { - "AZURE_LOSSY": { - "wred_green_enable":"true", - "wred_yellow_enable":"true", - "ecn":"ecn_all", - "red_max_threshold":"516096", - "red_min_threshold":"516096", - "yellow_max_threshold":"516096", - "yellow_min_threshold":"516096", - "green_max_threshold": "184320", - "green_min_threshold": "184320" - }, - "AZURE_LOSSLESS": { - "wred_green_enable":"true", - "wred_yellow_enable":"true", - "ecn":"ecn_all", - "red_max_threshold":"516096", - "red_min_threshold":"516096", - "yellow_max_threshold":"516096", - "yellow_min_threshold":"516096", - "green_max_threshold": "184320", - "green_min_threshold": "184320" - } - }, - "QUEUE": { - "Ethernet0,Ethernet4,Ethernet8,Ethernet12,Ethernet16,Ethernet20,Ethernet24,Ethernet28,Ethernet32,Ethernet36,Ethernet40,Ethernet44,Ethernet48,Ethernet52,Ethernet56,Ethernet60,Ethernet64,Ethernet68,Ethernet72,Ethernet76,Ethernet80,Ethernet84,Ethernet88,Ethernet92,Ethernet96,Ethernet100,Ethernet104,Ethernet108,Ethernet112,Ethernet116,Ethernet120,Ethernet124|0": { - "scheduler" : "[SCHEDULER|scheduler.1]" - }, - "Ethernet0,Ethernet4,Ethernet8,Ethernet12,Ethernet16,Ethernet20,Ethernet24,Ethernet28,Ethernet32,Ethernet36,Ethernet40,Ethernet44,Ethernet48,Ethernet52,Ethernet56,Ethernet60,Ethernet64,Ethernet68,Ethernet72,Ethernet76,Ethernet80,Ethernet84,Ethernet88,Ethernet92,Ethernet96,Ethernet100,Ethernet104,Ethernet108,Ethernet112,Ethernet116,Ethernet120,Ethernet124|1": { - "scheduler" : "[SCHEDULER|scheduler.2]" - }, - "Ethernet0,Ethernet4,Ethernet8,Ethernet12,Ethernet16,Ethernet20,Ethernet24,Ethernet28,Ethernet32,Ethernet36,Ethernet40,Ethernet44,Ethernet48,Ethernet52,Ethernet56,Ethernet60,Ethernet64,Ethernet68,Ethernet72,Ethernet76,Ethernet80,Ethernet84,Ethernet88,Ethernet92,Ethernet96,Ethernet100,Ethernet104,Ethernet108,Ethernet112,Ethernet116,Ethernet120,Ethernet124|0-1": { - "wred_profile" : "[WRED_PROFILE|AZURE_LOSSY]" - }, - "Ethernet0,Ethernet4,Ethernet8,Ethernet12,Ethernet16,Ethernet20,Ethernet24,Ethernet28,Ethernet32,Ethernet36,Ethernet40,Ethernet44,Ethernet48,Ethernet52,Ethernet56,Ethernet60,Ethernet64,Ethernet68,Ethernet72,Ethernet76,Ethernet80,Ethernet84,Ethernet88,Ethernet92,Ethernet96,Ethernet100,Ethernet104,Ethernet108,Ethernet112,Ethernet116,Ethernet120,Ethernet124|3-4": { - "scheduler" : "[SCHEDULER|scheduler.0]", - "wred_profile" : "[WRED_PROFILE|AZURE_LOSSLESS]" - } - } -} +{%- set pfc_to_pg_map = true %} + +{%- macro generate_port_lists(PORT_ALL) %} + {# Generate list of ports #} + {% for port_idx in range(0, 32) %} + {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{% endif %} + {% endfor %} +{%- endmacro %} + +{%- include 'qos_config.j2' %} From 393c396caddae0398f91da7deb9705c8e8ce408b Mon Sep 17 00:00:00 2001 From: Wenda Date: Thu, 6 Sep 2018 01:21:31 +0000 Subject: [PATCH 06/13] Change accton as7212 to use qos config template Signed-off-by: Wenda modified: accton/x86_64-accton_as7212_54x-r0/AS7212-54x/qos.json.j2 --- .../AS7212-54x/qos.json.j2 | 174 +----------------- 1 file changed, 9 insertions(+), 165 deletions(-) diff --git a/device/accton/x86_64-accton_as7212_54x-r0/AS7212-54x/qos.json.j2 b/device/accton/x86_64-accton_as7212_54x-r0/AS7212-54x/qos.json.j2 index 3e01af3f2c64..dbbb2b59c96e 100755 --- a/device/accton/x86_64-accton_as7212_54x-r0/AS7212-54x/qos.json.j2 +++ b/device/accton/x86_64-accton_as7212_54x-r0/AS7212-54x/qos.json.j2 @@ -1,166 +1,10 @@ -{ - "TC_TO_PRIORITY_GROUP_MAP": { - "AZURE": { - "0": "0", - "1": "1", - "3": "3", - "4": "4" - } - }, - "MAP_PFC_PRIORITY_TO_QUEUE": { - "AZURE": { - "0": "0", - "1": "1", - "3": "3", - "4": "4" - } - }, - "TC_TO_QUEUE_MAP": { - "AZURE": { - "0": "0", - "1": "1", - "3": "3", - "4": "4" - } - }, - "DSCP_TO_TC_MAP": { - "AZURE": { - "0":"0", - "1":"0", - "2":"0", - "3":"3", - "4":"4", - "5":"0", - "6":"0", - "7":"0", - "8":"1", - "9":"0", - "10":"0", - "11":"0", - "12":"0", - "13":"0", - "14":"0", - "15":"0", - "16":"0", - "17":"0", - "18":"0", - "19":"0", - "20":"0", - "21":"0", - "22":"0", - "23":"0", - "24":"0", - "25":"0", - "26":"0", - "27":"0", - "28":"0", - "29":"0", - "30":"0", - "31":"0", - "32":"0", - "33":"0", - "34":"0", - "35":"0", - "36":"0", - "37":"0", - "38":"0", - "39":"0", - "40":"0", - "41":"0", - "42":"0", - "43":"0", - "44":"0", - "45":"0", - "46":"0", - "47":"0", - "48":"0", - "49":"0", - "50":"0", - "51":"0", - "52":"0", - "53":"0", - "54":"0", - "55":"0", - "56":"0", - "57":"0", - "58":"0", - "59":"0", - "60":"0", - "61":"0", - "62":"0", - "63":"0" - } - }, - "SCHEDULER": { - "scheduler.0": { - "type":"DWRR", - "weight": "25" - }, - "scheduler.1": { - "type":"DWRR", - "weight": "30" - }, - "scheduler.2": { - "type":"DWRR", - "weight": "20" - } - }, - "PFC_PRIORITY_TO_PRIORITY_GROUP_MAP": { - "AZURE": { - "0": "0", - "1": "1", - "3": "3", - "4": "4" - } - }, - "PORT_QOS_MAP": { - "Ethernet0,Ethernet4,Ethernet8,Ethernet12,Ethernet16,Ethernet20,Ethernet24,Ethernet28,Ethernet32,Ethernet36,Ethernet40,Ethernet44,Ethernet48,Ethernet52,Ethernet56,Ethernet60,Ethernet64,Ethernet68,Ethernet72,Ethernet76,Ethernet80,Ethernet84,Ethernet88,Ethernet92,Ethernet96,Ethernet100,Ethernet104,Ethernet108,Ethernet112,Ethernet116,Ethernet120,Ethernet124": { - "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", - "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", - "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", - "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_to_pg_map" : "[PFC_PRIORITY_TO_PRIORITY_GROUP_MAP|AZURE]", - "pfc_enable": "3,4" - } - }, - "WRED_PROFILE": { - "AZURE_LOSSY": { - "wred_green_enable":"true", - "wred_yellow_enable":"true", - "ecn":"ecn_all", - "red_max_threshold":"516096", - "red_min_threshold":"516096", - "yellow_max_threshold":"516096", - "yellow_min_threshold":"516096", - "green_max_threshold": "184320", - "green_min_threshold": "184320" - }, - "AZURE_LOSSLESS": { - "wred_green_enable":"true", - "wred_yellow_enable":"true", - "ecn":"ecn_all", - "red_max_threshold":"516096", - "red_min_threshold":"516096", - "yellow_max_threshold":"516096", - "yellow_min_threshold":"516096", - "green_max_threshold": "184320", - "green_min_threshold": "184320" - } - }, - "QUEUE": { - "Ethernet0,Ethernet4,Ethernet8,Ethernet12,Ethernet16,Ethernet20,Ethernet24,Ethernet28,Ethernet32,Ethernet36,Ethernet40,Ethernet44,Ethernet48,Ethernet52,Ethernet56,Ethernet60,Ethernet64,Ethernet68,Ethernet72,Ethernet76,Ethernet80,Ethernet84,Ethernet88,Ethernet92,Ethernet96,Ethernet100,Ethernet104,Ethernet108,Ethernet112,Ethernet116,Ethernet120,Ethernet124|0": { - "scheduler" : "[SCHEDULER|scheduler.1]" - }, - "Ethernet0,Ethernet4,Ethernet8,Ethernet12,Ethernet16,Ethernet20,Ethernet24,Ethernet28,Ethernet32,Ethernet36,Ethernet40,Ethernet44,Ethernet48,Ethernet52,Ethernet56,Ethernet60,Ethernet64,Ethernet68,Ethernet72,Ethernet76,Ethernet80,Ethernet84,Ethernet88,Ethernet92,Ethernet96,Ethernet100,Ethernet104,Ethernet108,Ethernet112,Ethernet116,Ethernet120,Ethernet124|1": { - "scheduler" : "[SCHEDULER|scheduler.2]" - }, - "Ethernet0,Ethernet4,Ethernet8,Ethernet12,Ethernet16,Ethernet20,Ethernet24,Ethernet28,Ethernet32,Ethernet36,Ethernet40,Ethernet44,Ethernet48,Ethernet52,Ethernet56,Ethernet60,Ethernet64,Ethernet68,Ethernet72,Ethernet76,Ethernet80,Ethernet84,Ethernet88,Ethernet92,Ethernet96,Ethernet100,Ethernet104,Ethernet108,Ethernet112,Ethernet116,Ethernet120,Ethernet124|0-1": { - "wred_profile" : "[WRED_PROFILE|AZURE_LOSSY]" - }, - "Ethernet0,Ethernet4,Ethernet8,Ethernet12,Ethernet16,Ethernet20,Ethernet24,Ethernet28,Ethernet32,Ethernet36,Ethernet40,Ethernet44,Ethernet48,Ethernet52,Ethernet56,Ethernet60,Ethernet64,Ethernet68,Ethernet72,Ethernet76,Ethernet80,Ethernet84,Ethernet88,Ethernet92,Ethernet96,Ethernet100,Ethernet104,Ethernet108,Ethernet112,Ethernet116,Ethernet120,Ethernet124|3-4": { - "scheduler" : "[SCHEDULER|scheduler.0]", - "wred_profile" : "[WRED_PROFILE|AZURE_LOSSLESS]" - } - } -} +{%- set pfc_to_pg_map = true %} +{%- macro generate_port_lists(PORT_ALL) %} + {# Generate list of ports #} + {% for port_idx in range(0, 32) %} + {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{% endif %} + {% endfor %} +{%- endmacro %} + +{%- include 'qos_config.j2' %} From cae2712ee485011bde5c376b5d77d6667f9a0d1c Mon Sep 17 00:00:00 2001 From: Wenda Date: Thu, 6 Sep 2018 03:44:15 +0000 Subject: [PATCH 07/13] Apply PORT_QOS_MAP to active ports only Signed-off-by: Wenda --- 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 1e7792fe87ff..7e4734b324d2 100644 --- a/files/build_templates/qos_config.j2 +++ b/files/build_templates/qos_config.j2 @@ -163,7 +163,7 @@ }, {% endif %} "PORT_QOS_MAP": { - "{{ port_names_all }}": { + "{{ port_names_active }}": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", From b826770e35ba4d100f16430ad6114a8e855c88bf Mon Sep 17 00:00:00 2001 From: Wenda Date: Thu, 6 Sep 2018 03:57:42 +0000 Subject: [PATCH 08/13] Update qos config test with qos_config.j2 template Signed-off-by: Wenda --- src/sonic-config-engine/tests/test_j2files.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/sonic-config-engine/tests/test_j2files.py b/src/sonic-config-engine/tests/test_j2files.py index ce4b17500f8d..274ab6f68438 100644 --- a/src/sonic-config-engine/tests/test_j2files.py +++ b/src/sonic-config-engine/tests/test_j2files.py @@ -125,9 +125,18 @@ def test_qos_dell6100_render_template(self): dell_dir_path = os.path.join(self.test_dir, '..', '..', '..', 'device', 'dell', 'x86_64-dell_s6100_c2538-r0', 'Force10-S6100') qos_file = os.path.join(dell_dir_path, 'qos.json.j2') port_config_ini_file = os.path.join(dell_dir_path, 'port_config.ini') + + # copy qos_config.j2 to the Dell S6100 directory to have all templates in one directory + qos_config_file = os.path.join(self.test_dir, '..', '..', '..', 'files', 'build_templates', 'qos_config.j2') + shutil.copy2(qos_config_file, dell_dir_path) + argument = '-m ' + self.dell6100_t0_minigraph + ' -p ' + port_config_ini_file + ' -t ' + qos_file + ' > ' + self.output_file self.run_script(argument) + # cleanup + qos_config_file_new = os.path.join(dell_dir_path, 'qos_config.j2') + os.remove(qos_config_file_new) + sample_output_file = os.path.join(self.test_dir, 'sample_output', 'qos-dell6100.json') assert filecmp.cmp(sample_output_file, self.output_file) From 7cff8cea6b6c95e6aaae00928a48737730f7244c Mon Sep 17 00:00:00 2001 From: Wenda Date: Thu, 6 Sep 2018 04:01:02 +0000 Subject: [PATCH 09/13] Update sample output of qos-dell6100.json Signed-off-by: Wenda --- .../tests/sample_output/qos-dell6100.json | 695 +++++++++++++++--- 1 file changed, 606 insertions(+), 89 deletions(-) diff --git a/src/sonic-config-engine/tests/sample_output/qos-dell6100.json b/src/sonic-config-engine/tests/sample_output/qos-dell6100.json index 0db51148bdc5..b4a377ef9703 100644 --- a/src/sonic-config-engine/tests/sample_output/qos-dell6100.json +++ b/src/sonic-config-engine/tests/sample_output/qos-dell6100.json @@ -1,4 +1,3 @@ - { "TC_TO_PRIORITY_GROUP_MAP": { "AZURE": { @@ -38,83 +37,83 @@ }, "DSCP_TO_TC_MAP": { "AZURE": { - "0":"0", - "1":"0", - "2":"0", - "3":"3", - "4":"4", - "5":"0", - "6":"0", - "7":"0", - "8":"1", - "9":"0", - "10":"0", - "11":"0", - "12":"0", - "13":"0", - "14":"0", - "15":"0", - "16":"0", - "17":"0", - "18":"0", - "19":"0", - "20":"0", - "21":"0", - "22":"0", - "23":"0", - "24":"0", - "25":"0", - "26":"0", - "27":"0", - "28":"0", - "29":"0", - "30":"0", - "31":"0", - "32":"0", - "33":"0", - "34":"0", - "35":"0", - "36":"0", - "37":"0", - "38":"0", - "39":"0", - "40":"0", - "41":"0", - "42":"0", - "43":"0", - "44":"0", - "45":"0", - "46":"0", - "47":"0", - "48":"0", - "49":"0", - "50":"0", - "51":"0", - "52":"0", - "53":"0", - "54":"0", - "55":"0", - "56":"0", - "57":"0", - "58":"0", - "59":"0", - "60":"0", - "61":"0", - "62":"0", - "63":"0" + "0" : "0", + "1" : "0", + "2" : "0", + "3" : "3", + "4" : "4", + "5" : "0", + "6" : "0", + "7" : "0", + "8" : "1", + "9" : "0", + "10": "0", + "11": "0", + "12": "0", + "13": "0", + "14": "0", + "15": "0", + "16": "0", + "17": "0", + "18": "0", + "19": "0", + "20": "0", + "21": "0", + "22": "0", + "23": "0", + "24": "0", + "25": "0", + "26": "0", + "27": "0", + "28": "0", + "29": "0", + "30": "0", + "31": "0", + "32": "0", + "33": "0", + "34": "0", + "35": "0", + "36": "0", + "37": "0", + "38": "0", + "39": "0", + "40": "0", + "41": "0", + "42": "0", + "43": "0", + "44": "0", + "45": "0", + "46": "0", + "47": "0", + "48": "0", + "49": "0", + "50": "0", + "51": "0", + "52": "0", + "53": "0", + "54": "0", + "55": "0", + "56": "0", + "57": "0", + "58": "0", + "59": "0", + "60": "0", + "61": "0", + "62": "0", + "63": "0" } }, "SCHEDULER": { - "scheduler.0" : { - "type":"DWRR", + "scheduler.0": { + "type" : "DWRR", "weight": "25" }, - "scheduler.1" : { - "type":"DWRR", + "scheduler.1": { + "type" : "DWRR", "weight": "30" }, - "scheduler.2" : { - "type":"DWRR", + "scheduler.2": { + "type" : "DWRR", "weight": "20" } }, @@ -124,33 +123,551 @@ "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable": "3,4" + "pfc_enable" : "3,4" } }, "WRED_PROFILE": { "AZURE_LOSSLESS" : { - "wred_green_enable":"true", - "wred_yellow_enable":"true", - "wred_red_enable":"true", - "ecn":"ecn_all", - "red_max_threshold":"312000", - "red_min_threshold":"104000", - "yellow_max_threshold":"312000", - "yellow_min_threshold":"104000", - "green_max_threshold": "312000", - "green_min_threshold": "104000" + "wred_green_enable" : "true", + "wred_yellow_enable" : "true", + "wred_red_enable" : "true", + "ecn" : "ecn_all", + "green_max_threshold" : "312000", + "green_min_threshold" : "104000", + "yellow_max_threshold": "312000", + "yellow_min_threshold": "104000", + "red_max_threshold" : "312000", + "red_min_threshold" : "104000" } }, "QUEUE": { - "Ethernet0,Ethernet1,Ethernet4,Ethernet5,Ethernet6,Ethernet7,Ethernet8,Ethernet9,Ethernet10,Ethernet11,Ethernet12,Ethernet13,Ethernet14,Ethernet15,Ethernet16,Ethernet17,Ethernet20,Ethernet21,Ethernet22,Ethernet23,Ethernet24,Ethernet25,Ethernet26,Ethernet27,Ethernet28,Ethernet29,Ethernet30,Ethernet31,Ethernet32,Ethernet36,Ethernet37,Ethernet38,Ethernet39,Ethernet40,Ethernet41,Ethernet42,Ethernet48,Ethernet52,Ethernet53,Ethernet54,Ethernet55,Ethernet56,Ethernet57,Ethernet58|3-4" : { - "scheduler" : "[SCHEDULER|scheduler.0]", - "wred_profile" : "[WRED_PROFILE|AZURE_LOSSLESS]" + "Ethernet0|3": { + "scheduler": "[SCHEDULER|scheduler.0]" }, - "Ethernet0,Ethernet1,Ethernet4,Ethernet5,Ethernet6,Ethernet7,Ethernet8,Ethernet9,Ethernet10,Ethernet11,Ethernet12,Ethernet13,Ethernet14,Ethernet15,Ethernet16,Ethernet17,Ethernet20,Ethernet21,Ethernet22,Ethernet23,Ethernet24,Ethernet25,Ethernet26,Ethernet27,Ethernet28,Ethernet29,Ethernet30,Ethernet31,Ethernet32,Ethernet36,Ethernet37,Ethernet38,Ethernet39,Ethernet40,Ethernet41,Ethernet42,Ethernet48,Ethernet52,Ethernet53,Ethernet54,Ethernet55,Ethernet56,Ethernet57,Ethernet58|0" : { - "scheduler" : "[SCHEDULER|scheduler.1]" + "Ethernet1|3": { + "scheduler": "[SCHEDULER|scheduler.0]" }, - "Ethernet0,Ethernet1,Ethernet4,Ethernet5,Ethernet6,Ethernet7,Ethernet8,Ethernet9,Ethernet10,Ethernet11,Ethernet12,Ethernet13,Ethernet14,Ethernet15,Ethernet16,Ethernet17,Ethernet20,Ethernet21,Ethernet22,Ethernet23,Ethernet24,Ethernet25,Ethernet26,Ethernet27,Ethernet28,Ethernet29,Ethernet30,Ethernet31,Ethernet32,Ethernet36,Ethernet37,Ethernet38,Ethernet39,Ethernet40,Ethernet41,Ethernet42,Ethernet48,Ethernet52,Ethernet53,Ethernet54,Ethernet55,Ethernet56,Ethernet57,Ethernet58|1" : { - "scheduler" : "[SCHEDULER|scheduler.2]" + "Ethernet4|3": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet5|3": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet6|3": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet7|3": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet8|3": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet9|3": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet10|3": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet11|3": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet12|3": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet13|3": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet14|3": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet15|3": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet16|3": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet17|3": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet20|3": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet21|3": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet22|3": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet23|3": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet24|3": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet25|3": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet26|3": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet27|3": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet28|3": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet29|3": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet30|3": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet31|3": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet32|3": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet36|3": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet37|3": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet38|3": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet39|3": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet40|3": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet41|3": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet42|3": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet48|3": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet52|3": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet53|3": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet54|3": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet55|3": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet56|3": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet57|3": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet58|3": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet0|4": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet1|4": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet4|4": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet5|4": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet6|4": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet7|4": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet8|4": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet9|4": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet10|4": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet11|4": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet12|4": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet13|4": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet14|4": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet15|4": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet16|4": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet17|4": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet20|4": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet21|4": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet22|4": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet23|4": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet24|4": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet25|4": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet26|4": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet27|4": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet28|4": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet29|4": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet30|4": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet31|4": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet32|4": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet36|4": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet37|4": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet38|4": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet39|4": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet40|4": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet41|4": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet42|4": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet48|4": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet52|4": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet53|4": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet54|4": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet55|4": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet56|4": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet57|4": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet58|4": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet0|0": { + "scheduler": "[SCHEDULER|scheduler.1]" + }, + "Ethernet1|0": { + "scheduler": "[SCHEDULER|scheduler.1]" + }, + "Ethernet4|0": { + "scheduler": "[SCHEDULER|scheduler.1]" + }, + "Ethernet5|0": { + "scheduler": "[SCHEDULER|scheduler.1]" + }, + "Ethernet6|0": { + "scheduler": "[SCHEDULER|scheduler.1]" + }, + "Ethernet7|0": { + "scheduler": "[SCHEDULER|scheduler.1]" + }, + "Ethernet8|0": { + "scheduler": "[SCHEDULER|scheduler.1]" + }, + "Ethernet9|0": { + "scheduler": "[SCHEDULER|scheduler.1]" + }, + "Ethernet10|0": { + "scheduler": "[SCHEDULER|scheduler.1]" + }, + "Ethernet11|0": { + "scheduler": "[SCHEDULER|scheduler.1]" + }, + "Ethernet12|0": { + "scheduler": "[SCHEDULER|scheduler.1]" + }, + "Ethernet13|0": { + "scheduler": "[SCHEDULER|scheduler.1]" + }, + "Ethernet14|0": { + "scheduler": "[SCHEDULER|scheduler.1]" + }, + "Ethernet15|0": { + "scheduler": "[SCHEDULER|scheduler.1]" + }, + "Ethernet16|0": { + "scheduler": "[SCHEDULER|scheduler.1]" + }, + "Ethernet17|0": { + "scheduler": "[SCHEDULER|scheduler.1]" + }, + "Ethernet20|0": { + "scheduler": "[SCHEDULER|scheduler.1]" + }, + "Ethernet21|0": { + "scheduler": "[SCHEDULER|scheduler.1]" + }, + "Ethernet22|0": { + "scheduler": "[SCHEDULER|scheduler.1]" + }, + "Ethernet23|0": { + "scheduler": "[SCHEDULER|scheduler.1]" + }, + "Ethernet24|0": { + "scheduler": "[SCHEDULER|scheduler.1]" + }, + "Ethernet25|0": { + "scheduler": "[SCHEDULER|scheduler.1]" + }, + "Ethernet26|0": { + "scheduler": "[SCHEDULER|scheduler.1]" + }, + "Ethernet27|0": { + "scheduler": "[SCHEDULER|scheduler.1]" + }, + "Ethernet28|0": { + "scheduler": "[SCHEDULER|scheduler.1]" + }, + "Ethernet29|0": { + "scheduler": "[SCHEDULER|scheduler.1]" + }, + "Ethernet30|0": { + "scheduler": "[SCHEDULER|scheduler.1]" + }, + "Ethernet31|0": { + "scheduler": "[SCHEDULER|scheduler.1]" + }, + "Ethernet32|0": { + "scheduler": "[SCHEDULER|scheduler.1]" + }, + "Ethernet36|0": { + "scheduler": "[SCHEDULER|scheduler.1]" + }, + "Ethernet37|0": { + "scheduler": "[SCHEDULER|scheduler.1]" + }, + "Ethernet38|0": { + "scheduler": "[SCHEDULER|scheduler.1]" + }, + "Ethernet39|0": { + "scheduler": "[SCHEDULER|scheduler.1]" + }, + "Ethernet40|0": { + "scheduler": "[SCHEDULER|scheduler.1]" + }, + "Ethernet41|0": { + "scheduler": "[SCHEDULER|scheduler.1]" + }, + "Ethernet42|0": { + "scheduler": "[SCHEDULER|scheduler.1]" + }, + "Ethernet48|0": { + "scheduler": "[SCHEDULER|scheduler.1]" + }, + "Ethernet52|0": { + "scheduler": "[SCHEDULER|scheduler.1]" + }, + "Ethernet53|0": { + "scheduler": "[SCHEDULER|scheduler.1]" + }, + "Ethernet54|0": { + "scheduler": "[SCHEDULER|scheduler.1]" + }, + "Ethernet55|0": { + "scheduler": "[SCHEDULER|scheduler.1]" + }, + "Ethernet56|0": { + "scheduler": "[SCHEDULER|scheduler.1]" + }, + "Ethernet57|0": { + "scheduler": "[SCHEDULER|scheduler.1]" + }, + "Ethernet58|0": { + "scheduler": "[SCHEDULER|scheduler.1]" + }, + "Ethernet0|1": { + "scheduler": "[SCHEDULER|scheduler.2]" + }, + "Ethernet1|1": { + "scheduler": "[SCHEDULER|scheduler.2]" + }, + "Ethernet4|1": { + "scheduler": "[SCHEDULER|scheduler.2]" + }, + "Ethernet5|1": { + "scheduler": "[SCHEDULER|scheduler.2]" + }, + "Ethernet6|1": { + "scheduler": "[SCHEDULER|scheduler.2]" + }, + "Ethernet7|1": { + "scheduler": "[SCHEDULER|scheduler.2]" + }, + "Ethernet8|1": { + "scheduler": "[SCHEDULER|scheduler.2]" + }, + "Ethernet9|1": { + "scheduler": "[SCHEDULER|scheduler.2]" + }, + "Ethernet10|1": { + "scheduler": "[SCHEDULER|scheduler.2]" + }, + "Ethernet11|1": { + "scheduler": "[SCHEDULER|scheduler.2]" + }, + "Ethernet12|1": { + "scheduler": "[SCHEDULER|scheduler.2]" + }, + "Ethernet13|1": { + "scheduler": "[SCHEDULER|scheduler.2]" + }, + "Ethernet14|1": { + "scheduler": "[SCHEDULER|scheduler.2]" + }, + "Ethernet15|1": { + "scheduler": "[SCHEDULER|scheduler.2]" + }, + "Ethernet16|1": { + "scheduler": "[SCHEDULER|scheduler.2]" + }, + "Ethernet17|1": { + "scheduler": "[SCHEDULER|scheduler.2]" + }, + "Ethernet20|1": { + "scheduler": "[SCHEDULER|scheduler.2]" + }, + "Ethernet21|1": { + "scheduler": "[SCHEDULER|scheduler.2]" + }, + "Ethernet22|1": { + "scheduler": "[SCHEDULER|scheduler.2]" + }, + "Ethernet23|1": { + "scheduler": "[SCHEDULER|scheduler.2]" + }, + "Ethernet24|1": { + "scheduler": "[SCHEDULER|scheduler.2]" + }, + "Ethernet25|1": { + "scheduler": "[SCHEDULER|scheduler.2]" + }, + "Ethernet26|1": { + "scheduler": "[SCHEDULER|scheduler.2]" + }, + "Ethernet27|1": { + "scheduler": "[SCHEDULER|scheduler.2]" + }, + "Ethernet28|1": { + "scheduler": "[SCHEDULER|scheduler.2]" + }, + "Ethernet29|1": { + "scheduler": "[SCHEDULER|scheduler.2]" + }, + "Ethernet30|1": { + "scheduler": "[SCHEDULER|scheduler.2]" + }, + "Ethernet31|1": { + "scheduler": "[SCHEDULER|scheduler.2]" + }, + "Ethernet32|1": { + "scheduler": "[SCHEDULER|scheduler.2]" + }, + "Ethernet36|1": { + "scheduler": "[SCHEDULER|scheduler.2]" + }, + "Ethernet37|1": { + "scheduler": "[SCHEDULER|scheduler.2]" + }, + "Ethernet38|1": { + "scheduler": "[SCHEDULER|scheduler.2]" + }, + "Ethernet39|1": { + "scheduler": "[SCHEDULER|scheduler.2]" + }, + "Ethernet40|1": { + "scheduler": "[SCHEDULER|scheduler.2]" + }, + "Ethernet41|1": { + "scheduler": "[SCHEDULER|scheduler.2]" + }, + "Ethernet42|1": { + "scheduler": "[SCHEDULER|scheduler.2]" + }, + "Ethernet48|1": { + "scheduler": "[SCHEDULER|scheduler.2]" + }, + "Ethernet52|1": { + "scheduler": "[SCHEDULER|scheduler.2]" + }, + "Ethernet53|1": { + "scheduler": "[SCHEDULER|scheduler.2]" + }, + "Ethernet54|1": { + "scheduler": "[SCHEDULER|scheduler.2]" + }, + "Ethernet55|1": { + "scheduler": "[SCHEDULER|scheduler.2]" + }, + "Ethernet56|1": { + "scheduler": "[SCHEDULER|scheduler.2]" + }, + "Ethernet57|1": { + "scheduler": "[SCHEDULER|scheduler.2]" + }, + "Ethernet58|1": { + "scheduler": "[SCHEDULER|scheduler.2]" } } } From f6001b23db645994e7447d23ab74f8d7ce18466c Mon Sep 17 00:00:00 2001 From: Wenda Date: Sat, 8 Sep 2018 02:57:48 +0000 Subject: [PATCH 10/13] Remove generating the default port name and index list, i.e., remove the generate_port_lists macro, because PORT is always defined Signed-off-by: Wenda --- .../AS7212-54x/qos.json.j2 | 7 ------- .../Arista-7050-QX32/qos.json.j2 | 7 ------- .../Arista-7050-QX-32S/qos.json.j2 | 7 ------- .../Arista-7060CX-32S-C32/qos.json.j2 | 7 ------- .../Arista-7060CX-32S-D48C8/qos.json.j2 | 7 ------- .../Arista-7060CX-32S-Q32/qos.json.j2 | 7 ------- .../Arista-7260CX3-D108C8/qos.json.j2 | 7 ------- .../montara/qos.json.j2 | 7 ------- .../mavericks/qos.json.j2 | 7 ------- .../Force10-S6000/qos.json.j2 | 7 ------- .../Force10-S6100/qos.json.j2 | 7 ------- .../Force10-Z9100-T0/qos.json.j2 | 7 ------- .../Force10-Z9100/qos.json.j2 | 7 ------- .../x86_64-mlnx_msn2100-r0/ACS-MSN2100/qos.json.j2 | 7 ------- .../x86_64-mlnx_msn2410-r0/ACS-MSN2410/qos.json.j2 | 7 ------- .../x86_64-mlnx_msn2700-r0/ACS-MSN2700/qos.json.j2 | 7 ------- .../Mellanox-SN2700-D48C8/qos.json.j2 | 7 ------- files/build_templates/qos_config.j2 | 11 +++-------- 18 files changed, 3 insertions(+), 127 deletions(-) diff --git a/device/accton/x86_64-accton_as7212_54x-r0/AS7212-54x/qos.json.j2 b/device/accton/x86_64-accton_as7212_54x-r0/AS7212-54x/qos.json.j2 index dbbb2b59c96e..fc9e41ccdd2f 100755 --- a/device/accton/x86_64-accton_as7212_54x-r0/AS7212-54x/qos.json.j2 +++ b/device/accton/x86_64-accton_as7212_54x-r0/AS7212-54x/qos.json.j2 @@ -1,10 +1,3 @@ {%- set pfc_to_pg_map = true %} -{%- macro generate_port_lists(PORT_ALL) %} - {# Generate list of ports #} - {% for port_idx in range(0, 32) %} - {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{% endif %} - {% endfor %} -{%- endmacro %} - {%- include 'qos_config.j2' %} diff --git a/device/arista/x86_64-arista_7050_qx32/Arista-7050-QX32/qos.json.j2 b/device/arista/x86_64-arista_7050_qx32/Arista-7050-QX32/qos.json.j2 index 38ae7d9c881f..3e548325ea30 100644 --- a/device/arista/x86_64-arista_7050_qx32/Arista-7050-QX32/qos.json.j2 +++ b/device/arista/x86_64-arista_7050_qx32/Arista-7050-QX32/qos.json.j2 @@ -1,8 +1 @@ -{%- macro generate_port_lists(PORT_ALL) %} - {# Generate list of ports #} - {% for port_idx in range(0, 32) %} - {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{% endif %} - {% endfor %} -{%- endmacro %} - {%- include 'qos_config.j2' %} diff --git a/device/arista/x86_64-arista_7050_qx32s/Arista-7050-QX-32S/qos.json.j2 b/device/arista/x86_64-arista_7050_qx32s/Arista-7050-QX-32S/qos.json.j2 index 38ae7d9c881f..3e548325ea30 100644 --- a/device/arista/x86_64-arista_7050_qx32s/Arista-7050-QX-32S/qos.json.j2 +++ b/device/arista/x86_64-arista_7050_qx32s/Arista-7050-QX-32S/qos.json.j2 @@ -1,8 +1 @@ -{%- macro generate_port_lists(PORT_ALL) %} - {# Generate list of ports #} - {% for port_idx in range(0, 32) %} - {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{% endif %} - {% endfor %} -{%- endmacro %} - {%- include 'qos_config.j2' %} diff --git a/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-C32/qos.json.j2 b/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-C32/qos.json.j2 index 38ae7d9c881f..3e548325ea30 100644 --- a/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-C32/qos.json.j2 +++ b/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-C32/qos.json.j2 @@ -1,8 +1 @@ -{%- macro generate_port_lists(PORT_ALL) %} - {# Generate list of ports #} - {% for port_idx in range(0, 32) %} - {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{% endif %} - {% endfor %} -{%- endmacro %} - {%- include 'qos_config.j2' %} diff --git a/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-D48C8/qos.json.j2 b/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-D48C8/qos.json.j2 index 5ae2448a438f..3e548325ea30 100644 --- a/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-D48C8/qos.json.j2 +++ b/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-D48C8/qos.json.j2 @@ -1,8 +1 @@ -{%- macro generate_port_lists(PORT_ALL) %} - {# Generate list of ports #} - {% for port_idx in range(0, 128, 2) if port_idx not in [26, 30, 34, 38, 90, 94, 98, 102] %} - {% if PORT_ALL.append("Ethernet%d" % (port_idx)) %}{% endif %} - {% endfor %} -{%- endmacro %} - {%- include 'qos_config.j2' %} diff --git a/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-Q32/qos.json.j2 b/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-Q32/qos.json.j2 index 38ae7d9c881f..3e548325ea30 100644 --- a/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-Q32/qos.json.j2 +++ b/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-Q32/qos.json.j2 @@ -1,8 +1 @@ -{%- macro generate_port_lists(PORT_ALL) %} - {# Generate list of ports #} - {% for port_idx in range(0, 32) %} - {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{% endif %} - {% endfor %} -{%- endmacro %} - {%- include 'qos_config.j2' %} diff --git a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D108C8/qos.json.j2 b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D108C8/qos.json.j2 index 953e9b592b10..3e548325ea30 100644 --- a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D108C8/qos.json.j2 +++ b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D108C8/qos.json.j2 @@ -1,8 +1 @@ -{%- macro generate_port_lists(PORT_ALL) %} - {# Generate list of ports #} - {% for port_idx in range(0, 256, 2) if port_idx not in [50, 54, 58, 62, 66, 70, 74, 78] %} - {% if PORT_ALL.append("Ethernet%d" % (port_idx)) %}{% endif %} - {% endfor %} -{%- endmacro %} - {%- include 'qos_config.j2' %} diff --git a/device/barefoot/x86_64-accton_wedge100bf_32x-r0/montara/qos.json.j2 b/device/barefoot/x86_64-accton_wedge100bf_32x-r0/montara/qos.json.j2 index dbbb2b59c96e..fc9e41ccdd2f 100644 --- a/device/barefoot/x86_64-accton_wedge100bf_32x-r0/montara/qos.json.j2 +++ b/device/barefoot/x86_64-accton_wedge100bf_32x-r0/montara/qos.json.j2 @@ -1,10 +1,3 @@ {%- set pfc_to_pg_map = true %} -{%- macro generate_port_lists(PORT_ALL) %} - {# Generate list of ports #} - {% for port_idx in range(0, 32) %} - {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{% endif %} - {% endfor %} -{%- endmacro %} - {%- include 'qos_config.j2' %} diff --git a/device/barefoot/x86_64-accton_wedge100bf_65x-r0/mavericks/qos.json.j2 b/device/barefoot/x86_64-accton_wedge100bf_65x-r0/mavericks/qos.json.j2 index dbbb2b59c96e..fc9e41ccdd2f 100644 --- a/device/barefoot/x86_64-accton_wedge100bf_65x-r0/mavericks/qos.json.j2 +++ b/device/barefoot/x86_64-accton_wedge100bf_65x-r0/mavericks/qos.json.j2 @@ -1,10 +1,3 @@ {%- set pfc_to_pg_map = true %} -{%- macro generate_port_lists(PORT_ALL) %} - {# Generate list of ports #} - {% for port_idx in range(0, 32) %} - {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{% endif %} - {% endfor %} -{%- endmacro %} - {%- include 'qos_config.j2' %} diff --git a/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000/qos.json.j2 b/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000/qos.json.j2 index 38ae7d9c881f..3e548325ea30 100644 --- a/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000/qos.json.j2 +++ b/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000/qos.json.j2 @@ -1,8 +1 @@ -{%- macro generate_port_lists(PORT_ALL) %} - {# Generate list of ports #} - {% for port_idx in range(0, 32) %} - {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{% endif %} - {% endfor %} -{%- endmacro %} - {%- include 'qos_config.j2' %} diff --git a/device/dell/x86_64-dell_s6100_c2538-r0/Force10-S6100/qos.json.j2 b/device/dell/x86_64-dell_s6100_c2538-r0/Force10-S6100/qos.json.j2 index 23e42877b8ae..3e548325ea30 100644 --- a/device/dell/x86_64-dell_s6100_c2538-r0/Force10-S6100/qos.json.j2 +++ b/device/dell/x86_64-dell_s6100_c2538-r0/Force10-S6100/qos.json.j2 @@ -1,8 +1 @@ -{%- macro generate_port_lists(PORT_ALL) %} - {# Generate list of ports #} - {% for port_idx in range(0, 64) %} - {% if PORT_ALL.append("Ethernet%d" % (port_idx)) %}{% endif %} - {% endfor %} -{%- endmacro %} - {%- include 'qos_config.j2' %} diff --git a/device/dell/x86_64-dell_z9100_c2538-r0/Force10-Z9100-T0/qos.json.j2 b/device/dell/x86_64-dell_z9100_c2538-r0/Force10-Z9100-T0/qos.json.j2 index 24c8856d17c2..3e548325ea30 100644 --- a/device/dell/x86_64-dell_z9100_c2538-r0/Force10-Z9100-T0/qos.json.j2 +++ b/device/dell/x86_64-dell_z9100_c2538-r0/Force10-Z9100-T0/qos.json.j2 @@ -1,8 +1 @@ -{%- macro generate_port_lists(PORT_ALL) %} - {# Generate list of ports #} - {% for port_idx in range(0, 128, 2) if port_idx not in [26, 30, 34, 38, 106, 110, 114, 118] %} - {% if PORT_ALL.append("Ethernet%d" % (port_idx)) %}{% endif %} - {% endfor %} -{%- endmacro %} - {%- include 'qos_config.j2' %} diff --git a/device/dell/x86_64-dell_z9100_c2538-r0/Force10-Z9100/qos.json.j2 b/device/dell/x86_64-dell_z9100_c2538-r0/Force10-Z9100/qos.json.j2 index 38ae7d9c881f..3e548325ea30 100644 --- a/device/dell/x86_64-dell_z9100_c2538-r0/Force10-Z9100/qos.json.j2 +++ b/device/dell/x86_64-dell_z9100_c2538-r0/Force10-Z9100/qos.json.j2 @@ -1,8 +1 @@ -{%- macro generate_port_lists(PORT_ALL) %} - {# Generate list of ports #} - {% for port_idx in range(0, 32) %} - {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{% endif %} - {% endfor %} -{%- endmacro %} - {%- include 'qos_config.j2' %} diff --git a/device/mellanox/x86_64-mlnx_msn2100-r0/ACS-MSN2100/qos.json.j2 b/device/mellanox/x86_64-mlnx_msn2100-r0/ACS-MSN2100/qos.json.j2 index a7662f215682..fc9e41ccdd2f 100644 --- a/device/mellanox/x86_64-mlnx_msn2100-r0/ACS-MSN2100/qos.json.j2 +++ b/device/mellanox/x86_64-mlnx_msn2100-r0/ACS-MSN2100/qos.json.j2 @@ -1,10 +1,3 @@ {%- set pfc_to_pg_map = true %} -{%- macro generate_port_lists(PORT_ALL) %} - {# Generate list of ports #} - {% for port_idx in range(0, 64) %} - {% if PORT_ALL.append("Ethernet%d" % (port_idx)) %}{% endif %} - {% endfor %} -{%- endmacro %} - {%- include 'qos_config.j2' %} diff --git a/device/mellanox/x86_64-mlnx_msn2410-r0/ACS-MSN2410/qos.json.j2 b/device/mellanox/x86_64-mlnx_msn2410-r0/ACS-MSN2410/qos.json.j2 index a7662f215682..fc9e41ccdd2f 100644 --- a/device/mellanox/x86_64-mlnx_msn2410-r0/ACS-MSN2410/qos.json.j2 +++ b/device/mellanox/x86_64-mlnx_msn2410-r0/ACS-MSN2410/qos.json.j2 @@ -1,10 +1,3 @@ {%- set pfc_to_pg_map = true %} -{%- macro generate_port_lists(PORT_ALL) %} - {# Generate list of ports #} - {% for port_idx in range(0, 64) %} - {% if PORT_ALL.append("Ethernet%d" % (port_idx)) %}{% endif %} - {% endfor %} -{%- endmacro %} - {%- include 'qos_config.j2' %} diff --git a/device/mellanox/x86_64-mlnx_msn2700-r0/ACS-MSN2700/qos.json.j2 b/device/mellanox/x86_64-mlnx_msn2700-r0/ACS-MSN2700/qos.json.j2 index a7662f215682..fc9e41ccdd2f 100644 --- a/device/mellanox/x86_64-mlnx_msn2700-r0/ACS-MSN2700/qos.json.j2 +++ b/device/mellanox/x86_64-mlnx_msn2700-r0/ACS-MSN2700/qos.json.j2 @@ -1,10 +1,3 @@ {%- set pfc_to_pg_map = true %} -{%- macro generate_port_lists(PORT_ALL) %} - {# Generate list of ports #} - {% for port_idx in range(0, 64) %} - {% if PORT_ALL.append("Ethernet%d" % (port_idx)) %}{% endif %} - {% endfor %} -{%- endmacro %} - {%- include 'qos_config.j2' %} diff --git a/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D48C8/qos.json.j2 b/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D48C8/qos.json.j2 index a7662f215682..fc9e41ccdd2f 100644 --- a/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D48C8/qos.json.j2 +++ b/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D48C8/qos.json.j2 @@ -1,10 +1,3 @@ {%- set pfc_to_pg_map = true %} -{%- macro generate_port_lists(PORT_ALL) %} - {# Generate list of ports #} - {% for port_idx in range(0, 64) %} - {% if PORT_ALL.append("Ethernet%d" % (port_idx)) %}{% endif %} - {% endfor %} -{%- endmacro %} - {%- include 'qos_config.j2' %} diff --git a/files/build_templates/qos_config.j2 b/files/build_templates/qos_config.j2 index 7e4734b324d2..09dfa9ccb870 100644 --- a/files/build_templates/qos_config.j2 +++ b/files/build_templates/qos_config.j2 @@ -1,12 +1,7 @@ {%- set PORT_ALL = [] %} - -{%- if PORT is not defined %} - {%- if generate_port_lists(PORT_ALL) %}{% endif %} -{%- else %} - {%- for port in PORT %} - {%- if PORT_ALL.append(port) %}{% endif %} - {%- endfor %} -{%- endif %} +{%- for port in PORT %} + {%- if PORT_ALL.append(port) %}{% endif %} +{%- endfor %} {%- if PORT_ALL | sort_by_port_index %}{% endif %} {%- set port_names_list_all = [] %} From f99d9284a76d9ccf31cf9646865441d71a054311 Mon Sep 17 00:00:00 2001 From: Wenda Date: Mon, 10 Sep 2018 19:57:40 +0000 Subject: [PATCH 11/13] Include pfc_to_pg_map according to platform asic type obtained from /etc/sonic/sonic_version.yml rather than specifying per hwsku Signed-off-by: Wenda Ni --- .../x86_64-accton_as7212_54x-r0/AS7212-54x/qos.json.j2 | 2 -- .../x86_64-accton_wedge100bf_32x-r0/montara/qos.json.j2 | 2 -- .../x86_64-accton_wedge100bf_65x-r0/mavericks/qos.json.j2 | 2 -- .../x86_64-mlnx_msn2100-r0/ACS-MSN2100/qos.json.j2 | 2 -- .../x86_64-mlnx_msn2410-r0/ACS-MSN2410/qos.json.j2 | 2 -- .../x86_64-mlnx_msn2700-r0/ACS-MSN2700/qos.json.j2 | 2 -- .../Mellanox-SN2700-D48C8/qos.json.j2 | 2 -- files/build_templates/qos_config.j2 | 7 +++++-- 8 files changed, 5 insertions(+), 16 deletions(-) diff --git a/device/accton/x86_64-accton_as7212_54x-r0/AS7212-54x/qos.json.j2 b/device/accton/x86_64-accton_as7212_54x-r0/AS7212-54x/qos.json.j2 index fc9e41ccdd2f..3e548325ea30 100755 --- a/device/accton/x86_64-accton_as7212_54x-r0/AS7212-54x/qos.json.j2 +++ b/device/accton/x86_64-accton_as7212_54x-r0/AS7212-54x/qos.json.j2 @@ -1,3 +1 @@ -{%- set pfc_to_pg_map = true %} - {%- include 'qos_config.j2' %} diff --git a/device/barefoot/x86_64-accton_wedge100bf_32x-r0/montara/qos.json.j2 b/device/barefoot/x86_64-accton_wedge100bf_32x-r0/montara/qos.json.j2 index fc9e41ccdd2f..3e548325ea30 100644 --- a/device/barefoot/x86_64-accton_wedge100bf_32x-r0/montara/qos.json.j2 +++ b/device/barefoot/x86_64-accton_wedge100bf_32x-r0/montara/qos.json.j2 @@ -1,3 +1 @@ -{%- set pfc_to_pg_map = true %} - {%- include 'qos_config.j2' %} diff --git a/device/barefoot/x86_64-accton_wedge100bf_65x-r0/mavericks/qos.json.j2 b/device/barefoot/x86_64-accton_wedge100bf_65x-r0/mavericks/qos.json.j2 index fc9e41ccdd2f..3e548325ea30 100644 --- a/device/barefoot/x86_64-accton_wedge100bf_65x-r0/mavericks/qos.json.j2 +++ b/device/barefoot/x86_64-accton_wedge100bf_65x-r0/mavericks/qos.json.j2 @@ -1,3 +1 @@ -{%- set pfc_to_pg_map = true %} - {%- include 'qos_config.j2' %} diff --git a/device/mellanox/x86_64-mlnx_msn2100-r0/ACS-MSN2100/qos.json.j2 b/device/mellanox/x86_64-mlnx_msn2100-r0/ACS-MSN2100/qos.json.j2 index fc9e41ccdd2f..3e548325ea30 100644 --- a/device/mellanox/x86_64-mlnx_msn2100-r0/ACS-MSN2100/qos.json.j2 +++ b/device/mellanox/x86_64-mlnx_msn2100-r0/ACS-MSN2100/qos.json.j2 @@ -1,3 +1 @@ -{%- set pfc_to_pg_map = true %} - {%- include 'qos_config.j2' %} diff --git a/device/mellanox/x86_64-mlnx_msn2410-r0/ACS-MSN2410/qos.json.j2 b/device/mellanox/x86_64-mlnx_msn2410-r0/ACS-MSN2410/qos.json.j2 index fc9e41ccdd2f..3e548325ea30 100644 --- a/device/mellanox/x86_64-mlnx_msn2410-r0/ACS-MSN2410/qos.json.j2 +++ b/device/mellanox/x86_64-mlnx_msn2410-r0/ACS-MSN2410/qos.json.j2 @@ -1,3 +1 @@ -{%- set pfc_to_pg_map = true %} - {%- include 'qos_config.j2' %} diff --git a/device/mellanox/x86_64-mlnx_msn2700-r0/ACS-MSN2700/qos.json.j2 b/device/mellanox/x86_64-mlnx_msn2700-r0/ACS-MSN2700/qos.json.j2 index fc9e41ccdd2f..3e548325ea30 100644 --- a/device/mellanox/x86_64-mlnx_msn2700-r0/ACS-MSN2700/qos.json.j2 +++ b/device/mellanox/x86_64-mlnx_msn2700-r0/ACS-MSN2700/qos.json.j2 @@ -1,3 +1 @@ -{%- set pfc_to_pg_map = true %} - {%- include 'qos_config.j2' %} diff --git a/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D48C8/qos.json.j2 b/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D48C8/qos.json.j2 index fc9e41ccdd2f..3e548325ea30 100644 --- a/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D48C8/qos.json.j2 +++ b/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D48C8/qos.json.j2 @@ -1,3 +1 @@ -{%- set pfc_to_pg_map = true %} - {%- include 'qos_config.j2' %} diff --git a/files/build_templates/qos_config.j2 b/files/build_templates/qos_config.j2 index 09dfa9ccb870..17fe5db65ff0 100644 --- a/files/build_templates/qos_config.j2 +++ b/files/build_templates/qos_config.j2 @@ -28,6 +28,9 @@ {%- set port_names_active = port_names_list_active | join(',') -%} +{%- set pfc_to_pg_map_supported_asics = ['mellanox', 'barefoot', 'marvell'] -%} + + { "TC_TO_PRIORITY_GROUP_MAP": { "AZURE": { @@ -147,7 +150,7 @@ "weight": "20" } }, -{% if pfc_to_pg_map is defined and pfc_to_pg_map %} +{% if asic_type in pfc_to_pg_map_supported_asics %} "PFC_PRIORITY_TO_PRIORITY_GROUP_MAP": { "AZURE": { "0": "0", @@ -163,7 +166,7 @@ "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", -{% if pfc_to_pg_map is defined and pfc_to_pg_map %} +{% if asic_type in pfc_to_pg_map_supported_asics %} "pfc_to_pg_map" : "[PFC_PRIORITY_TO_PRIORITY_GROUP_MAP|AZURE]", {% endif %} "pfc_enable" : "3,4" From ca3573a1f4448f99a569678f5aceb29ed3493d39 Mon Sep 17 00:00:00 2001 From: Wenda Date: Tue, 11 Sep 2018 03:47:31 +0000 Subject: [PATCH 12/13] Customize TC_TO_PRIORITY_GROUP_MAP and PFC_PRIORITY_TO_PRIORITY_GROUP_MAP for barefoot Signed-off-by: Wenda --- .../montara/qos.json.j2 | 18 ++++++++++++++++++ .../mavericks/qos.json.j2 | 18 ++++++++++++++++++ files/build_templates/qos_config.j2 | 9 +++++++++ 3 files changed, 45 insertions(+) diff --git a/device/barefoot/x86_64-accton_wedge100bf_32x-r0/montara/qos.json.j2 b/device/barefoot/x86_64-accton_wedge100bf_32x-r0/montara/qos.json.j2 index 3e548325ea30..6529c0540d0a 100644 --- a/device/barefoot/x86_64-accton_wedge100bf_32x-r0/montara/qos.json.j2 +++ b/device/barefoot/x86_64-accton_wedge100bf_32x-r0/montara/qos.json.j2 @@ -1 +1,19 @@ +{%- macro generate_tc_to_pg_map() %} + "TC_TO_PRIORITY_GROUP_MAP": { + "AZURE": { + "3": "3", + "4": "4" + } + }, +{%- endmacro %} + +{%- macro generate_pfc_to_pg_map() %} + "PFC_PRIORITY_TO_PRIORITY_GROUP_MAP": { + "AZURE": { + "3": "3", + "4": "4" + } + }, +{%- endmacro %} + {%- include 'qos_config.j2' %} diff --git a/device/barefoot/x86_64-accton_wedge100bf_65x-r0/mavericks/qos.json.j2 b/device/barefoot/x86_64-accton_wedge100bf_65x-r0/mavericks/qos.json.j2 index 3e548325ea30..6529c0540d0a 100644 --- a/device/barefoot/x86_64-accton_wedge100bf_65x-r0/mavericks/qos.json.j2 +++ b/device/barefoot/x86_64-accton_wedge100bf_65x-r0/mavericks/qos.json.j2 @@ -1 +1,19 @@ +{%- macro generate_tc_to_pg_map() %} + "TC_TO_PRIORITY_GROUP_MAP": { + "AZURE": { + "3": "3", + "4": "4" + } + }, +{%- endmacro %} + +{%- macro generate_pfc_to_pg_map() %} + "PFC_PRIORITY_TO_PRIORITY_GROUP_MAP": { + "AZURE": { + "3": "3", + "4": "4" + } + }, +{%- endmacro %} + {%- include 'qos_config.j2' %} diff --git a/files/build_templates/qos_config.j2 b/files/build_templates/qos_config.j2 index 17fe5db65ff0..81c5fded9609 100644 --- a/files/build_templates/qos_config.j2 +++ b/files/build_templates/qos_config.j2 @@ -32,6 +32,9 @@ { +{% if generate_tc_to_pg_map is defined %} + {{- generate_tc_to_pg_map() }} +{% else %} "TC_TO_PRIORITY_GROUP_MAP": { "AZURE": { "0": "0", @@ -44,6 +47,7 @@ "7": "7" } }, +{% endif %} "MAP_PFC_PRIORITY_TO_QUEUE": { "AZURE": { "0": "0", @@ -151,6 +155,9 @@ } }, {% if asic_type in pfc_to_pg_map_supported_asics %} + {%- if generate_pfc_to_pg_map is defined %} + {{- generate_pfc_to_pg_map() }} + {%- else %} "PFC_PRIORITY_TO_PRIORITY_GROUP_MAP": { "AZURE": { "0": "0", @@ -159,6 +166,8 @@ "4": "4" } }, + {%- endif %} + {% endif %} "PORT_QOS_MAP": { "{{ port_names_active }}": { From 9455b0def607621c00107379c32b2c72f54ce89b Mon Sep 17 00:00:00 2001 From: Wenda Date: Fri, 21 Sep 2018 18:09:44 +0000 Subject: [PATCH 13/13] Unify PFC_PRIORITY_TO_PRIORITY_GROUP_MAP: remove "0":"0", "1":"1" as these two pgs do not generate PFC frames. Signed-off-by: Wenda --- .../x86_64-accton_wedge100bf_32x-r0/montara/qos.json.j2 | 9 --------- .../mavericks/qos.json.j2 | 9 --------- files/build_templates/qos_config.j2 | 7 ------- 3 files changed, 25 deletions(-) diff --git a/device/barefoot/x86_64-accton_wedge100bf_32x-r0/montara/qos.json.j2 b/device/barefoot/x86_64-accton_wedge100bf_32x-r0/montara/qos.json.j2 index 6529c0540d0a..a685277448f1 100644 --- a/device/barefoot/x86_64-accton_wedge100bf_32x-r0/montara/qos.json.j2 +++ b/device/barefoot/x86_64-accton_wedge100bf_32x-r0/montara/qos.json.j2 @@ -7,13 +7,4 @@ }, {%- endmacro %} -{%- macro generate_pfc_to_pg_map() %} - "PFC_PRIORITY_TO_PRIORITY_GROUP_MAP": { - "AZURE": { - "3": "3", - "4": "4" - } - }, -{%- endmacro %} - {%- include 'qos_config.j2' %} diff --git a/device/barefoot/x86_64-accton_wedge100bf_65x-r0/mavericks/qos.json.j2 b/device/barefoot/x86_64-accton_wedge100bf_65x-r0/mavericks/qos.json.j2 index 6529c0540d0a..a685277448f1 100644 --- a/device/barefoot/x86_64-accton_wedge100bf_65x-r0/mavericks/qos.json.j2 +++ b/device/barefoot/x86_64-accton_wedge100bf_65x-r0/mavericks/qos.json.j2 @@ -7,13 +7,4 @@ }, {%- endmacro %} -{%- macro generate_pfc_to_pg_map() %} - "PFC_PRIORITY_TO_PRIORITY_GROUP_MAP": { - "AZURE": { - "3": "3", - "4": "4" - } - }, -{%- endmacro %} - {%- include 'qos_config.j2' %} diff --git a/files/build_templates/qos_config.j2 b/files/build_templates/qos_config.j2 index 81c5fded9609..9a5c4826217c 100644 --- a/files/build_templates/qos_config.j2 +++ b/files/build_templates/qos_config.j2 @@ -155,19 +155,12 @@ } }, {% if asic_type in pfc_to_pg_map_supported_asics %} - {%- if generate_pfc_to_pg_map is defined %} - {{- generate_pfc_to_pg_map() }} - {%- else %} "PFC_PRIORITY_TO_PRIORITY_GROUP_MAP": { "AZURE": { - "0": "0", - "1": "1", "3": "3", "4": "4" } }, - {%- endif %} - {% endif %} "PORT_QOS_MAP": { "{{ port_names_active }}": {