Skip to content

Commit 1a2284f

Browse files
committed
Rename macro
Signed-off-by: bingwang <[email protected]>
1 parent e78d970 commit 1a2284f

File tree

3 files changed

+12
-9
lines changed

3 files changed

+12
-9
lines changed

device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-D48C8/buffers.json.j2

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{%- set default_topo = 't0' %}
22

33
{% if DEVICE_METADATA is defined and 'subtype' in DEVICE_METADATA['localhost'] and DEVICE_METADATA['localhost']['subtype'] == 'DualToR' %}
4-
{%- macro generate_extra_lossless_buffers(port_names, port_names_require_extra_buffer) %}
4+
{%- macro generate_queue_buffers_with_extra_lossless_queues(port_names, port_names_require_extra_buffer) %}
55
"BUFFER_QUEUE": {
6-
{% for port in port_names %}
7-
{% if port in port_names_require_extra_buffer %}
6+
{% for port in port_names.split(',') %}
7+
{% if port in port_names_require_extra_buffer.split(',') %}
88
"{{ port }}|0-1": {
99
"profile" : "egress_lossy_profile"
1010
},

device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-C64/buffers.json.j2

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
{% if DEVICE_METADATA is defined and 'type' in DEVICE_METADATA['localhost'] and
44
(DEVICE_METADATA['localhost']['type'] == 'LeafRouter' or DEVICE_METADATA['localhost']['subtype'] == 'DualToR') %}
5-
{%- macro generate_extra_lossless_buffers(port_names, port_names_require_extra_buffer) %}
5+
{%- macro generate_queue_buffers_with_extra_lossless_queues(port_names, port_names_require_extra_buffer) %}
66
"BUFFER_QUEUE": {
7-
{% for port in port_names %}
8-
{% if port in port_names_require_extra_buffer %}
7+
{% for port in port_names.split(',') %}
8+
{% if port in port_names_require_extra_buffer.split(',') %}
99
"{{ port }}|0-1": {
1010
"profile" : "egress_lossy_profile"
1111
},

files/build_templates/buffers_config.j2

+6-3
Original file line numberDiff line numberDiff line change
@@ -130,11 +130,12 @@ def
130130

131131
{%- set port_names_list_extra_queues = [] %}
132132
{%- for port in PORT_ACTIVE %}
133-
{% 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
133+
{% if (generate_queue_buffers_with_extra_lossless_queues 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
134134
('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') %}
135135
{%- if port_names_list_extra_queues.append(port) %}{%- endif %}
136136
{% endif %}
137137
{%- endfor %}
138+
{%- set port_names_extra_queues = port_names_list_extra_queues | join(',') %}
138139

139140
{%- set port_names_list_inactive = [] %}
140141
{%- for port in PORT_INACTIVE %}
@@ -190,8 +191,10 @@ def
190191
{{ defs.generate_queue_buffers(port_names_active) }}
191192
{% elif defs.generate_queue_buffers_with_inactive_ports is defined %}
192193
{{ defs.generate_queue_buffers_with_inactive_ports(port_names_active, port_names_inactive) }}
193-
{% elif generate_extra_lossless_buffers is defined %}
194-
{{ generate_extra_lossless_buffers(port_names_list_active, port_names_list_extra_queues) }}
194+
{% elif generate_queue_buffers_with_extra_lossless_queues_with_inactive_ports is defined %}
195+
{{ generate_queue_buffers_with_extra_lossless_queues_with_inactive_ports(port_names_active, port_names_extra_queues, port_names_inactive) }}
196+
{% elif generate_queue_buffers_with_extra_lossless_queues is defined %}
197+
{{ generate_queue_buffers_with_extra_lossless_queues(port_names_active, port_names_extra_queues) }}
195198
{% else %}
196199
"BUFFER_QUEUE": {
197200
{% for port in PORT_ACTIVE %}

0 commit comments

Comments
 (0)