Skip to content

Commit cf0465b

Browse files
authored
Adopt per-port buffer and qos profile (#3542)
Signed-off-by: Wenda Ni <[email protected]>
1 parent 1515e39 commit cf0465b

File tree

4 files changed

+843
-13
lines changed

4 files changed

+843
-13
lines changed

files/build_templates/buffers_config.j2

+16-6
Original file line numberDiff line numberDiff line change
@@ -131,25 +131,35 @@ def
131131
{{ defs.generate_pg_profils(port_names_active) }}
132132
{% else %}
133133
"BUFFER_PG": {
134-
"{{ port_names_active }}|0": {
134+
{% for port in PORT_ACTIVE %}
135+
"{{ port }}|0": {
135136
"profile" : "[BUFFER_PROFILE|ingress_lossy_profile]"
136-
}
137+
}{% if not loop.last %},{% endif %}
138+
139+
{% endfor %}
137140
},
138141
{% endif %}
139142

140143
{% if defs.generate_queue_buffers is defined %}
141144
{{ defs.generate_queue_buffers(port_names_active) }}
142145
{% else %}
143146
"BUFFER_QUEUE": {
144-
"{{ port_names_active }}|3-4": {
147+
{% for port in PORT_ACTIVE %}
148+
"{{ port }}|3-4": {
145149
"profile" : "[BUFFER_PROFILE|egress_lossless_profile]"
146150
},
147-
"{{ port_names_active }}|0-2": {
151+
{% endfor %}
152+
{% for port in PORT_ACTIVE %}
153+
"{{ port }}|0-2": {
148154
"profile" : "[BUFFER_PROFILE|egress_lossy_profile]"
149155
},
150-
"{{ port_names_active }}|5-6": {
156+
{% endfor %}
157+
{% for port in PORT_ACTIVE %}
158+
"{{ port }}|5-6": {
151159
"profile" : "[BUFFER_PROFILE|egress_lossy_profile]"
152-
}
160+
}{% if not loop.last %},{% endif %}
161+
162+
{% endfor %}
153163
}
154164
{% endif %}
155165
}

files/build_templates/qos_config.j2

+5-2
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,8 @@
175175
},
176176
{% endif %}
177177
"PORT_QOS_MAP": {
178-
"{{ port_names_active }}": {
178+
{% for port in PORT_ACTIVE %}
179+
"{{ port }}": {
179180
{% if 'type' in DEVICE_METADATA['localhost'] and DEVICE_METADATA['localhost']['type'] in backend_device_types %}
180181
"dot1p_to_tc_map" : "[DOT1P_TO_TC_MAP|AZURE]",
181182
{% else %}
@@ -188,7 +189,9 @@
188189
"pfc_to_pg_map" : "[PFC_PRIORITY_TO_PRIORITY_GROUP_MAP|AZURE]",
189190
{% endif %}
190191
"pfc_enable" : "3,4"
191-
}
192+
}{% if not loop.last %},{% endif %}
193+
194+
{% endfor %}
192195
},
193196
"WRED_PROFILE": {
194197
"AZURE_LOSSLESS" : {

0 commit comments

Comments
 (0)