Skip to content

Commit 1aeb85b

Browse files
committed
Add SYSTEM_DEFAULTS table
Signed-off-by: bingwang <[email protected]>
1 parent d471bec commit 1aeb85b

File tree

16 files changed

+616
-158
lines changed

16 files changed

+616
-158
lines changed

device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-C32/buffers_defaults_t0.j2

+5
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,13 @@
4545
},
4646
{%- endmacro %}
4747

48+
{% if (SYSTEM_DEFAULTS is defined) and ('tunnel_qos_remap' in SYSTEM_DEFAULTS) and (SYSTEM_DEFAULTS['tunnel_qos_remap']['status'] == 'enabled') %}
4849
{% import 'buffers_extra_queues.j2' as defs with context %}
4950

5051
{%- macro generate_queue_buffers_with_extra_lossless_queues(port_names, port_names_require_extra_buffer) %}
5152
{{ defs.generate_queue_buffers_with_extra_lossless_queues(port_names, port_names_require_extra_buffer) }}
5253
{%- endmacro %}
54+
{%- macro generate_pg_profiles_with_extra_lossy_pgs(port_names, port_names_require_extra_lossless_pgs) %}
55+
{{ defs.generate_pg_profiles_with_extra_lossy_pgs(port_names, port_names_require_extra_lossless_pgs) }}
56+
{%- endmacro %}
57+
{% endif %}

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

+5
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,13 @@
4646
},
4747
{%- endmacro %}
4848

49+
{% if (SYSTEM_DEFAULTS is defined) and ('tunnel_qos_remap' in SYSTEM_DEFAULTS) and (SYSTEM_DEFAULTS['tunnel_qos_remap']['status'] == 'enabled') %}
4950
{% import 'buffers_extra_queues.j2' as defs with context %}
5051

5152
{%- macro generate_queue_buffers_with_extra_lossless_queues(port_names, port_names_require_extra_buffer) %}
5253
{{ defs.generate_queue_buffers_with_extra_lossless_queues(port_names, port_names_require_extra_buffer) }}
5354
{%- endmacro %}
55+
{%- macro generate_pg_profiles_with_extra_lossy_pgs(port_names, port_names_require_extra_lossless_pgs) %}
56+
{{ defs.generate_pg_profiles_with_extra_lossy_pgs(port_names, port_names_require_extra_lossless_pgs) }}
57+
{%- endmacro %}
58+
{% endif %}

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

+19-4
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,7 @@
66
"{{ port }}|0-1": {
77
"profile" : "egress_lossy_profile"
88
},
9-
"{{ port }}|2": {
10-
"profile" : "egress_lossless_profile"
11-
},
12-
"{{ port }}|3-4": {
9+
"{{ port }}|2-4": {
1310
"profile" : "egress_lossless_profile"
1411
},
1512
"{{ port }}|5": {
@@ -37,4 +34,22 @@
3734
{% endfor %}
3835
}
3936
{% endmacro %}
37+
{%- macro generate_pg_profiles_with_extra_lossy_pgs(port_names, port_names_require_extra_lossless_pgs) %}
38+
"BUFFER_PG": {
39+
{% for port in port_names.split(',') %}
40+
{% if port not in port_names_require_extra_lossless_pgs.split(',') %}
41+
"{{ port }}|2": {
42+
"profile" : "ingress_lossy_profile"
43+
},
44+
"{{ port }}|6": {
45+
"profile" : "ingress_lossy_profile"
46+
},
47+
{% endif %}
48+
"{{ port }}|0": {
49+
"profile" : "ingress_lossy_profile"
50+
}{% if not loop.last %},{% endif %}
51+
52+
{% endfor %}
53+
},
54+
{% endmacro %}
4055
{% endif %}

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

+5
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,13 @@
4545
},
4646
{%- endmacro %}
4747

48+
{% if (SYSTEM_DEFAULTS is defined) and ('tunnel_qos_remap' in SYSTEM_DEFAULTS) and (SYSTEM_DEFAULTS['tunnel_qos_remap']['status'] == 'enabled') %}
4849
{% import 'buffers_extra_queues.j2' as defs with context %}
4950

5051
{%- macro generate_queue_buffers_with_extra_lossless_queues(port_names, port_names_require_extra_buffer) %}
5152
{{ defs.generate_queue_buffers_with_extra_lossless_queues(port_names, port_names_require_extra_buffer) }}
5253
{%- endmacro %}
54+
{%- macro generate_pg_profiles_with_extra_lossy_pgs(port_names, port_names_require_extra_lossless_pgs) %}
55+
{{ defs.generate_pg_profiles_with_extra_lossy_pgs(port_names, port_names_require_extra_lossless_pgs) }}
56+
{%- endmacro %}
57+
{% endif %}

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

+2
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,10 @@
5151
},
5252
{%- endmacro %}
5353

54+
{% if (SYSTEM_DEFAULTS is defined) and ('tunnel_qos_remap' in SYSTEM_DEFAULTS) and (SYSTEM_DEFAULTS['tunnel_qos_remap']['status'] == 'enabled') %}
5455
{% import 'buffers_extra_queues.j2' as defs with context %}
5556

5657
{%- macro generate_queue_buffers_with_extra_lossless_queues(port_names, port_names_require_extra_buffer) %}
5758
{{ defs.generate_queue_buffers_with_extra_lossless_queues(port_names, port_names_require_extra_buffer) }}
5859
{%- endmacro %}
60+
{% endif %}

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

+19-4
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,7 @@
77
"{{ port }}|0-1": {
88
"profile" : "egress_lossy_profile"
99
},
10-
"{{ port }}|2": {
11-
"profile" : "egress_lossless_profile"
12-
},
13-
"{{ port }}|3-4": {
10+
"{{ port }}|2-4": {
1411
"profile" : "egress_lossless_profile"
1512
},
1613
"{{ port }}|5": {
@@ -38,4 +35,22 @@
3835
{% endfor %}
3936
}
4037
{% endmacro %}
38+
{%- macro generate_pg_profiles_with_extra_lossy_pgs(port_names, port_names_require_extra_lossless_pgs) %}
39+
"BUFFER_PG": {
40+
{% for port in port_names.split(',') %}
41+
{% if port not in port_names_require_extra_lossless_pgs.split(',') %}
42+
"{{ port }}|2": {
43+
"profile" : "ingress_lossy_profile"
44+
},
45+
"{{ port }}|6": {
46+
"profile" : "ingress_lossy_profile"
47+
},
48+
{% endif %}
49+
"{{ port }}|0": {
50+
"profile" : "ingress_lossy_profile"
51+
}{% if not loop.last %},{% endif %}
52+
53+
{% endfor %}
54+
},
55+
{% endmacro %}
4156
{% endif %}

device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D108C8/buffers_defaults_t0.j2

+5
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,13 @@
5353
},
5454
{%- endmacro %}
5555

56+
{% if (SYSTEM_DEFAULTS is defined) and ('tunnel_qos_remap' in SYSTEM_DEFAULTS) and (SYSTEM_DEFAULTS['tunnel_qos_remap']['status'] == 'enabled') %}
5657
{% import 'buffers_extra_queues.j2' as defs with context %}
5758

5859
{%- macro generate_queue_buffers_with_extra_lossless_queues(port_names, port_names_require_extra_buffer) %}
5960
{{ defs.generate_queue_buffers_with_extra_lossless_queues(port_names, port_names_require_extra_buffer) }}
6061
{%- endmacro %}
62+
{%- macro generate_pg_profiles_with_extra_lossy_pgs(port_names, port_names_require_extra_lossless_pgs) %}
63+
{{ defs.generate_pg_profiles_with_extra_lossy_pgs(port_names, port_names_require_extra_lossless_pgs) }}
64+
{%- endmacro %}
65+
{% endif %}

device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-Q64/buffers_defaults_t0.j2

+5
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,13 @@
4545
},
4646
{%- endmacro %}
4747

48+
{% if (SYSTEM_DEFAULTS is defined) and ('tunnel_qos_remap' in SYSTEM_DEFAULTS) and (SYSTEM_DEFAULTS['tunnel_qos_remap']['status'] == 'enabled') %}
4849
{% import 'buffers_extra_queues.j2' as defs with context %}
4950

5051
{%- macro generate_queue_buffers_with_extra_lossless_queues(port_names, port_names_require_extra_buffer) %}
5152
{{ defs.generate_queue_buffers_with_extra_lossless_queues(port_names, port_names_require_extra_buffer) }}
5253
{%- endmacro %}
54+
{%- macro generate_pg_profiles_with_extra_lossy_pgs(port_names, port_names_require_extra_lossless_pgs) %}
55+
{{ defs.generate_pg_profiles_with_extra_lossy_pgs(port_names, port_names_require_extra_lossless_pgs) }}
56+
{%- endmacro %}
57+
{% endif %}

device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-Q64/buffers_defaults_t1.j2

+2
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,10 @@
4545
},
4646
{%- endmacro %}
4747

48+
{% if (SYSTEM_DEFAULTS is defined) and ('tunnel_qos_remap' in SYSTEM_DEFAULTS) and (SYSTEM_DEFAULTS['tunnel_qos_remap']['status'] == 'enabled') %}
4849
{% import 'buffers_extra_queues.j2' as defs with context %}
4950

5051
{%- macro generate_queue_buffers_with_extra_lossless_queues(port_names, port_names_require_extra_buffer) %}
5152
{{ defs.generate_queue_buffers_with_extra_lossless_queues(port_names, port_names_require_extra_buffer) }}
5253
{%- endmacro %}
54+
{% endif %}

files/build_templates/buffers_config.j2

+4
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,10 @@ def
172172
{{ defs.generate_pg_profils(port_names_active) }}
173173
{% elif defs.generate_pg_profiles_with_inactive_ports is defined %}
174174
{{ defs.generate_pg_profiles_with_inactive_ports(port_names_active, port_names_inactive) }},
175+
{% elif defs.generate_pg_profiles_with_extra_lossy_pgs is defined %}
176+
{{ defs.generate_pg_profiles_with_extra_lossy_pgs(port_names_active, port_names_extra_queues) }}
177+
{% elif defs.generate_pg_profiles_with_extra_lossy_pgs_with_inactive_ports is defined %}
178+
{{ defs.generate_pg_profiles_with_extra_lossy_pgs_with_inactive_ports(port_names_active, port_names_extra_queues, port_names_inactive) }}
175179
{% else %}
176180
"BUFFER_PG": {
177181
{% for port in PORT_ACTIVE %}

src/sonic-config-engine/tests/sample-arista-7050cx3-dualtor-minigraph.xml

+8
Original file line numberDiff line numberDiff line change
@@ -2339,6 +2339,14 @@
23392339
</Devices>
23402340
<Properties xmlns:a="http://schemas.datacontract.org/2004/07/Microsoft.Search.Autopilot.Evolution"/>
23412341
</MetadataDeclaration>
2342+
<SystemDefaultsDeclaration>
2343+
<a:SystemDefaults xmlns:a="http://schemas.datacontract.org/2004/07/Microsoft.Search.Autopilot.Evolution">
2344+
<a:SystemDefault>
2345+
<a:Name>TunnelQosRemapEnabled</a:Name>
2346+
<a:Value>True</a:Value>
2347+
</a:SystemDefault>
2348+
</a:SystemDefaults>
2349+
</SystemDefaultsDeclaration>
23422350
<LinkMetadataDeclaration>
23432351
<Link xmlns:a="http://schemas.datacontract.org/2004/07/Microsoft.Search.Autopilot.Evolution">
23442352
<a:LinkMetadata>

src/sonic-config-engine/tests/sample-arista-7260-dualtor-minigraph.xml

+8
Original file line numberDiff line numberDiff line change
@@ -4605,6 +4605,14 @@
46054605
</Devices>
46064606
<Properties xmlns:a="http://schemas.datacontract.org/2004/07/Microsoft.Search.Autopilot.Evolution"/>
46074607
</MetadataDeclaration>
4608+
<SystemDefaultsDeclaration>
4609+
<a:SystemDefaults xmlns:a="http://schemas.datacontract.org/2004/07/Microsoft.Search.Autopilot.Evolution">
4610+
<a:SystemDefault>
4611+
<a:Name>TunnelQosRemapEnabled</a:Name>
4612+
<a:Value>True</a:Value>
4613+
</a:SystemDefault>
4614+
</a:SystemDefaults>
4615+
</SystemDefaultsDeclaration>
46084616
<LinkMetadataDeclaration>
46094617
<Link xmlns:a="http://schemas.datacontract.org/2004/07/Microsoft.Search.Autopilot.Evolution">
46104618
<a:LinkMetadata>

src/sonic-config-engine/tests/sample-arista-7260-t1-minigraph.xml

+8
Original file line numberDiff line numberDiff line change
@@ -2486,6 +2486,14 @@
24862486
</Devices>
24872487
<Properties xmlns:a="http://schemas.datacontract.org/2004/07/Microsoft.Search.Autopilot.Evolution"/>
24882488
</MetadataDeclaration>
2489+
<SystemDefaultsDeclaration>
2490+
<a:SystemDefaults xmlns:a="http://schemas.datacontract.org/2004/07/Microsoft.Search.Autopilot.Evolution">
2491+
<a:SystemDefault>
2492+
<a:Name>TunnelQosRemapEnabled</a:Name>
2493+
<a:Value>True</a:Value>
2494+
</a:SystemDefault>
2495+
</a:SystemDefaults>
2496+
</SystemDefaultsDeclaration>
24892497
<Hostname>str-7260cx3-acs-7</Hostname>
24902498
<HwSku>Arista-7260CX3-C64</HwSku>
24912499
</DeviceMiniGraph>

0 commit comments

Comments
 (0)