Skip to content

Commit 8c10c01

Browse files
Updated format of generating BUFFER_QUEUE in buffers_defaults templates (#9850)
This PR includes necessary changes for correct generating BUFFER_QUEUE values in DB. Changes are based on the schema.md Why I did it Change format of generating BUFFER_QUEUE in DB according to schema.md and yang-model. Old format: "BUFFER_QUEUE": { "Ethernet0,Ethernet100,Ethernet104,Ethernet108,Ethernet112,Ethernet116,Ethernet12,Ethernet120,Ethernet124,Ethernet16,Ethernet20,Ethernet24,Ethernet28,Ethernet32,Ethernet36,Ethernet4,Ethernet40,Ethernet44,Ethernet48,Ethernet52,Ethernet56,Ethernet60,Ethernet64,Ethernet68,Ethernet72,Ethernet76,Ethernet8,Ethernet80,Ethernet84,Ethernet88,Ethernet92,Ethernet96|queue": { "profile": "profile" }, "Ethernet0,Ethernet100,Ethernet104,Ethernet108,Ethernet112,Ethernet116,Ethernet12,Ethernet120,Ethernet124,Ethernet16,Ethernet20,Ethernet24,Ethernet28,Ethernet32,Ethernet36,Ethernet4,Ethernet40,Ethernet44,Ethernet48,Ethernet52,Ethernet56,Ethernet60,Ethernet64,Ethernet68,Ethernet72,Ethernet76,Ethernet8,Ethernet80,Ethernet84,Ethernet88,Ethernet92,Ethernet96|queue": { "profile": "profile" } }, New format: "BUFFER_QUEUE": { "Ethernet0|queue": { "profile": "profile" }, "Ethernet0|queue": { "profile": "profile" }, "Ethernet4|queue": { "profile": "profile" }, "Ethernet4|queue": { "profile": "profile" }, "Ethernet8|queue": { "profile": "profile" }, "Ethernet8|queue": { "profile": "profile" }, ... } How I did it Updated structure of buffers_defaults jinja templates. Signed-off-by: Oleksandr Kozodoi <[email protected]>
1 parent fb25f13 commit 8c10c01

File tree

6 files changed

+56
-50
lines changed

6 files changed

+56
-50
lines changed

device/arista/x86_64-arista_7170_64c/Arista-7170-64C/buffers_defaults_t0.j2

+9-5
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,15 @@
6161

6262
{%- macro generate_queue_buffers(port_names) %}
6363
"BUFFER_QUEUE": {
64-
"{{ port_names }}|3-4": {
65-
"profile" : "egress_lossless_profile"
66-
},
67-
"{{ port_names }}|0-1": {
64+
{% for port in port_names.split(',') %}
65+
"{{ port }}|0-2": {
6866
"profile" : "q_lossy_profile"
69-
}
67+
},
68+
{% endfor %}
69+
{% for port in port_names.split(',') %}
70+
"{{ port }}|3-4": {
71+
"profile" : "egress_lossless_profile"
72+
}{% if not loop.last %},{% endif %}
73+
{% endfor %}
7074
}
7175
{%- endmacro %}

device/arista/x86_64-arista_7170_64c/Arista-7170-64C/buffers_defaults_t1.j2

+9-5
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,15 @@
6161

6262
{%- macro generate_queue_buffers(port_names) %}
6363
"BUFFER_QUEUE": {
64-
"{{ port_names }}|3-4": {
65-
"profile" : "egress_lossless_profile"
66-
},
67-
"{{ port_names }}|0-1": {
64+
{% for port in port_names.split(',') %}
65+
"{{ port }}|0-2": {
6866
"profile" : "q_lossy_profile"
69-
}
67+
},
68+
{% endfor %}
69+
{% for port in port_names.split(',') %}
70+
"{{ port }}|3-4": {
71+
"profile" : "egress_lossless_profile"
72+
}{% if not loop.last %},{% endif %}
73+
{% endfor %}
7074
}
7175
{%- endmacro %}

device/barefoot/x86_64-accton_as9516_32d-r0/newport/buffers_defaults_t0.j2

+10-7
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@
1616
"ingress_lossless_pool": {
1717
"size": "{{ ingress_lossless_pool_size }}",
1818
"type": "ingress",
19-
"mode": "dynamic",
20-
"xoff": "36222208"
19+
"mode": "dynamic"
2120
},
2221
"ingress_lossy_pool": {
2322
"size": "{{ ingress_lossy_pool_size }}",
@@ -61,11 +60,15 @@
6160

6261
{%- macro generate_queue_buffers(port_names) %}
6362
"BUFFER_QUEUE": {
64-
"{{ port_names }}|3-4": {
65-
"profile" : "egress_lossless_profile"
66-
},
67-
"{{ port_names }}|0-1": {
63+
{% for port in port_names.split(',') %}
64+
"{{ port }}|0-2": {
6865
"profile" : "q_lossy_profile"
69-
}
66+
},
67+
{% endfor %}
68+
{% for port in port_names.split(',') %}
69+
"{{ port }}|3-4": {
70+
"profile" : "egress_lossless_profile"
71+
}{% if not loop.last %},{% endif %}
72+
{% endfor %}
7073
}
7174
{%- endmacro %}

device/barefoot/x86_64-accton_as9516_32d-r0/newport/buffers_defaults_t1.j2

+10-7
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@
1616
"ingress_lossless_pool": {
1717
"size": "{{ ingress_lossless_pool_size }}",
1818
"type": "ingress",
19-
"mode": "dynamic",
20-
"xoff": "36222208"
19+
"mode": "dynamic"
2120
},
2221
"ingress_lossy_pool": {
2322
"size": "{{ ingress_lossy_pool_size }}",
@@ -61,11 +60,15 @@
6160

6261
{%- macro generate_queue_buffers(port_names) %}
6362
"BUFFER_QUEUE": {
64-
"{{ port_names }}|3-4": {
65-
"profile" : "egress_lossless_profile"
66-
},
67-
"{{ port_names }}|0-1": {
63+
{% for port in port_names.split(',') %}
64+
"{{ port }}|0-2": {
6865
"profile" : "q_lossy_profile"
69-
}
66+
},
67+
{% endfor %}
68+
{% for port in port_names.split(',') %}
69+
"{{ port }}|3-4": {
70+
"profile" : "egress_lossless_profile"
71+
}{% if not loop.last %},{% endif %}
72+
{% endfor %}
7073
}
7174
{%- endmacro %}

device/barefoot/x86_64-accton_wedge100bf_32x-r0/montara/buffers_defaults_t0.j2

+9-13
Original file line numberDiff line numberDiff line change
@@ -63,21 +63,17 @@
6363
},
6464
{%- endmacro %}
6565

66-
{%- macro generate_pg_profils(port_names) %}
67-
"BUFFER_PG": {
68-
"{{ port_names }}|3-4": {
69-
"profile" : "ingress_lossless_profile"
70-
}
71-
},
72-
{%- endmacro %}
73-
7466
{%- macro generate_queue_buffers(port_names) %}
7567
"BUFFER_QUEUE": {
76-
"{{ port_names }}|3-4": {
77-
"profile" : "egress_lossless_profile"
78-
},
79-
"{{ port_names }}|0-1": {
68+
{% for port in port_names.split(',') %}
69+
"{{ port }}|0-2": {
8070
"profile" : "q_lossy_profile"
81-
}
71+
},
72+
{% endfor %}
73+
{% for port in port_names.split(',') %}
74+
"{{ port }}|3-4": {
75+
"profile" : "egress_lossless_profile"
76+
}{% if not loop.last %},{% endif %}
77+
{% endfor %}
8278
}
8379
{%- endmacro %}

device/barefoot/x86_64-accton_wedge100bf_32x-r0/montara/buffers_defaults_t1.j2

+9-13
Original file line numberDiff line numberDiff line change
@@ -63,21 +63,17 @@
6363
},
6464
{%- endmacro %}
6565

66-
{%- macro generate_pg_profils(port_names) %}
67-
"BUFFER_PG": {
68-
"{{ port_names }}|3-4": {
69-
"profile" : "ingress_lossless_profile"
70-
}
71-
},
72-
{%- endmacro %}
73-
7466
{%- macro generate_queue_buffers(port_names) %}
7567
"BUFFER_QUEUE": {
76-
"{{ port_names }}|3-4": {
77-
"profile" : "egress_lossless_profile"
78-
},
79-
"{{ port_names }}|0-1": {
68+
{% for port in port_names.split(',') %}
69+
"{{ port }}|0-2": {
8070
"profile" : "q_lossy_profile"
81-
}
71+
},
72+
{% endfor %}
73+
{% for port in port_names.split(',') %}
74+
"{{ port }}|3-4": {
75+
"profile" : "egress_lossless_profile"
76+
}{% if not loop.last %},{% endif %}
77+
{% endfor %}
8278
}
8379
{%- endmacro %}

0 commit comments

Comments
 (0)