Update qos template to support SYSTEM_DEFAULT table (#10936)

* Update qos template to support SYSTEM_DEFAULT table

Signed-off-by: bingwang <wang.bing@microsoft.com>
This commit is contained in:
bingwang-ms 2022-06-02 21:48:57 +08:00 committed by GitHub
parent 0552d6b172
commit 0c9bbee735
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
15 changed files with 13866 additions and 58 deletions

View File

@ -35,7 +35,7 @@
"30": "1", "30": "1",
"31": "1", "31": "1",
"32": "1", "32": "1",
"33": "2", "33": "8",
"34": "1", "34": "1",
"35": "1", "35": "1",
"36": "1", "36": "1",
@ -101,7 +101,7 @@
"30": "1", "30": "1",
"31": "1", "31": "1",
"32": "1", "32": "1",
"33": "2", "33": "8",
"34": "1", "34": "1",
"35": "1", "35": "1",
"36": "1", "36": "1",
@ -140,12 +140,13 @@
"AZURE": { "AZURE": {
"0": "0", "0": "0",
"1": "0", "1": "0",
"2": "0", "2": "2",
"3": "3", "3": "3",
"4": "4", "4": "4",
"5": "0", "5": "0",
"6": "0", "6": "6",
"7": "7" "7": "7",
"8": "0"
}, },
"AZURE_TUNNEL": { "AZURE_TUNNEL": {
"0": "0", "0": "0",
@ -155,7 +156,8 @@
"4": "6", "4": "6",
"5": "0", "5": "0",
"6": "0", "6": "0",
"7": "0" "7": "0",
"8": "0"
} }
}, },
{%- endmacro %} {%- endmacro %}
@ -169,7 +171,8 @@
"4": "4", "4": "4",
"5": "5", "5": "5",
"6": "6", "6": "6",
"7": "7" "7": "7",
"8": "1"
}, },
"AZURE_TUNNEL": { "AZURE_TUNNEL": {
"0": "0", "0": "0",
@ -179,7 +182,8 @@
"4": "6", "4": "6",
"5": "5", "5": "5",
"6": "1", "6": "1",
"7": "7" "7": "7",
"8": "1"
} }
}, },
{%- endmacro %} {%- endmacro %}
@ -188,15 +192,15 @@
"AZURE_TUNNEL": { "AZURE_TUNNEL": {
"0": "8", "0": "8",
"1": "0", "1": "0",
"2": "33", "2": "0",
"3": "2", "3": "2",
"4": "6", "4": "6",
"5": "46", "5": "46",
"6": "0", "6": "0",
"7": "48" "7": "48",
"8": "33"
} }
}, },
{%- endmacro %} {%- endmacro %}
{% endif %} {% endif %}
{%- include 'qos_config.j2' %} {%- include 'qos_config.j2' %}

View File

@ -120,7 +120,7 @@
"30": "1", "30": "1",
"31": "1", "31": "1",
"32": "1", "32": "1",
"33": "2", "33": "8",
"34": "1", "34": "1",
"35": "1", "35": "1",
"36": "1", "36": "1",
@ -186,7 +186,7 @@
"30": "1", "30": "1",
"31": "1", "31": "1",
"32": "1", "32": "1",
"33": "2", "33": "8",
"34": "1", "34": "1",
"35": "1", "35": "1",
"36": "1", "36": "1",
@ -225,12 +225,13 @@
"AZURE": { "AZURE": {
"0": "0", "0": "0",
"1": "0", "1": "0",
"2": "0", "2": "2",
"3": "3", "3": "3",
"4": "4", "4": "4",
"5": "0", "5": "0",
"6": "0", "6": "6",
"7": "7" "7": "7",
"8": "0"
}, },
"AZURE_TUNNEL": { "AZURE_TUNNEL": {
"0": "0", "0": "0",
@ -240,7 +241,8 @@
"4": "6", "4": "6",
"5": "0", "5": "0",
"6": "0", "6": "0",
"7": "0" "7": "0",
"8": "0"
} }
}, },
{%- endmacro %} {%- endmacro %}
@ -254,7 +256,8 @@
"4": "4", "4": "4",
"5": "5", "5": "5",
"6": "6", "6": "6",
"7": "7" "7": "7",
"8": "1"
}, },
"AZURE_TUNNEL": { "AZURE_TUNNEL": {
"0": "0", "0": "0",
@ -264,7 +267,8 @@
"4": "6", "4": "6",
"5": "5", "5": "5",
"6": "1", "6": "1",
"7": "7" "7": "7",
"8": "1"
} }
}, },
{%- endmacro %} {%- endmacro %}
@ -273,12 +277,13 @@
"AZURE_TUNNEL": { "AZURE_TUNNEL": {
"0": "8", "0": "8",
"1": "0", "1": "0",
"2": "33", "2": "0",
"3": "2", "3": "2",
"4": "6", "4": "6",
"5": "46", "5": "46",
"6": "0", "6": "0",
"7": "48" "7": "48",
"8": "33"
} }
}, },
{%- endmacro %} {%- endmacro %}

View File

@ -29,10 +29,16 @@
{%- endfor %} {%- endfor %}
{%- set port_names_active = port_names_list_active | join(',') -%} {%- set port_names_active = port_names_list_active | join(',') -%}
{%- set tunnel_qos_remap_enable = false %}
{%- if ((SYSTEM_DEFAULTS is defined) and ('tunnel_qos_remap' in SYSTEM_DEFAULTS) and (SYSTEM_DEFAULTS['tunnel_qos_remap']['status'] == 'enabled')) %}
{%- set tunnel_qos_remap_enable = true %}
{%- endif %}
{%- set port_names_list_extra_queues = [] %} {%- set port_names_list_extra_queues = [] %}
{%- for port in PORT_ACTIVE %} {%- for port in PORT_ACTIVE %}
{% if (generate_dscp_to_tc_map is defined) and ('type' in DEVICE_METADATA['localhost'] and DEVICE_METADATA['localhost']['type'] == 'LeafRouter' and DEVICE_NEIGHBOR_METADATA is defined and DEVICE_NEIGHBOR[port].name in DEVICE_NEIGHBOR_METADATA and DEVICE_NEIGHBOR_METADATA[DEVICE_NEIGHBOR[port].name].type == 'ToRRouter') or {% if ((generate_dscp_to_tc_map is defined) and tunnel_qos_remap_enable) and
('subtype' in DEVICE_METADATA['localhost'] and DEVICE_METADATA['localhost']['subtype'] == 'DualToR' and DEVICE_NEIGHBOR_METADATA is defined and DEVICE_NEIGHBOR[port].name in DEVICE_NEIGHBOR_METADATA and DEVICE_NEIGHBOR_METADATA[DEVICE_NEIGHBOR[port].name].type == 'LeafRouter') %} (('type' in DEVICE_METADATA['localhost'] and DEVICE_METADATA['localhost']['type'] == 'LeafRouter' and DEVICE_NEIGHBOR_METADATA is defined and DEVICE_NEIGHBOR[port].name in DEVICE_NEIGHBOR_METADATA and DEVICE_NEIGHBOR_METADATA[DEVICE_NEIGHBOR[port].name].type == 'ToRRouter') or
('subtype' in DEVICE_METADATA['localhost'] and DEVICE_METADATA['localhost']['subtype'] == 'DualToR' and DEVICE_NEIGHBOR_METADATA is defined and DEVICE_NEIGHBOR[port].name in DEVICE_NEIGHBOR_METADATA and DEVICE_NEIGHBOR_METADATA[DEVICE_NEIGHBOR[port].name].type == 'LeafRouter')) %}
{%- if port_names_list_extra_queues.append(port) %}{%- endif %} {%- if port_names_list_extra_queues.append(port) %}{%- endif %}
{% endif %} {% endif %}
{%- endfor %} {%- endfor %}
@ -43,7 +49,7 @@
{ {
{% if generate_tc_to_pg_map is defined %} {% if (generate_tc_to_pg_map is defined) and tunnel_qos_remap_enable %}
{{- generate_tc_to_pg_map() }} {{- generate_tc_to_pg_map() }}
{% else %} {% else %}
"TC_TO_PRIORITY_GROUP_MAP": { "TC_TO_PRIORITY_GROUP_MAP": {
@ -71,7 +77,7 @@
"7": "7" "7": "7"
} }
}, },
{% if generate_tc_to_queue_map is defined %} {% if (generate_tc_to_queue_map is defined) and tunnel_qos_remap_enable %}
{{- generate_tc_to_queue_map() }} {{- generate_tc_to_queue_map() }}
{% else %} {% else %}
"TC_TO_QUEUE_MAP": { "TC_TO_QUEUE_MAP": {
@ -100,7 +106,7 @@
"7": "7" "7": "7"
} }
}, },
{% elif generate_dscp_to_tc_map is defined %} {% elif (generate_dscp_to_tc_map is defined) and tunnel_qos_remap_enable %}
{{- generate_dscp_to_tc_map() }} {{- generate_dscp_to_tc_map() }}
{% else %} {% else %}
"DSCP_TO_TC_MAP": { "DSCP_TO_TC_MAP": {
@ -172,7 +178,7 @@
} }
}, },
{% endif %} {% endif %}
{% if generate_tc_to_dscp_map is defined %} {% if (generate_tc_to_dscp_map is defined) and tunnel_qos_remap_enable %}
{{- generate_tc_to_dscp_map() }} {{- generate_tc_to_dscp_map() }}
{% endif %} {% endif %}
{% if 'resource_type' in DEVICE_METADATA['localhost'] and DEVICE_METADATA['localhost']['resource_type'] in apollo_resource_types %} {% if 'resource_type' in DEVICE_METADATA['localhost'] and DEVICE_METADATA['localhost']['resource_type'] in apollo_resource_types %}

View File

@ -2339,6 +2339,14 @@
</Devices> </Devices>
<Properties xmlns:a="http://schemas.datacontract.org/2004/07/Microsoft.Search.Autopilot.Evolution"/> <Properties xmlns:a="http://schemas.datacontract.org/2004/07/Microsoft.Search.Autopilot.Evolution"/>
</MetadataDeclaration> </MetadataDeclaration>
<SystemDefaultsDeclaration>
<a:SystemDefaults xmlns:a="http://schemas.datacontract.org/2004/07/Microsoft.Search.Autopilot.Evolution">
<a:SystemDefault>
<a:Name>TunnelQosRemapEnabled</a:Name>
<a:Value>True</a:Value>
</a:SystemDefault>
</a:SystemDefaults>
</SystemDefaultsDeclaration>
<LinkMetadataDeclaration> <LinkMetadataDeclaration>
<Link xmlns:a="http://schemas.datacontract.org/2004/07/Microsoft.Search.Autopilot.Evolution"> <Link xmlns:a="http://schemas.datacontract.org/2004/07/Microsoft.Search.Autopilot.Evolution">
<a:LinkMetadata> <a:LinkMetadata>

View File

@ -4605,6 +4605,14 @@
</Devices> </Devices>
<Properties xmlns:a="http://schemas.datacontract.org/2004/07/Microsoft.Search.Autopilot.Evolution"/> <Properties xmlns:a="http://schemas.datacontract.org/2004/07/Microsoft.Search.Autopilot.Evolution"/>
</MetadataDeclaration> </MetadataDeclaration>
<SystemDefaultsDeclaration>
<a:SystemDefaults xmlns:a="http://schemas.datacontract.org/2004/07/Microsoft.Search.Autopilot.Evolution">
<a:SystemDefault>
<a:Name>TunnelQosRemapEnabled</a:Name>
<a:Value>True</a:Value>
</a:SystemDefault>
</a:SystemDefaults>
</SystemDefaultsDeclaration>
<LinkMetadataDeclaration> <LinkMetadataDeclaration>
<Link xmlns:a="http://schemas.datacontract.org/2004/07/Microsoft.Search.Autopilot.Evolution"> <Link xmlns:a="http://schemas.datacontract.org/2004/07/Microsoft.Search.Autopilot.Evolution">
<a:LinkMetadata> <a:LinkMetadata>

File diff suppressed because it is too large Load Diff

View File

@ -2486,6 +2486,14 @@
</Devices> </Devices>
<Properties xmlns:a="http://schemas.datacontract.org/2004/07/Microsoft.Search.Autopilot.Evolution"/> <Properties xmlns:a="http://schemas.datacontract.org/2004/07/Microsoft.Search.Autopilot.Evolution"/>
</MetadataDeclaration> </MetadataDeclaration>
<SystemDefaultsDeclaration>
<a:SystemDefaults xmlns:a="http://schemas.datacontract.org/2004/07/Microsoft.Search.Autopilot.Evolution">
<a:SystemDefault>
<a:Name>TunnelQosRemapEnabled</a:Name>
<a:Value>True</a:Value>
</a:SystemDefault>
</a:SystemDefaults>
</SystemDefaultsDeclaration>
<Hostname>str-7260cx3-acs-7</Hostname> <Hostname>str-7260cx3-acs-7</Hostname>
<HwSku>Arista-7260CX3-C64</HwSku> <HwSku>Arista-7260CX3-C64</HwSku>
</DeviceMiniGraph> </DeviceMiniGraph>

View File

@ -20,7 +20,8 @@
"4": "4", "4": "4",
"5": "5", "5": "5",
"6": "6", "6": "6",
"7": "7" "7": "7",
"8": "1"
}, },
"AZURE_TUNNEL": { "AZURE_TUNNEL": {
"0": "0", "0": "0",
@ -30,7 +31,8 @@
"4": "6", "4": "6",
"5": "5", "5": "5",
"6": "1", "6": "1",
"7": "7" "7": "7",
"8": "1"
} }
}, },
"DSCP_TO_TC_MAP": { "DSCP_TO_TC_MAP": {
@ -68,7 +70,7 @@
"30": "1", "30": "1",
"31": "1", "31": "1",
"32": "1", "32": "1",
"33": "2", "33": "8",
"34": "1", "34": "1",
"35": "1", "35": "1",
"36": "1", "36": "1",
@ -134,7 +136,7 @@
"30": "1", "30": "1",
"31": "1", "31": "1",
"32": "1", "32": "1",
"33": "2", "33": "8",
"34": "1", "34": "1",
"35": "1", "35": "1",
"36": "1", "36": "1",
@ -171,12 +173,13 @@
"AZURE": { "AZURE": {
"0": "0", "0": "0",
"1": "0", "1": "0",
"2": "0", "2": "2",
"3": "3", "3": "3",
"4": "4", "4": "4",
"5": "0", "5": "0",
"6": "0", "6": "6",
"7": "7" "7": "7",
"8": "0"
}, },
"AZURE_TUNNEL": { "AZURE_TUNNEL": {
"0": "0", "0": "0",
@ -186,19 +189,21 @@
"4": "6", "4": "6",
"5": "0", "5": "0",
"6": "0", "6": "0",
"7": "0" "7": "0",
"8": "0"
} }
}, },
"TC_TO_DSCP_MAP": { "TC_TO_DSCP_MAP": {
"AZURE_TUNNEL": { "AZURE_TUNNEL": {
"0": "8", "0": "8",
"1": "0", "1": "0",
"2": "33", "2": "0",
"3": "2", "3": "2",
"4": "6", "4": "6",
"5": "46", "5": "46",
"6": "0", "6": "0",
"7": "48" "7": "48",
"8": "33"
} }
}, },
"SCHEDULER": { "SCHEDULER": {

View File

@ -20,7 +20,8 @@
"4": "4", "4": "4",
"5": "5", "5": "5",
"6": "6", "6": "6",
"7": "7" "7": "7",
"8": "1"
}, },
"AZURE_TUNNEL": { "AZURE_TUNNEL": {
"0": "0", "0": "0",
@ -30,7 +31,8 @@
"4": "6", "4": "6",
"5": "5", "5": "5",
"6": "1", "6": "1",
"7": "7" "7": "7",
"8": "1"
} }
}, },
"DSCP_TO_TC_MAP": { "DSCP_TO_TC_MAP": {
@ -68,7 +70,7 @@
"30": "1", "30": "1",
"31": "1", "31": "1",
"32": "1", "32": "1",
"33": "2", "33": "8",
"34": "1", "34": "1",
"35": "1", "35": "1",
"36": "1", "36": "1",
@ -134,7 +136,7 @@
"30": "1", "30": "1",
"31": "1", "31": "1",
"32": "1", "32": "1",
"33": "2", "33": "8",
"34": "1", "34": "1",
"35": "1", "35": "1",
"36": "1", "36": "1",
@ -171,12 +173,13 @@
"AZURE": { "AZURE": {
"0": "0", "0": "0",
"1": "0", "1": "0",
"2": "0", "2": "2",
"3": "3", "3": "3",
"4": "4", "4": "4",
"5": "0", "5": "0",
"6": "0", "6": "6",
"7": "7" "7": "7",
"8": "0"
}, },
"AZURE_TUNNEL": { "AZURE_TUNNEL": {
"0": "0", "0": "0",
@ -186,19 +189,21 @@
"4": "6", "4": "6",
"5": "0", "5": "0",
"6": "0", "6": "0",
"7": "0" "7": "0",
"8": "0"
} }
}, },
"TC_TO_DSCP_MAP": { "TC_TO_DSCP_MAP": {
"AZURE_TUNNEL": { "AZURE_TUNNEL": {
"0": "8", "0": "8",
"1": "0", "1": "0",
"2": "33", "2": "0",
"3": "2", "3": "2",
"4": "6", "4": "6",
"5": "46", "5": "46",
"6": "0", "6": "0",
"7": "48" "7": "48",
"8": "33"
} }
}, },
"SCHEDULER": { "SCHEDULER": {

View File

@ -286,6 +286,9 @@ class TestJ2Files(TestCase):
return return
dir_paths = [ dir_paths = [
'../../../device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-D48C8',
'../../../device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D108C8',
'../../../device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-C64',
'../../../device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-D48C8', '../../../device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-D48C8',
'../../../device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D108C8', '../../../device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D108C8',
'../../../device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-C64' '../../../device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-C64'
@ -293,12 +296,18 @@ class TestJ2Files(TestCase):
sample_outputs = [ sample_outputs = [
'qos-arista7050cx3-dualtor.json', 'qos-arista7050cx3-dualtor.json',
'qos-arista7260-dualtor.json', 'qos-arista7260-dualtor.json',
'qos-arista7260-t1.json' 'qos-arista7260-t1.json',
'qos-arista7050cx3-dualtor-remap-disabled.json',
'qos-arista7260-dualtor-remap-disabled.json',
'qos-arista7260-t1-remap-disabled.json'
] ]
sample_minigraph_files = [ sample_minigraph_files = [
'sample-arista-7050cx3-dualtor-minigraph.xml', 'sample-arista-7050cx3-dualtor-minigraph.xml',
'sample-arista-7260-dualtor-minigraph.xml', 'sample-arista-7260-dualtor-minigraph.xml',
'sample-arista-7260-t1-minigraph.xml' 'sample-arista-7260-t1-minigraph.xml',
'sample-arista-7050cx3-dualtor-minigraph-remap-disabled.xml',
'sample-arista-7260-dualtor-minigraph-remap-disabled.xml',
'sample-arista-7260-t1-minigraph-remap-disabled.xml'
] ]
for i, path in enumerate(dir_paths): for i, path in enumerate(dir_paths):
device_template_path = os.path.join(self.test_dir, path) device_template_path = os.path.join(self.test_dir, path)