Skip to content

Commit a57fa16

Browse files
authored
[Chassis][Voq]update to add buffer_queue config on system ports (sonic-net#12156)
Why I did it In the voq chassis the buffer_queue configuration needs to be applied on system_port instead of the sonic port. This PR has the change to do this. How I did it Modify buffer_config.j2 to generate buffer_queue configuration on system_ports if the device is Voq Chassis How to verify it Verify the buffer_queue configuration is generated properly using sonic-cfggen Signed-off-by: Arvindsrinivasan Lakshmi Narasimhan <[email protected]>
1 parent 38c5d7f commit a57fa16

File tree

3 files changed

+2181
-360
lines changed

3 files changed

+2181
-360
lines changed

files/build_templates/buffers_config.j2

+39
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ def
2121
{%- set switch_role = '' %}
2222
{%- endif -%}
2323

24+
{% set voq_chassis = false %}
25+
{%- if DEVICE_METADATA is defined and DEVICE_METADATA['localhost']['switch_type'] is defined and DEVICE_METADATA['localhost']['switch_type'] == 'voq' %}
26+
{%- set voq_chassis = true %}
27+
{%- endif -%}
28+
2429
{# Import default values from device HWSKU folder #}
2530
{%- import 'buffers_defaults_%s.j2' % filename_postfix as defs with context %}
2631

@@ -94,7 +99,20 @@ def
9499
{%- endmacro %}
95100

96101
{%- set PORT_ALL = [] %}
102+
{%- set SYSTEM_PORT_ALL = [] %}
97103

104+
{%- if voq_chassis %}
105+
{%- for system_port in SYSTEM_PORT %}
106+
{% if '|' not in system_port %}
107+
{%- set system_port_name = system_port|join("|") %}
108+
{% else %}
109+
{%- set system_port_name = system_port %}
110+
{% endif %}
111+
{%- if 'cpu' not in system_port_name.lower() and 'IB' not in system_port_name and 'Rec' not in system_port_name %}
112+
{%- if SYSTEM_PORT_ALL.append(system_port_name) %}{%- endif %}
113+
{%- endif %}
114+
{%- endfor %}
115+
{%- endif %}
98116
{%- if PORT is not defined %}
99117
{%- if defs.generate_port_lists is defined %}
100118
{%- if defs.generate_port_lists(PORT_ALL) %} {% endif %}
@@ -190,6 +208,26 @@ def
190208
},
191209
{% endif %}
192210

211+
{% if voq_chassis %}
212+
"BUFFER_QUEUE": {
213+
{% for system_port in SYSTEM_PORT_ALL %}
214+
"{{ system_port }}|3-4": {
215+
"profile" : "egress_lossless_profile"
216+
},
217+
{% endfor %}
218+
{% for system_port in SYSTEM_PORT_ALL %}
219+
"{{ system_port }}|0-2": {
220+
"profile" : "egress_lossy_profile"
221+
},
222+
{% endfor %}
223+
{% for system_port in SYSTEM_PORT_ALL %}
224+
"{{ system_port }}|5-6": {
225+
"profile" : "egress_lossy_profile"
226+
}{% if not loop.last %},{% endif %}
227+
228+
{% endfor %}
229+
}
230+
{% else %}
193231
{% if (defs.generate_queue_buffers_with_extra_lossless_queues_with_inactive_ports is defined) and (port_names_extra_queues != '') %}
194232
{{ defs.generate_queue_buffers_with_extra_lossless_queues_with_inactive_ports(port_names_active, port_names_extra_queues, port_names_inactive) }}
195233
{% elif (defs.generate_queue_buffers_with_extra_lossless_queues is defined) and (port_names_extra_queues != '') %}
@@ -218,6 +256,7 @@ def
218256
{% endfor %}
219257
}
220258
{% endif %}
259+
{% endif %}
221260
{%- if dynamic_mode is defined -%}
222261
,
223262
{%- endif -%}

0 commit comments

Comments
 (0)