Skip to content

Commit bded713

Browse files
committed
Align the buffer templates of SN5400 to the latest ones
1 parent 9aec8dc commit bded713

4 files changed

Lines changed: 42 additions & 398 deletions

File tree

device/mellanox/x86_64-nvidia_sn5400-r0/ACS-SN5400/buffers_defaults_t0.j2

Lines changed: 10 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -20,109 +20,20 @@
2020
{% set egress_lossless_pool_size = '158229504' %}
2121
{% set egress_lossy_pool_size = '67737959' %}
2222

23-
{%- macro generate_port_lists(PORT_ALL) %}
24-
{# Generate list of ports #}
25-
{%- for port_idx in range(0, 32) %}
26-
{%- if PORT_ALL.append("Ethernet%d" % (port_idx)) %}{%- endif %}
27-
{%- endfor %}
28-
{%- endmacro %}
23+
{% import 'buffers_defaults_objects.j2' as defs with context %}
2924

30-
{%- macro generate_buffer_pool_and_profiles() %}
31-
"BUFFER_POOL": {
32-
"ingress_lossless_pool": {
33-
{%- if dynamic_mode is not defined %}
34-
"size": "{{ ingress_lossless_pool_size }}",
35-
{%- endif %}
36-
"type": "ingress",
37-
"mode": "dynamic"
38-
},
39-
"ingress_lossy_pool": {
40-
{%- if dynamic_mode is not defined %}
41-
"size": "{{ ingress_lossy_pool_size }}",
42-
{%- endif %}
43-
"type": "ingress",
44-
"mode": "dynamic"
45-
},
46-
"egress_lossless_pool": {
47-
"size": "{{ egress_lossless_pool_size }}",
48-
"type": "egress",
49-
"mode": "dynamic"
50-
},
51-
"egress_lossy_pool": {
52-
{%- if dynamic_mode is not defined %}
53-
"size": "{{ egress_lossy_pool_size }}",
54-
{%- endif %}
55-
"type": "egress",
56-
"mode": "dynamic"
57-
}
58-
},
59-
"BUFFER_PROFILE": {
60-
"ingress_lossless_profile": {
61-
"pool":"ingress_lossless_pool",
62-
"size":"0",
63-
"dynamic_th":"7"
64-
},
65-
"ingress_lossy_profile": {
66-
"pool":"ingress_lossy_pool",
67-
"size":"0",
68-
"dynamic_th":"3"
69-
},
70-
"egress_lossless_profile": {
71-
"pool":"egress_lossless_pool",
72-
"size":"0",
73-
"dynamic_th":"7"
74-
},
75-
"egress_lossy_profile": {
76-
"pool":"egress_lossy_pool",
77-
"size":"9216",
78-
"dynamic_th":"7"
79-
},
80-
"q_lossy_profile": {
81-
"pool":"egress_lossy_pool",
82-
"size":"0",
83-
"dynamic_th":"3"
84-
}
85-
},
25+
{%- macro generate_buffer_pool_and_profiles_with_inactive_ports(port_names_inactive) %}
26+
{{ defs.generate_buffer_pool_and_profiles_with_inactive_ports(port_names_inactive) }}
8627
{%- endmacro %}
8728

88-
{%- macro generate_profile_lists(port_names) %}
89-
"BUFFER_PORT_INGRESS_PROFILE_LIST": {
90-
{% for port in port_names.split(',') %}
91-
"{{ port }}": {
92-
"profile_list" : "ingress_lossless_profile,ingress_lossy_profile"
93-
}{% if not loop.last %},{% endif %}
94-
95-
{% endfor %}
96-
},
97-
"BUFFER_PORT_EGRESS_PROFILE_LIST": {
98-
{% for port in port_names.split(',') %}
99-
"{{ port }}": {
100-
"profile_list" : "egress_lossless_profile,egress_lossy_profile"
101-
}{% if not loop.last %},{% endif %}
102-
103-
{% endfor %}
104-
}
29+
{%- macro generate_profile_lists_with_inactive_ports(port_names_active, port_names_inactive) %}
30+
{{ defs.generate_profile_lists(port_names_active, port_names_inactive) }}
10531
{%- endmacro %}
10632

107-
{%- macro generate_queue_buffers(port_names) %}
108-
"BUFFER_QUEUE": {
109-
{% for port in port_names.split(',') %}
110-
"{{ port }}|3-4": {
111-
"profile" : "egress_lossless_profile"
112-
},
113-
{% endfor %}
114-
{% for port in port_names.split(',') %}
115-
"{{ port }}|0-2": {
116-
"profile" : "q_lossy_profile"
117-
},
118-
{% endfor %}
119-
{% for port in port_names.split(',') %}
120-
"{{ port }}|5-6": {
121-
"profile" : "q_lossy_profile"
122-
}{% if not loop.last %},{% endif %}
123-
124-
{% endfor %}
125-
}
33+
{%- macro generate_queue_buffers_with_inactive_ports(port_names_active, port_names_inactive) %}
34+
{{ defs.generate_queue_buffers(port_names_active, port_names_inactive) }}
12635
{%- endmacro %}
12736

128-
37+
{%- macro generate_pg_profiles_with_inactive_ports(port_names_active, port_names_inactive) %}
38+
{{ defs.generate_pg_profiles(port_names_active, port_names_inactive) }}
39+
{%- endmacro %}
Lines changed: 11 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{#
2-
Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES.
2+
Copyright (c) 2021-2024 NVIDIA CORPORATION & AFFILIATES.
33
Apache-2.0
44

55
Licensed under the Apache License, Version 2.0 (the "License");
@@ -20,109 +20,20 @@
2020
{% set egress_lossless_pool_size = '158229504' %}
2121
{% set egress_lossy_pool_size = '52161690' %}
2222

23-
{%- macro generate_port_lists(PORT_ALL) %}
24-
{# Generate list of ports #}
25-
{%- for port_idx in range(0, 32) %}
26-
{%- if PORT_ALL.append("Ethernet%d" % (port_idx)) %}{%- endif %}
27-
{%- endfor %}
28-
{%- endmacro %}
23+
{% import 'buffers_defaults_objects.j2' as defs with context %}
2924

30-
{%- macro generate_buffer_pool_and_profiles() %}
31-
"BUFFER_POOL": {
32-
"ingress_lossless_pool": {
33-
{%- if dynamic_mode is not defined %}
34-
"size": "{{ ingress_lossless_pool_size }}",
35-
{%- endif %}
36-
"type": "ingress",
37-
"mode": "dynamic"
38-
},
39-
"ingress_lossy_pool": {
40-
{%- if dynamic_mode is not defined %}
41-
"size": "{{ ingress_lossy_pool_size }}",
42-
{%- endif %}
43-
"type": "ingress",
44-
"mode": "dynamic"
45-
},
46-
"egress_lossless_pool": {
47-
"size": "{{ egress_lossless_pool_size }}",
48-
"type": "egress",
49-
"mode": "dynamic"
50-
},
51-
"egress_lossy_pool": {
52-
{%- if dynamic_mode is not defined %}
53-
"size": "{{ egress_lossy_pool_size }}",
54-
{%- endif %}
55-
"type": "egress",
56-
"mode": "dynamic"
57-
}
58-
},
59-
"BUFFER_PROFILE": {
60-
"ingress_lossless_profile": {
61-
"pool":"ingress_lossless_pool",
62-
"size":"0",
63-
"dynamic_th":"7"
64-
},
65-
"ingress_lossy_profile": {
66-
"pool":"ingress_lossy_pool",
67-
"size":"0",
68-
"dynamic_th":"3"
69-
},
70-
"egress_lossless_profile": {
71-
"pool":"egress_lossless_pool",
72-
"size":"0",
73-
"dynamic_th":"7"
74-
},
75-
"egress_lossy_profile": {
76-
"pool":"egress_lossy_pool",
77-
"size":"9216",
78-
"dynamic_th":"7"
79-
},
80-
"q_lossy_profile": {
81-
"pool":"egress_lossy_pool",
82-
"size":"0",
83-
"dynamic_th":"3"
84-
}
85-
},
25+
{%- macro generate_buffer_pool_and_profiles_with_inactive_ports(port_names_inactive) %}
26+
{{ defs.generate_buffer_pool_and_profiles_with_inactive_ports(port_names_inactive) }}
8627
{%- endmacro %}
8728

88-
{%- macro generate_profile_lists(port_names) %}
89-
"BUFFER_PORT_INGRESS_PROFILE_LIST": {
90-
{% for port in port_names.split(',') %}
91-
"{{ port }}": {
92-
"profile_list" : "ingress_lossless_profile,ingress_lossy_profile"
93-
}{% if not loop.last %},{% endif %}
94-
95-
{% endfor %}
96-
},
97-
"BUFFER_PORT_EGRESS_PROFILE_LIST": {
98-
{% for port in port_names.split(',') %}
99-
"{{ port }}": {
100-
"profile_list" : "egress_lossless_profile,egress_lossy_profile"
101-
}{% if not loop.last %},{% endif %}
102-
103-
{% endfor %}
104-
}
29+
{%- macro generate_profile_lists_with_inactive_ports(port_names_active, port_names_inactive) %}
30+
{{ defs.generate_profile_lists(port_names_active, port_names_inactive) }}
10531
{%- endmacro %}
10632

107-
{%- macro generate_queue_buffers(port_names) %}
108-
"BUFFER_QUEUE": {
109-
{% for port in port_names.split(',') %}
110-
"{{ port }}|3-4": {
111-
"profile" : "egress_lossless_profile"
112-
},
113-
{% endfor %}
114-
{% for port in port_names.split(',') %}
115-
"{{ port }}|0-2": {
116-
"profile" : "q_lossy_profile"
117-
},
118-
{% endfor %}
119-
{% for port in port_names.split(',') %}
120-
"{{ port }}|5-6": {
121-
"profile" : "q_lossy_profile"
122-
}{% if not loop.last %},{% endif %}
123-
124-
{% endfor %}
125-
}
33+
{%- macro generate_queue_buffers_with_inactive_ports(port_names_active, port_names_inactive) %}
34+
{{ defs.generate_queue_buffers(port_names_active, port_names_inactive) }}
12635
{%- endmacro %}
12736

128-
37+
{%- macro generate_pg_profiles_with_inactive_ports(port_names_active, port_names_inactive) %}
38+
{{ defs.generate_pg_profiles(port_names_active, port_names_inactive) }}
39+
{%- endmacro %}

device/mellanox/x86_64-nvidia_sn5400_simx-r0/ACS-SN5400/buffers_defaults_t0.j2

Lines changed: 10 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -20,109 +20,20 @@
2020
{% set egress_lossless_pool_size = '158229504' %}
2121
{% set egress_lossy_pool_size = '67737959' %}
2222

23-
{%- macro generate_port_lists(PORT_ALL) %}
24-
{# Generate list of ports #}
25-
{%- for port_idx in range(0, 32) %}
26-
{%- if PORT_ALL.append("Ethernet%d" % (port_idx)) %}{%- endif %}
27-
{%- endfor %}
28-
{%- endmacro %}
23+
{% import 'buffers_defaults_objects.j2' as defs with context %}
2924

30-
{%- macro generate_buffer_pool_and_profiles() %}
31-
"BUFFER_POOL": {
32-
"ingress_lossless_pool": {
33-
{%- if dynamic_mode is not defined %}
34-
"size": "{{ ingress_lossless_pool_size }}",
35-
{%- endif %}
36-
"type": "ingress",
37-
"mode": "dynamic"
38-
},
39-
"ingress_lossy_pool": {
40-
{%- if dynamic_mode is not defined %}
41-
"size": "{{ ingress_lossy_pool_size }}",
42-
{%- endif %}
43-
"type": "ingress",
44-
"mode": "dynamic"
45-
},
46-
"egress_lossless_pool": {
47-
"size": "{{ egress_lossless_pool_size }}",
48-
"type": "egress",
49-
"mode": "dynamic"
50-
},
51-
"egress_lossy_pool": {
52-
{%- if dynamic_mode is not defined %}
53-
"size": "{{ egress_lossy_pool_size }}",
54-
{%- endif %}
55-
"type": "egress",
56-
"mode": "dynamic"
57-
}
58-
},
59-
"BUFFER_PROFILE": {
60-
"ingress_lossless_profile": {
61-
"pool":"ingress_lossless_pool",
62-
"size":"0",
63-
"dynamic_th":"7"
64-
},
65-
"ingress_lossy_profile": {
66-
"pool":"ingress_lossy_pool",
67-
"size":"0",
68-
"dynamic_th":"3"
69-
},
70-
"egress_lossless_profile": {
71-
"pool":"egress_lossless_pool",
72-
"size":"0",
73-
"dynamic_th":"7"
74-
},
75-
"egress_lossy_profile": {
76-
"pool":"egress_lossy_pool",
77-
"size":"9216",
78-
"dynamic_th":"7"
79-
},
80-
"q_lossy_profile": {
81-
"pool":"egress_lossy_pool",
82-
"size":"0",
83-
"dynamic_th":"3"
84-
}
85-
},
25+
{%- macro generate_buffer_pool_and_profiles_with_inactive_ports(port_names_inactive) %}
26+
{{ defs.generate_buffer_pool_and_profiles_with_inactive_ports(port_names_inactive) }}
8627
{%- endmacro %}
8728

88-
{%- macro generate_profile_lists(port_names) %}
89-
"BUFFER_PORT_INGRESS_PROFILE_LIST": {
90-
{% for port in port_names.split(',') %}
91-
"{{ port }}": {
92-
"profile_list" : "ingress_lossless_profile,ingress_lossy_profile"
93-
}{% if not loop.last %},{% endif %}
94-
95-
{% endfor %}
96-
},
97-
"BUFFER_PORT_EGRESS_PROFILE_LIST": {
98-
{% for port in port_names.split(',') %}
99-
"{{ port }}": {
100-
"profile_list" : "egress_lossless_profile,egress_lossy_profile"
101-
}{% if not loop.last %},{% endif %}
102-
103-
{% endfor %}
104-
}
29+
{%- macro generate_profile_lists_with_inactive_ports(port_names_active, port_names_inactive) %}
30+
{{ defs.generate_profile_lists(port_names_active, port_names_inactive) }}
10531
{%- endmacro %}
10632

107-
{%- macro generate_queue_buffers(port_names) %}
108-
"BUFFER_QUEUE": {
109-
{% for port in port_names.split(',') %}
110-
"{{ port }}|3-4": {
111-
"profile" : "egress_lossless_profile"
112-
},
113-
{% endfor %}
114-
{% for port in port_names.split(',') %}
115-
"{{ port }}|0-2": {
116-
"profile" : "q_lossy_profile"
117-
},
118-
{% endfor %}
119-
{% for port in port_names.split(',') %}
120-
"{{ port }}|5-6": {
121-
"profile" : "q_lossy_profile"
122-
}{% if not loop.last %},{% endif %}
123-
124-
{% endfor %}
125-
}
33+
{%- macro generate_queue_buffers_with_inactive_ports(port_names_active, port_names_inactive) %}
34+
{{ defs.generate_queue_buffers(port_names_active, port_names_inactive) }}
12635
{%- endmacro %}
12736

128-
37+
{%- macro generate_pg_profiles_with_inactive_ports(port_names_active, port_names_inactive) %}
38+
{{ defs.generate_pg_profiles(port_names_active, port_names_inactive) }}
39+
{%- endmacro %}

0 commit comments

Comments
 (0)