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 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

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_queue_buffers_with_extra_lossless_queues(port_names, port_names_require_extra_buffer) %}
"BUFFER_QUEUE": {
{% for port in port_names.split(',') %}
{% if port in port_names_require_extra_buffer.split(',') %}
"{{ 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_queue_buffers_with_extra_lossless_queues(port_names, port_names_require_extra_buffer) %}
"BUFFER_QUEUE": {
{% for port in port_names.split(',') %}
{% if port in port_names_require_extra_buffer.split(',') %}
"{{ 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.

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

{%- set port_names_list_extra_queues = [] %}
{%- for port in PORT_ACTIVE %}
{% if (generate_queue_buffers_with_extra_lossless_queues is defined or generate_queue_buffers_with_extra_lossless_queues_with_inactive_ports is defined) and
neethajohn marked this conversation as resolved.
Show resolved Hide resolved
('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') %}
neethajohn marked this conversation as resolved.
Show resolved Hide resolved
{%- if port_names_list_extra_queues.append(port) %}{%- endif %}
{% endif %}
{%- endfor %}
{%- set port_names_extra_queues = port_names_list_extra_queues | join(',') %}

{%- 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 +192,10 @@ 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_queue_buffers_with_extra_lossless_queues_with_inactive_ports is defined %}
{{ generate_queue_buffers_with_extra_lossless_queues_with_inactive_ports(port_names_active, port_names_extra_queues, port_names_inactive) }}
{% elif generate_queue_buffers_with_extra_lossless_queues is defined %}
{{ generate_queue_buffers_with_extra_lossless_queues(port_names_active, port_names_extra_queues) }}
{% else %}
"BUFFER_QUEUE": {
{% for port in PORT_ACTIVE %}
Expand Down
Loading