4f7a0b4705
Why I did it The PR is to apply separated DSCP_TO_TC_MAP and TC_TO_QUEUE_MAP to uplink ports on dualtor. The traffic with DSCP 2 and DSCP 6 from T1 is treated as lossless traffic. DSCP TC Queue 2 2 2 6 6 6 Traffic with DSCP 2 or DSCP 6 from downlink is still treated as lossy traffic as before. How I did it Define DSCP_TO_TC_MAP|AZURE_UPLINK and TC_TO_QUEUE_MAP|AZURE_UPLINK. How to verify it Verified by UT Verified by coping the new template to a testbed, and rendering a config_db.json
459 lines
10 KiB
Django/Jinja
459 lines
10 KiB
Django/Jinja
{% if ('type' in DEVICE_METADATA['localhost'] and DEVICE_METADATA['localhost']['type'] == 'LeafRouter') %}
|
|
{% set different_dscp_to_tc_map = true %}
|
|
{%- macro generate_dscp_to_tc_map() %}
|
|
"DSCP_TO_TC_MAP": {
|
|
"AZURE": {
|
|
"0" : "1",
|
|
"1" : "1",
|
|
"2" : "2",
|
|
"3" : "3",
|
|
"4" : "4",
|
|
"5" : "1",
|
|
"6" : "6",
|
|
"7" : "1",
|
|
"8" : "0",
|
|
"9" : "1",
|
|
"10": "1",
|
|
"11": "1",
|
|
"12": "1",
|
|
"13": "1",
|
|
"14": "1",
|
|
"15": "1",
|
|
"16": "1",
|
|
"17": "1",
|
|
"18": "1",
|
|
"19": "1",
|
|
"20": "1",
|
|
"21": "1",
|
|
"22": "1",
|
|
"23": "1",
|
|
"24": "1",
|
|
"25": "1",
|
|
"26": "1",
|
|
"27": "1",
|
|
"28": "1",
|
|
"29": "1",
|
|
"30": "1",
|
|
"31": "1",
|
|
"32": "1",
|
|
"33": "1",
|
|
"34": "1",
|
|
"35": "1",
|
|
"36": "1",
|
|
"37": "1",
|
|
"38": "1",
|
|
"39": "1",
|
|
"40": "1",
|
|
"41": "1",
|
|
"42": "1",
|
|
"43": "1",
|
|
"44": "1",
|
|
"45": "1",
|
|
"46": "5",
|
|
"47": "1",
|
|
"48": "7",
|
|
"49": "1",
|
|
"50": "1",
|
|
"51": "1",
|
|
"52": "1",
|
|
"53": "1",
|
|
"54": "1",
|
|
"55": "1",
|
|
"56": "1",
|
|
"57": "1",
|
|
"58": "1",
|
|
"59": "1",
|
|
"60": "1",
|
|
"61": "1",
|
|
"62": "1",
|
|
"63": "1"
|
|
},
|
|
"AZURE_UPLINK": {
|
|
"0" : "1",
|
|
"1" : "1",
|
|
"2" : "1",
|
|
"3" : "3",
|
|
"4" : "4",
|
|
"5" : "1",
|
|
"6" : "1",
|
|
"7" : "1",
|
|
"8" : "0",
|
|
"9" : "1",
|
|
"10": "1",
|
|
"11": "1",
|
|
"12": "1",
|
|
"13": "1",
|
|
"14": "1",
|
|
"15": "1",
|
|
"16": "1",
|
|
"17": "1",
|
|
"18": "1",
|
|
"19": "1",
|
|
"20": "1",
|
|
"21": "1",
|
|
"22": "1",
|
|
"23": "1",
|
|
"24": "1",
|
|
"25": "1",
|
|
"26": "1",
|
|
"27": "1",
|
|
"28": "1",
|
|
"29": "1",
|
|
"30": "1",
|
|
"31": "1",
|
|
"32": "1",
|
|
"33": "1",
|
|
"34": "1",
|
|
"35": "1",
|
|
"36": "1",
|
|
"37": "1",
|
|
"38": "1",
|
|
"39": "1",
|
|
"40": "1",
|
|
"41": "1",
|
|
"42": "1",
|
|
"43": "1",
|
|
"44": "1",
|
|
"45": "1",
|
|
"46": "5",
|
|
"47": "1",
|
|
"48": "7",
|
|
"49": "1",
|
|
"50": "1",
|
|
"51": "1",
|
|
"52": "1",
|
|
"53": "1",
|
|
"54": "1",
|
|
"55": "1",
|
|
"56": "1",
|
|
"57": "1",
|
|
"58": "1",
|
|
"59": "1",
|
|
"60": "1",
|
|
"61": "1",
|
|
"62": "1",
|
|
"63": "1"
|
|
}
|
|
},
|
|
{%- endmacro %}
|
|
{%- macro generate_tc_to_pg_map() %}
|
|
"TC_TO_PRIORITY_GROUP_MAP": {
|
|
"AZURE": {
|
|
"0": "0",
|
|
"1": "0",
|
|
"2": "2",
|
|
"3": "3",
|
|
"4": "4",
|
|
"5": "0",
|
|
"6": "6",
|
|
"7": "0"
|
|
}
|
|
},
|
|
{%- endmacro %}
|
|
{% elif ('subtype' in DEVICE_METADATA['localhost'] and DEVICE_METADATA['localhost']['subtype'] == 'DualToR') %}
|
|
{% set different_dscp_to_tc_map = true %}
|
|
{% set different_tc_to_queue_map = true %}
|
|
{%- macro generate_dscp_to_tc_map() %}
|
|
"DSCP_TO_TC_MAP": {
|
|
"AZURE": {
|
|
"0" : "1",
|
|
"1" : "1",
|
|
"2" : "1",
|
|
"3" : "3",
|
|
"4" : "4",
|
|
"5" : "1",
|
|
"6" : "1",
|
|
"7" : "1",
|
|
"8" : "0",
|
|
"9" : "1",
|
|
"10": "1",
|
|
"11": "1",
|
|
"12": "1",
|
|
"13": "1",
|
|
"14": "1",
|
|
"15": "1",
|
|
"16": "1",
|
|
"17": "1",
|
|
"18": "1",
|
|
"19": "1",
|
|
"20": "1",
|
|
"21": "1",
|
|
"22": "1",
|
|
"23": "1",
|
|
"24": "1",
|
|
"25": "1",
|
|
"26": "1",
|
|
"27": "1",
|
|
"28": "1",
|
|
"29": "1",
|
|
"30": "1",
|
|
"31": "1",
|
|
"32": "1",
|
|
"33": "8",
|
|
"34": "1",
|
|
"35": "1",
|
|
"36": "1",
|
|
"37": "1",
|
|
"38": "1",
|
|
"39": "1",
|
|
"40": "1",
|
|
"41": "1",
|
|
"42": "1",
|
|
"43": "1",
|
|
"44": "1",
|
|
"45": "1",
|
|
"46": "5",
|
|
"47": "1",
|
|
"48": "7",
|
|
"49": "1",
|
|
"50": "1",
|
|
"51": "1",
|
|
"52": "1",
|
|
"53": "1",
|
|
"54": "1",
|
|
"55": "1",
|
|
"56": "1",
|
|
"57": "1",
|
|
"58": "1",
|
|
"59": "1",
|
|
"60": "1",
|
|
"61": "1",
|
|
"62": "1",
|
|
"63": "1"
|
|
},
|
|
"AZURE_UPLINK": {
|
|
"0" : "1",
|
|
"1" : "1",
|
|
"2" : "2",
|
|
"3" : "3",
|
|
"4" : "4",
|
|
"5" : "1",
|
|
"6" : "6",
|
|
"7" : "1",
|
|
"8" : "0",
|
|
"9" : "1",
|
|
"10": "1",
|
|
"11": "1",
|
|
"12": "1",
|
|
"13": "1",
|
|
"14": "1",
|
|
"15": "1",
|
|
"16": "1",
|
|
"17": "1",
|
|
"18": "1",
|
|
"19": "1",
|
|
"20": "1",
|
|
"21": "1",
|
|
"22": "1",
|
|
"23": "1",
|
|
"24": "1",
|
|
"25": "1",
|
|
"26": "1",
|
|
"27": "1",
|
|
"28": "1",
|
|
"29": "1",
|
|
"30": "1",
|
|
"31": "1",
|
|
"32": "1",
|
|
"33": "8",
|
|
"34": "1",
|
|
"35": "1",
|
|
"36": "1",
|
|
"37": "1",
|
|
"38": "1",
|
|
"39": "1",
|
|
"40": "1",
|
|
"41": "1",
|
|
"42": "1",
|
|
"43": "1",
|
|
"44": "1",
|
|
"45": "1",
|
|
"46": "5",
|
|
"47": "1",
|
|
"48": "7",
|
|
"49": "1",
|
|
"50": "1",
|
|
"51": "1",
|
|
"52": "1",
|
|
"53": "1",
|
|
"54": "1",
|
|
"55": "1",
|
|
"56": "1",
|
|
"57": "1",
|
|
"58": "1",
|
|
"59": "1",
|
|
"60": "1",
|
|
"61": "1",
|
|
"62": "1",
|
|
"63": "1"
|
|
},
|
|
"AZURE_TUNNEL": {
|
|
"0" : "1",
|
|
"1" : "1",
|
|
"2" : "1",
|
|
"3" : "3",
|
|
"4" : "4",
|
|
"5" : "1",
|
|
"6" : "1",
|
|
"7" : "1",
|
|
"8" : "0",
|
|
"9" : "1",
|
|
"10": "1",
|
|
"11": "1",
|
|
"12": "1",
|
|
"13": "1",
|
|
"14": "1",
|
|
"15": "1",
|
|
"16": "1",
|
|
"17": "1",
|
|
"18": "1",
|
|
"19": "1",
|
|
"20": "1",
|
|
"21": "1",
|
|
"22": "1",
|
|
"23": "1",
|
|
"24": "1",
|
|
"25": "1",
|
|
"26": "1",
|
|
"27": "1",
|
|
"28": "1",
|
|
"29": "1",
|
|
"30": "1",
|
|
"31": "1",
|
|
"32": "1",
|
|
"33": "8",
|
|
"34": "1",
|
|
"35": "1",
|
|
"36": "1",
|
|
"37": "1",
|
|
"38": "1",
|
|
"39": "1",
|
|
"40": "1",
|
|
"41": "1",
|
|
"42": "1",
|
|
"43": "1",
|
|
"44": "1",
|
|
"45": "1",
|
|
"46": "5",
|
|
"47": "1",
|
|
"48": "7",
|
|
"49": "1",
|
|
"50": "1",
|
|
"51": "1",
|
|
"52": "1",
|
|
"53": "1",
|
|
"54": "1",
|
|
"55": "1",
|
|
"56": "1",
|
|
"57": "1",
|
|
"58": "1",
|
|
"59": "1",
|
|
"60": "1",
|
|
"61": "1",
|
|
"62": "1",
|
|
"63": "1"
|
|
}
|
|
},
|
|
{%- endmacro %}
|
|
{%- macro generate_tc_to_pg_map() %}
|
|
"TC_TO_PRIORITY_GROUP_MAP": {
|
|
"AZURE": {
|
|
"0": "0",
|
|
"1": "0",
|
|
"2": "2",
|
|
"3": "3",
|
|
"4": "4",
|
|
"5": "0",
|
|
"6": "6",
|
|
"7": "0",
|
|
"8": "0"
|
|
},
|
|
"AZURE_TUNNEL": {
|
|
"0": "0",
|
|
"1": "0",
|
|
"2": "0",
|
|
"3": "2",
|
|
"4": "6",
|
|
"5": "0",
|
|
"6": "0",
|
|
"7": "0",
|
|
"8": "0"
|
|
}
|
|
},
|
|
{%- endmacro %}
|
|
{%- macro generate_tc_to_queue_map() %}
|
|
"TC_TO_QUEUE_MAP": {
|
|
"AZURE": {
|
|
"0": "0",
|
|
"1": "1",
|
|
"2": "1",
|
|
"3": "3",
|
|
"4": "4",
|
|
"5": "5",
|
|
"6": "1",
|
|
"7": "7",
|
|
"8": "1"
|
|
},
|
|
"AZURE_UPLINK": {
|
|
"0": "0",
|
|
"1": "1",
|
|
"2": "2",
|
|
"3": "3",
|
|
"4": "4",
|
|
"5": "5",
|
|
"6": "6",
|
|
"7": "7",
|
|
"8": "1"
|
|
},
|
|
"AZURE_TUNNEL": {
|
|
"0": "0",
|
|
"1": "1",
|
|
"2": "1",
|
|
"3": "2",
|
|
"4": "6",
|
|
"5": "5",
|
|
"6": "1",
|
|
"7": "7",
|
|
"8": "1"
|
|
}
|
|
},
|
|
{%- endmacro %}
|
|
{%- macro generate_tc_to_dscp_map() %}
|
|
"TC_TO_DSCP_MAP": {
|
|
"AZURE_TUNNEL": {
|
|
"0": "8",
|
|
"1": "0",
|
|
"2": "0",
|
|
"3": "2",
|
|
"4": "6",
|
|
"5": "46",
|
|
"6": "0",
|
|
"7": "48",
|
|
"8": "33"
|
|
}
|
|
},
|
|
{%- endmacro %}
|
|
{% endif %}
|
|
|
|
{%- macro generate_wred_profiles() %}
|
|
"WRED_PROFILE": {
|
|
"AZURE_LOSSLESS" : {
|
|
"wred_green_enable" : "true",
|
|
"wred_yellow_enable" : "true",
|
|
"wred_red_enable" : "true",
|
|
"ecn" : "ecn_all",
|
|
"green_max_threshold" : "10000000",
|
|
"green_min_threshold" : "2000000",
|
|
"yellow_max_threshold" : "2097152",
|
|
"yellow_min_threshold" : "1048576",
|
|
"red_max_threshold" : "2097152",
|
|
"red_min_threshold" : "1048576",
|
|
"green_drop_probability" : "5",
|
|
"yellow_drop_probability": "5",
|
|
"red_drop_probability" : "5"
|
|
}
|
|
},
|
|
{%- endmacro %}
|
|
|
|
{%- include 'qos_config.j2' %}
|