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

Add two extra lossless queues for bounced back traffic #10496

Merged
merged 18 commits into from
Jun 2, 2022
Merged
Show file tree
Hide file tree
Changes from 2 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

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,2 +1,41 @@
{%- set default_topo = 't0' %}

{% if DEVICE_METADATA is defined and 'subtype' in DEVICE_METADATA['localhost'] and DEVICE_METADATA['localhost']['subtype'] == 'DualToR' %}
{%- macro generate_extra_lossless_buffers(port_names, port_names_require_extra_buffer) %}
"BUFFER_QUEUE": {
{% for port in port_names %}
{% if port in port_names_require_extra_buffer %}
"{{ port }}|0-1": {
"profile" : "egress_lossy_profile"
},
"{{ port }}|2-4": {
"profile" : "egress_lossless_profile"
},
"{{ port }}|5": {
"profile" : "egress_lossy_profile"
},
"{{ port }}|6": {
"profile" : "egress_lossless_profile"
},
"{{ port }}|7": {
"profile" : "egress_lossy_profile"
}{% if not loop.last %},{% endif %}

{% else %}
"{{ port }}|0-2": {
"profile" : "egress_lossy_profile"
},
"{{ port }}|3-4": {
"profile" : "egress_lossless_profile"
},
"{{ port }}|5-7": {
"profile" : "egress_lossy_profile"
}{% if not loop.last %},{% endif %}

{% endif %}
{% endfor %}
}
{% endmacro %}
{% endif %}

{%- include 'buffers_config.j2' %}
Original file line number Diff line number Diff line change
@@ -1,3 +1,43 @@
{%- set default_topo = 't1' %}

{% if DEVICE_METADATA is defined and 'type' in DEVICE_METADATA['localhost'] and
(DEVICE_METADATA['localhost']['type'] == 'LeafRouter' or DEVICE_METADATA['localhost']['subtype'] == 'DualToR') %}
{%- macro generate_extra_lossless_buffers(port_names, port_names_require_extra_buffer) %}
"BUFFER_QUEUE": {
{% for port in port_names %}
{% if port in port_names_require_extra_buffer %}
"{{ port }}|0-1": {
"profile" : "egress_lossy_profile"
},
"{{ port }}|2-4": {
"profile" : "egress_lossless_profile"
},
"{{ port }}|5": {
"profile" : "egress_lossy_profile"
},
"{{ port }}|6": {
"profile" : "egress_lossless_profile"
},
"{{ port }}|7": {
"profile" : "egress_lossy_profile"
}{% if not loop.last %},{% endif %}

{% else %}
"{{ port }}|0-2": {
"profile" : "egress_lossy_profile"
},
"{{ port }}|3-4": {
"profile" : "egress_lossless_profile"
},
"{{ port }}|5-7": {
"profile" : "egress_lossy_profile"
}{% if not loop.last %},{% endif %}

{% endif %}
{% endfor %}
}
{% endmacro %}
{% endif %}

{%- include 'buffers_config.j2' %}

This file was deleted.

This file was deleted.

10 changes: 10 additions & 0 deletions files/build_templates/buffers_config.j2
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,14 @@ def
{%- endfor %}
{%- set port_names_active = port_names_list_active | join(',') %}

{%- set port_names_list_extra_queues = [] %}
{%- for port in PORT_ACTIVE %}
{% if (generate_extra_lossless_buffers 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
('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 %}
{% endif %}
{%- endfor %}

{%- set port_names_list_inactive = [] %}
{%- for port in PORT_INACTIVE %}
neethajohn marked this conversation as resolved.
Show resolved Hide resolved
{%- if port_names_list_inactive.append(port) %}{%- endif %}
Expand Down Expand Up @@ -182,6 +190,8 @@ def
{{ 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 generate_extra_lossless_buffers is defined %}
neethajohn marked this conversation as resolved.
Show resolved Hide resolved
{{ generate_extra_lossless_buffers(port_names_list_active, port_names_list_extra_queues) }}
{% else %}
"BUFFER_QUEUE": {
{% for port in PORT_ACTIVE %}
Expand Down
Loading