Skip to content

Commit

Permalink
Address comments
Browse files Browse the repository at this point in the history
Signed-off-by: bingwang <bingwang@microsoft.com>
  • Loading branch information
bingwang-ms committed Mar 9, 2022
1 parent 0d37da4 commit 6565c2e
Show file tree
Hide file tree
Showing 16 changed files with 14,136 additions and 188 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
{%- macro clear_q_for_pcbb() %}
{% if 'subtype' in DEVICE_METADATA['localhost'] and DEVICE_METADATA['localhost']['subtype'] == 'DualToR' %}
{%- macro generate_dscp_to_tc_map() %}
"DSCP_TO_TC_MAP": {
"AZURE": {
"0" : "1",
"1" : "1",
"2" : "1",
"2" : "2",
"3" : "3",
"4" : "4",
"5" : "1",
"6" : "1",
"6" : "6",
"7" : "1",
"8" : "0",
"9" : "1",
Expand Down Expand Up @@ -67,6 +68,19 @@
"63": "1"
}
},
"TC_TO_PRIORITY_GROUP_MAP": {
"AZURE": {
"0": "0",
"1": "0",
"2": "2",
"3": "3",
"4": "4",
"5": "0",
"6": "6",
"7": "7"
}
},
{%- endmacro %}
{% endif %}

{%- include 'qos_config.j2' %}
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
{%- macro clear_q_for_pcbb() %}
{% if ('type' in DEVICE_METADATA['localhost'] and DEVICE_METADATA['localhost']['type'] == 'LeafRouter') or ('subtype' in DEVICE_METADATA['localhost'] and DEVICE_METADATA['localhost']['subtype'] == 'DualToR') %}
{%- macro generate_dscp_to_tc_map() %}
"DSCP_TO_TC_MAP": {
"AZURE": {
"0" : "1",
"1" : "1",
"2" : "1",
"2" : "2",
"3" : "3",
"4" : "4",
"5" : "1",
"6" : "1",
"6" : "6",
"7" : "1",
"8" : "0",
"9" : "1",
Expand Down Expand Up @@ -67,6 +68,19 @@
"63": "1"
}
},
"TC_TO_PRIORITY_GROUP_MAP": {
"AZURE": {
"0": "0",
"1": "0",
"2": "2",
"3": "3",
"4": "4",
"5": "0",
"6": "6",
"7": "7"
}
},
{%- endmacro %}
{% endif %}

{%- include 'qos_config.j2' %}

This file was deleted.

This file was deleted.

31 changes: 27 additions & 4 deletions files/build_templates/qos_config.j2
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@
{%- endfor %}
{%- set port_names_active = port_names_list_active | join(',') -%}

{%- set port_names_list_extra_queues = [] %}
{%- for port in PORT_ACTIVE %}
{% if ('type' in DEVICE_METADATA['localhost'] and DEVICE_METADATA['localhost']['type'] == 'LeafRouter' and DEVICE_NEIGHBOR is defined and 'name' in DEVICE_NEIGHBOR[port] and 'T0' in DEVICE_NEIGHBOR[port]['name']) or
('subtype' in DEVICE_METADATA['localhost'] and DEVICE_METADATA['localhost']['subtype'] == 'DualToR' and DEVICE_NEIGHBOR is defined and 'name' in DEVICE_NEIGHBOR[port] and 'T1' in DEVICE_NEIGHBOR[port]['name']) %}
{%- if port_names_list_extra_queues.append(port) %}{%- endif %}
{% endif %}
{%- endfor %}

{%- set pfc_to_pg_map_supported_asics = ['mellanox', 'barefoot', 'marvell'] -%}
{%- set backend_device_types = ['BackEndToRRouter', 'BackEndLeafRouter'] -%}
Expand All @@ -36,7 +43,7 @@
{
{% if generate_tc_to_pg_map is defined %}
{{- generate_tc_to_pg_map() }}
{% else %}
{% elif generate_dscp_to_tc_map is not defined %}
"TC_TO_PRIORITY_GROUP_MAP": {
"AZURE": {
"0": "0",
Expand Down Expand Up @@ -87,8 +94,8 @@
"7": "7"
}
},
{% elif clear_q_for_pcbb is defined %}
{{- clear_q_for_pcbb() }}
{% elif generate_dscp_to_tc_map is defined %}
{{- generate_dscp_to_tc_map() }}
{% else %}
"DSCP_TO_TC_MAP": {
"AZURE": {
Expand Down Expand Up @@ -208,7 +215,13 @@
{% if asic_type in pfc_to_pg_map_supported_asics %}
"pfc_to_pg_map" : "AZURE",
{% endif %}
"pfc_enable" : "3,4"
{% if port in port_names_list_extra_queues %}
"pfc_enable" : "2,3,4,6",
"pfcwd_sw_enable" : "3,4"
{% else %}
"pfc_enable" : "3,4",
"pfcwd_sw_enable" : "3,4"
{% endif %}
}{% if not loop.last %},{% endif %}

{% endfor %}
Expand Down Expand Up @@ -268,7 +281,12 @@
{% endfor %}
{% for port in PORT_ACTIVE %}
"{{ port }}|2": {
{% if port in port_names_list_extra_queues %}
"scheduler" : "scheduler.1",
"wred_profile": "AZURE_LOSSLESS"
{% else %}
"scheduler": "scheduler.0"
{% endif %}
},
{% endfor %}
{% for port in PORT_ACTIVE %}
Expand All @@ -278,7 +296,12 @@
{% endfor %}
{% for port in PORT_ACTIVE %}
"{{ port }}|6": {
{% if port in port_names_list_extra_queues %}
"scheduler" : "scheduler.1",
"wred_profile": "AZURE_LOSSLESS"
{% else %}
"scheduler": "scheduler.0"
{% endif %}
}{% if not loop.last %},{% endif %}

{% endfor %}
Expand Down
Loading

0 comments on commit 6565c2e

Please sign in to comment.