Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Mellanox] Support SN4600C-C64 as T1 switch in dual-ToR scenario #11261

Merged
merged 7 commits into from
Jul 20, 2022
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -124,24 +124,55 @@
}
{%- endmacro %}

{%- macro generate_queue_buffers(port_names_active, port_names_inactive) %}
{%- macro generate_queue_buffers_with_extra_lossless_queues(port_names_active, port_names_extra_queues, port_names_inactive) %}
"BUFFER_QUEUE": {
{% set q_loop = namespace(last_valid=false) %}
{% for port in port_names_active.split(',') %}
{% if port not in port_names_extra_queues.split(',') %}
"{{ port }}|3-4": {
"profile" : "egress_lossless_profile"
},
{% endif %}
{% endfor %}
{% for port in port_names_active.split(',') %}
{% if port not in port_names_extra_queues.split(',') %}
"{{ port }}|0-2": {
"profile" : "q_lossy_profile"
},
{% endif %}
{% endfor %}
{% for port in port_names_active.split(',') %}
{% if port not in port_names_extra_queues.split(',') %}
"{{ port }}|5-6": {
"profile" : "q_lossy_profile"
}{% if not loop.last %},{% endif %}

{% set q_loop.last_valid = true %}
{% else %}
{% set q_loop.last_valid = false %}
{% endif %}
{% endfor %}
{% if port_names_extra_queues|length > 0 %}
{% if q_loop.last_valid %},{% endif %}
{% for port in port_names_extra_queues.split(',') %}
"{{ port }}|0-1": {
"profile" : "q_lossy_profile"
},
"{{ port }}|2-4": {
"profile" : "egress_lossless_profile"
},
"{{ port }}|5": {
"profile" : "q_lossy_profile"
},
"{{ port }}|6": {
"profile" : "egress_lossless_profile"
},
"{{ port }}|7": {
"profile" : "q_lossy_profile"
}{% if not loop.last %},{% endif %}

{% endfor %}
{% endif %}
{% if port_names_inactive|length > 0 %}
,
{% if dynamic_mode is defined %}
Expand Down Expand Up @@ -183,9 +214,15 @@
}
{%- endmacro %}

{%- macro generate_pg_profiles(port_names_active, port_names_inactive) %}
{%- macro generate_queue_buffers(port_names_active, port_names_inactive) %}
{{ generate_queue_buffers_with_extra_lossless_queues(port_names_active, "", port_names_inactive) }}
{%- endmacro %}

{%- macro generate_pg_profiles_with_extra_lossless_pgs(port_names_active, port_names_extra_pgs, port_names_inactive) %}
"BUFFER_PG": {
{% set pg_loop = namespace(last_valid=false) %}
{% for port in port_names_active.split(',') %}
{% if port not in port_names_extra_pgs.split(',') %}
{% if dynamic_mode is defined %}
"{{ port }}|3-4": {
"profile" : "NULL"
Expand All @@ -195,7 +232,28 @@
"profile" : "ingress_lossy_profile"
}{% if not loop.last %},{% endif %}

{% set pg_loop.last_valid = true %}
{% else %}
{% set pg_loop.last_valid = false %}
{% endif %}
{% endfor %}
{% if port_names_extra_pgs|length > 0 %}
{% if pg_loop.last_valid %},{% endif %}
{% for port in port_names_extra_pgs.split(',') %}
{% if dynamic_mode is defined %}
"{{ port }}|2-4": {
"profile" : "NULL"
},
"{{ port }}|6": {
"profile" : "NULL"
},
{% endif %}
"{{ port }}|0": {
"profile" : "ingress_lossy_profile"
}{% if not loop.last %},{% endif %}

{% endfor %}
{% endif %}
{% if port_names_inactive|length > 0 %}
{%- for port in port_names_inactive.split(',') %}
{%- if loop.first -%},{%- endif -%}
Expand All @@ -216,3 +274,7 @@
{% endif %}
}
{%- endmacro %}

{%- macro generate_pg_profiles(port_names_active, port_names_inactive) %}
{{ generate_pg_profiles_with_extra_lossless_pgs(port_names_active, "", port_names_inactive) }}
{%- endmacro %}
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,17 @@
limitations under the License.
#}
{% set default_cable = '5m' %}
{%- if ((SYSTEM_DEFAULTS is defined) and ('tunnel_qos_remap' in SYSTEM_DEFAULTS) and (SYSTEM_DEFAULTS['tunnel_qos_remap']['status'] == 'enabled')) -%}
{% set ingress_lossless_pool_size = '44130304' %}
{% set ingress_lossless_pool_xoff = '8790016' %}
{% set egress_lossless_pool_size = '60817392' %}
{% set egress_lossy_pool_size = '44130304' %}
{%- else -%}
{% set ingress_lossless_pool_size = '48332800' %}
{% set ingress_lossless_pool_xoff = '5275648' %}
{% set egress_lossless_pool_size = '60817392' %}
{% set egress_lossy_pool_size = '48332800' %}
{%- endif -%}

{% import 'buffers_defaults_objects.j2' as defs with context %}

Expand All @@ -30,10 +37,18 @@
{{ defs.generate_profile_lists(port_names_active, port_names_inactive) }}
{%- endmacro %}

{%- macro generate_queue_buffers_with_extra_lossless_queues_with_inactive_ports(port_names_active, port_names_extra_queues, port_names_inactive) %}
{{ defs.generate_queue_buffers_with_extra_lossless_queues(port_names_active, port_names_extra_queues, port_names_inactive) }}
{%- endmacro %}

{%- macro generate_queue_buffers_with_inactive_ports(port_names_active, port_names_inactive) %}
{{ defs.generate_queue_buffers(port_names_active, port_names_inactive) }}
{%- endmacro %}

{%- macro generate_pg_profiles_with_extra_lossless_pgs_with_inactive_ports(port_names_active, port_names_extra_pgs, port_names_inactive) %}
{{ defs.generate_pg_profiles_with_extra_lossless_pgs(port_names_active, port_names_extra_pgs, port_names_inactive) }}
{%- endmacro %}

{%- macro generate_pg_profiles_with_inactive_ports(port_names_active, port_names_inactive) %}
{{ defs.generate_pg_profiles(port_names_active, port_names_inactive) }}
{%- endmacro %}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,175 @@
{#
Copyright (c) 2020-2021 NVIDIA CORPORATION & AFFILIATES.
Apache-2.0

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
#}
{% 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 %}
{%- macro generate_global_dscp_to_tc_map() %}
{# This is an empty macro since the global DSCP_TO_TC map is not required #}
{%- endmacro %}

{% endif %}

{%- include 'qos_config.j2' %}
14 changes: 7 additions & 7 deletions files/build_templates/buffers_config.j2
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,8 @@ def
{{ defs.generate_profile_lists_with_inactive_ports(port_names_active, port_names_inactive) }},
{% endif %}

{%- if defs.generate_pg_profils is defined %}
{{ defs.generate_pg_profils(port_names_active) }}
neethajohn marked this conversation as resolved.
Show resolved Hide resolved
{% if (defs.generate_pg_profiles_with_extra_lossless_pgs_with_inactive_ports is defined) and (port_names_extra_queues != '') %}
{{ defs.generate_pg_profiles_with_extra_lossless_pgs_with_inactive_ports(port_names_active, port_names_extra_queues, port_names_inactive) }},
{% elif defs.generate_pg_profiles_with_inactive_ports is defined %}
{{ defs.generate_pg_profiles_with_inactive_ports(port_names_active, port_names_inactive) }},
{% elif (defs.generate_pg_buffers_with_extra_lossy_pgs is defined) and (port_names_extra_queues != '') %}
Expand All @@ -192,14 +192,14 @@ def
},
{% endif %}

{% if defs.generate_queue_buffers is defined %}
{{ defs.generate_queue_buffers(port_names_active) }}
{% elif defs.generate_queue_buffers_with_inactive_ports is defined %}
{{ defs.generate_queue_buffers_with_inactive_ports(port_names_active, port_names_inactive) }}
{% elif (defs.generate_queue_buffers_with_extra_lossless_queues_with_inactive_ports is defined) and (port_names_extra_queues != '') %}
{% if (defs.generate_queue_buffers_with_extra_lossless_queues_with_inactive_ports is defined) and (port_names_extra_queues != '') %}
{{ defs.generate_queue_buffers_with_extra_lossless_queues_with_inactive_ports(port_names_active, port_names_extra_queues, port_names_inactive) }}
{% elif (defs.generate_queue_buffers_with_extra_lossless_queues is defined) and (port_names_extra_queues != '') %}
{{ defs.generate_queue_buffers_with_extra_lossless_queues(port_names_active, port_names_extra_queues) }}
{% elif defs.generate_queue_buffers is defined %}
{{ defs.generate_queue_buffers(port_names_active) }}
{% elif defs.generate_queue_buffers_with_inactive_ports is defined %}
{{ defs.generate_queue_buffers_with_inactive_ports(port_names_active, port_names_inactive) }}
{% else %}
"BUFFER_QUEUE": {
{% for port in PORT_ACTIVE %}
Expand Down
16 changes: 16 additions & 0 deletions files/build_templates/qos_config.j2
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,14 @@
{% endif %}
{% if asic_type in pfc_to_pg_map_supported_asics %}
"PFC_PRIORITY_TO_PRIORITY_GROUP_MAP": {
{% if port_names_list_extra_queues|length > 0 %}
"AZURE_DUALTOR": {
"2": "2",
"3": "3",
"4": "4",
"6": "6"
},
{% endif %}
"AZURE": {
"3": "3",
"4": "4"
Expand All @@ -228,15 +236,23 @@
"{{ port }}": {
{% if 'type' in DEVICE_METADATA['localhost'] and DEVICE_METADATA['localhost']['type'] in backend_device_types and 'storage_device' in DEVICE_METADATA['localhost'] and DEVICE_METADATA['localhost']['storage_device'] == 'true' %}
"dot1p_to_tc_map" : "AZURE",
{% else %}
{% if different_dscp_to_tc_map and port not in port_names_list_extra_queues and tunnel_qos_remap_enable %}
"dscp_to_tc_map" : "AZURE_UPLINK",
{% else %}
"dscp_to_tc_map" : "AZURE",
{% endif %}
{% endif %}
"tc_to_queue_map" : "AZURE",
"tc_to_pg_map" : "AZURE",
"pfc_to_queue_map": "AZURE",
{% if asic_type in pfc_to_pg_map_supported_asics %}
{% if port in port_names_list_extra_queues %}
"pfc_to_pg_map" : "AZURE_DUALTOR",
{% else %}
"pfc_to_pg_map" : "AZURE",
{% endif %}
{% endif %}
{% if port in port_names_list_extra_queues %}
"pfc_enable" : "2,3,4,6",
{% else %}
Expand Down
Loading