Skip to content

Commit 206df43

Browse files
authored
Adopt per-port buffer & qos profile apply on mellanox (#3543)
Signed-off-by: Wenda Ni <[email protected]>
1 parent 6cb445c commit 206df43

File tree

4 files changed

+84
-32
lines changed

4 files changed

+84
-32
lines changed

device/mellanox/x86_64-mlnx_msn2700-r0/ACS-MSN2700/buffers_defaults_t0.j2

+21-8
Original file line numberDiff line numberDiff line change
@@ -65,28 +65,41 @@
6565

6666
{%- macro generate_profile_lists(port_names) %}
6767
"BUFFER_PORT_INGRESS_PROFILE_LIST": {
68-
"{{ port_names }}": {
68+
{% for port in port_names.split(',') %}
69+
"{{ port }}": {
6970
"profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile],[BUFFER_PROFILE|ingress_lossy_profile]"
70-
}
71+
}{% if not loop.last %},{% endif %}
72+
73+
{% endfor %}
7174
},
7275
"BUFFER_PORT_EGRESS_PROFILE_LIST": {
73-
"{{ port_names }}": {
76+
{% for port in port_names.split(',') %}
77+
"{{ port }}": {
7478
"profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]"
75-
}
79+
}{% if not loop.last %},{% endif %}
80+
81+
{% endfor %}
7682
}
7783
{%- endmacro %}
7884

7985
{%- macro generate_queue_buffers(port_names) %}
8086
"BUFFER_QUEUE": {
81-
"{{ port_names }}|3-4": {
87+
{% for port in port_names.split(',') %}
88+
"{{ port }}|3-4": {
8289
"profile" : "[BUFFER_PROFILE|egress_lossless_profile]"
8390
},
84-
"{{ port_names }}|0-1": {
91+
{% endfor %}
92+
{% for port in port_names.split(',') %}
93+
"{{ port }}|0-2": {
8594
"profile" : "[BUFFER_PROFILE|q_lossy_profile]"
8695
},
87-
"{{ port_names }}|5": {
96+
{% endfor %}
97+
{% for port in port_names.split(',') %}
98+
"{{ port }}|5-6": {
8899
"profile" : "[BUFFER_PROFILE|q_lossy_profile]"
89-
}
100+
}{% if not loop.last %},{% endif %}
101+
102+
{% endfor %}
90103
}
91104
{%- endmacro %}
92105

device/mellanox/x86_64-mlnx_msn2700-r0/ACS-MSN2700/buffers_defaults_t1.j2

+21-8
Original file line numberDiff line numberDiff line change
@@ -65,28 +65,41 @@
6565

6666
{%- macro generate_profile_lists(port_names) %}
6767
"BUFFER_PORT_INGRESS_PROFILE_LIST": {
68-
"{{ port_names }}": {
68+
{% for port in port_names.split(',') %}
69+
"{{ port }}": {
6970
"profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile],[BUFFER_PROFILE|ingress_lossy_profile]"
70-
}
71+
}{% if not loop.last %},{% endif %}
72+
73+
{% endfor %}
7174
},
7275
"BUFFER_PORT_EGRESS_PROFILE_LIST": {
73-
"{{ port_names }}": {
76+
{% for port in port_names.split(',') %}
77+
"{{ port }}": {
7478
"profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]"
75-
}
79+
}{% if not loop.last %},{% endif %}
80+
81+
{% endfor %}
7682
}
7783
{%- endmacro %}
7884

7985
{%- macro generate_queue_buffers(port_names) %}
8086
"BUFFER_QUEUE": {
81-
"{{ port_names }}|3-4": {
87+
{% for port in port_names.split(',') %}
88+
"{{ port }}|3-4": {
8289
"profile" : "[BUFFER_PROFILE|egress_lossless_profile]"
8390
},
84-
"{{ port_names }}|0-1": {
91+
{% endfor %}
92+
{% for port in port_names.split(',') %}
93+
"{{ port }}|0-2": {
8594
"profile" : "[BUFFER_PROFILE|q_lossy_profile]"
8695
},
87-
"{{ port_names }}|5": {
96+
{% endfor %}
97+
{% for port in port_names.split(',') %}
98+
"{{ port }}|5-6": {
8899
"profile" : "[BUFFER_PROFILE|q_lossy_profile]"
89-
}
100+
}{% if not loop.last %},{% endif %}
101+
102+
{% endfor %}
90103
}
91104
{%- endmacro %}
92105

device/mellanox/x86_64-mlnx_msn3700-r0/ACS-MSN3700/buffers_defaults_t0.j2

+21-8
Original file line numberDiff line numberDiff line change
@@ -65,27 +65,40 @@
6565

6666
{%- macro generate_profile_lists(port_names) %}
6767
"BUFFER_PORT_INGRESS_PROFILE_LIST": {
68-
"{{ port_names }}": {
68+
{% for port in port_names.split(',') %}
69+
"{{ port }}": {
6970
"profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile],[BUFFER_PROFILE|ingress_lossy_profile]"
70-
}
71+
}{% if not loop.last %},{% endif %}
72+
73+
{% endfor %}
7174
},
7275
"BUFFER_PORT_EGRESS_PROFILE_LIST": {
73-
"{{ port_names }}": {
76+
{% for port in port_names.split(',') %}
77+
"{{ port }}": {
7478
"profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]"
75-
}
79+
}{% if not loop.last %},{% endif %}
80+
81+
{% endfor %}
7682
}
7783
{%- endmacro %}
7884

7985
{%- macro generate_queue_buffers(port_names) %}
8086
"BUFFER_QUEUE": {
81-
"{{ port_names }}|3-4": {
87+
{% for port in port_names.split(',') %}
88+
"{{ port }}|3-4": {
8289
"profile" : "[BUFFER_PROFILE|egress_lossless_profile]"
8390
},
84-
"{{ port_names }}|0-1": {
91+
{% endfor %}
92+
{% for port in port_names.split(',') %}
93+
"{{ port }}|0-2": {
8594
"profile" : "[BUFFER_PROFILE|q_lossy_profile]"
8695
},
87-
"{{ port_names }}|5": {
96+
{% endfor %}
97+
{% for port in port_names.split(',') %}
98+
"{{ port }}|5-6": {
8899
"profile" : "[BUFFER_PROFILE|q_lossy_profile]"
89-
}
100+
}{% if not loop.last %},{% endif %}
101+
102+
{% endfor %}
90103
}
91104
{%- endmacro %}

device/mellanox/x86_64-mlnx_msn3700-r0/ACS-MSN3700/buffers_defaults_t1.j2

+21-8
Original file line numberDiff line numberDiff line change
@@ -65,27 +65,40 @@
6565

6666
{%- macro generate_profile_lists(port_names) %}
6767
"BUFFER_PORT_INGRESS_PROFILE_LIST": {
68-
"{{ port_names }}": {
68+
{% for port in port_names.split(',') %}
69+
"{{ port }}": {
6970
"profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile],[BUFFER_PROFILE|ingress_lossy_profile]"
70-
}
71+
}{% if not loop.last %},{% endif %}
72+
73+
{% endfor %}
7174
},
7275
"BUFFER_PORT_EGRESS_PROFILE_LIST": {
73-
"{{ port_names }}": {
76+
{% for port in port_names.split(',') %}
77+
"{{ port }}": {
7478
"profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]"
75-
}
79+
}{% if not loop.last %},{% endif %}
80+
81+
{% endfor %}
7682
}
7783
{%- endmacro %}
7884

7985
{%- macro generate_queue_buffers(port_names) %}
8086
"BUFFER_QUEUE": {
81-
"{{ port_names }}|3-4": {
87+
{% for port in port_names.split(',') %}
88+
"{{ port }}|3-4": {
8289
"profile" : "[BUFFER_PROFILE|egress_lossless_profile]"
8390
},
84-
"{{ port_names }}|0-1": {
91+
{% endfor %}
92+
{% for port in port_names.split(',') %}
93+
"{{ port }}|0-2": {
8594
"profile" : "[BUFFER_PROFILE|q_lossy_profile]"
8695
},
87-
"{{ port_names }}|5": {
96+
{% endfor %}
97+
{% for port in port_names.split(',') %}
98+
"{{ port }}|5-6": {
8899
"profile" : "[BUFFER_PROFILE|q_lossy_profile]"
89-
}
100+
}{% if not loop.last %},{% endif %}
101+
102+
{% endfor %}
90103
}
91104
{%- endmacro %}

0 commit comments

Comments
 (0)