|
4 | 4 | {%- if port_names_list.append(port) %}{% endif %}
|
5 | 5 | {% endfor %}
|
6 | 6 | {% set port_names = port_names_list | join(',') %}
|
| 7 | +{% set switch_role = DEVICE_METADATA['localhost']['type'] %} |
| 8 | +{%if switch_role == 'ToRRouter' %} |
| 9 | +{% set ingress_lossless_pool_size = '4194304' %} |
| 10 | +{% set ingress_lossy_pool_size = '7340032' %} |
| 11 | +{% set egress_lossless_pool_size = '16777152' %} |
| 12 | +{% set egress_lossy_pool_size = '7340032' %} |
| 13 | +{% else %} |
| 14 | +{% set ingress_lossless_pool_size = '2097152' %} |
| 15 | +{% set ingress_lossy_pool_size = '5242880' %} |
| 16 | +{% set egress_lossless_pool_size = '16777152' %} |
| 17 | +{% set egress_lossy_pool_size = '5242880' %} |
| 18 | +{%endif %} |
| 19 | + { |
| 20 | + "BUFFER_POOL_TABLE:ingress_lossless_pool": { |
| 21 | + "size": "{{ ingress_lossless_pool_size }}", |
| 22 | + "type": "ingress", |
| 23 | + "mode": "dynamic" |
| 24 | + }, |
| 25 | + "OP": "SET" |
| 26 | + }, |
7 | 27 | {
|
8 | 28 | "BUFFER_POOL_TABLE:ingress_lossy_pool": {
|
9 |
| - "size": "6422528", |
| 29 | + "size": "{{ ingress_lossy_pool_size }}", |
10 | 30 | "type": "ingress",
|
11 | 31 | "mode": "dynamic"
|
12 | 32 | },
|
13 | 33 | "OP": "SET"
|
14 | 34 | },
|
15 | 35 | {
|
16 | 36 | "BUFFER_POOL_TABLE:egress_lossless_pool": {
|
17 |
| - "size": "7291456", |
| 37 | + "size": "{{ egress_lossless_pool_size }}", |
18 | 38 | "type": "egress",
|
19 | 39 | "mode": "dynamic"
|
20 | 40 | },
|
21 | 41 | "OP": "SET"
|
22 | 42 | },
|
23 | 43 | {
|
24 | 44 | "BUFFER_POOL_TABLE:egress_lossy_pool": {
|
25 |
| - "size": "8254464", |
| 45 | + "size": "{{ egress_lossy_pool_size }}", |
26 | 46 | "type": "egress",
|
27 | 47 | "mode": "dynamic"
|
28 | 48 | },
|
|
32 | 52 | "BUFFER_PROFILE_TABLE:ingress_lossless_profile": {
|
33 | 53 | "pool":"[BUFFER_POOL_TABLE:ingress_lossless_pool]",
|
34 | 54 | "size":"0",
|
35 |
| - "dynamic_th":"1" |
| 55 | + "dynamic_th":"0" |
36 | 56 | },
|
37 | 57 | "OP": "SET"
|
38 | 58 | },
|
39 | 59 | {
|
40 | 60 | "BUFFER_PROFILE_TABLE:ingress_lossy_profile": {
|
41 | 61 | "pool":"[BUFFER_POOL_TABLE:ingress_lossy_pool]",
|
42 | 62 | "size":"0",
|
43 |
| - "dynamic_th":"7" |
| 63 | + "dynamic_th":"3" |
44 | 64 | },
|
45 | 65 | "OP": "SET"
|
46 | 66 | },
|
|
56 | 76 | "BUFFER_PROFILE_TABLE:egress_lossy_profile": {
|
57 | 77 | "pool":"[BUFFER_POOL_TABLE:egress_lossy_pool]",
|
58 | 78 | "size":"4096",
|
59 |
| - "dynamic_th":"7" |
| 79 | + "dynamic_th":"3" |
60 | 80 | },
|
61 | 81 | "OP": "SET"
|
62 | 82 | },
|
63 | 83 | {
|
64 | 84 | "BUFFER_PROFILE_TABLE:pg_lossy_profile": {
|
65 | 85 | "pool":"[BUFFER_POOL_TABLE:ingress_lossy_pool]",
|
66 | 86 | "size":"0",
|
67 |
| - "dynamic_th":"7" |
| 87 | + "dynamic_th":"3" |
68 | 88 | },
|
69 | 89 | "OP": "SET"
|
70 | 90 | },
|
|
80 | 100 | "BUFFER_PROFILE_TABLE:q_lossy_profile": {
|
81 | 101 | "pool":"[BUFFER_POOL_TABLE:egress_lossy_pool]",
|
82 | 102 | "size":"0",
|
83 |
| - "dynamic_th":"7" |
| 103 | + "dynamic_th":"3" |
84 | 104 | },
|
85 | 105 | "OP": "SET"
|
86 | 106 | },
|
|
98 | 118 | },
|
99 | 119 |
|
100 | 120 | {# The following template part is for variable PG profile configuration #}
|
101 |
| -{% set non_pg_lossless_pool_size = 866726 %} |
102 | 121 | {% set pg_range = '3-4' %}
|
103 | 122 | {# Lists of supported speed and cable length #}
|
104 | 123 | {% set supported_speed = [10000, 25000, 40000, 50000, 100000] %}
|
|
129 | 148 | {# PG profiles. All profiles reffered in portconfig2profile dictionary should be declared here #}
|
130 | 149 | {# Only those which were actually used will be created in SAI #}
|
131 | 150 | {%- set pg_profiles = {
|
132 |
| - 'pg_lossless_10G_5m_profile': { 'xon': 18432, 'xoff': 16384, 'size': 34816, 'dynamic_th': 1 }, |
133 |
| - 'pg_lossless_25G_5m_profile': { 'xon': 18432, 'xoff': 16384, 'size': 34816, 'dynamic_th': 1 }, |
134 |
| - 'pg_lossless_40G_5m_profile': { 'xon': 18432, 'xoff': 16384, 'size': 34816, 'dynamic_th': 1 }, |
135 |
| - 'pg_lossless_50G_5m_profile': { 'xon': 18432, 'xoff': 16384, 'size': 34816, 'dynamic_th': 1 }, |
136 |
| - 'pg_lossless_100G_5m_profile': { 'xon': 18432, 'xoff': 18432, 'size': 36864, 'dynamic_th': 1 }, |
| 151 | + 'pg_lossless_10G_5m_profile': { 'xon': 18432, 'xoff': 16384, 'size': 34816, 'dynamic_th': 0 }, |
| 152 | + 'pg_lossless_25G_5m_profile': { 'xon': 18432, 'xoff': 16384, 'size': 34816, 'dynamic_th': 0 }, |
| 153 | + 'pg_lossless_40G_5m_profile': { 'xon': 18432, 'xoff': 16384, 'size': 34816, 'dynamic_th': 0 }, |
| 154 | + 'pg_lossless_50G_5m_profile': { 'xon': 18432, 'xoff': 16384, 'size': 34816, 'dynamic_th': 0 }, |
| 155 | + 'pg_lossless_100G_5m_profile': { 'xon': 18432, 'xoff': 18432, 'size': 36864, 'dynamic_th': 0 }, |
137 | 156 |
|
138 |
| - 'pg_lossless_10G_40m_profile': { 'xon': 18432, 'xoff': 18432, 'size': 36864, 'dynamic_th': 1 }, |
139 |
| - 'pg_lossless_25G_40m_profile': { 'xon': 18432, 'xoff': 21504, 'size': 39936, 'dynamic_th': 1 }, |
140 |
| - 'pg_lossless_40G_40m_profile': { 'xon': 18432, 'xoff': 23552, 'size': 41984, 'dynamic_th': 1 }, |
141 |
| - 'pg_lossless_50G_40m_profile': { 'xon': 18432, 'xoff': 23552, 'size': 41984, 'dynamic_th': 1 }, |
142 |
| - 'pg_lossless_100G_40m_profile': { 'xon': 18432, 'xoff': 35840, 'size': 54272, 'dynamic_th': 1 }, |
| 157 | + 'pg_lossless_10G_40m_profile': { 'xon': 18432, 'xoff': 18432, 'size': 36864, 'dynamic_th': 0 }, |
| 158 | + 'pg_lossless_25G_40m_profile': { 'xon': 18432, 'xoff': 21504, 'size': 39936, 'dynamic_th': 0 }, |
| 159 | + 'pg_lossless_40G_40m_profile': { 'xon': 18432, 'xoff': 23552, 'size': 41984, 'dynamic_th': 0 }, |
| 160 | + 'pg_lossless_50G_40m_profile': { 'xon': 18432, 'xoff': 23552, 'size': 41984, 'dynamic_th': 0 }, |
| 161 | + 'pg_lossless_100G_40m_profile': { 'xon': 18432, 'xoff': 35840, 'size': 54272, 'dynamic_th': 0 }, |
143 | 162 |
|
144 |
| - 'pg_lossless_10G_300m_profile': { 'xon': 18432, 'xoff': 30720, 'size': 49152, 'dynamic_th': 1 }, |
145 |
| - 'pg_lossless_25G_300m_profile': { 'xon': 18432, 'xoff': 53248, 'size': 71680, 'dynamic_th': 1 }, |
146 |
| - 'pg_lossless_40G_300m_profile': { 'xon': 18432, 'xoff': 75776, 'size': 94208, 'dynamic_th': 1 }, |
147 |
| - 'pg_lossless_50G_300m_profile': { 'xon': 18432, 'xoff': 75776, 'size': 94208, 'dynamic_th': 1 }, |
148 |
| - 'pg_lossless_100G_300m_profile':{ 'xon': 18432, 'xoff': 165888,'size': 184320,'dynamic_th': 1 }, |
| 163 | + 'pg_lossless_10G_300m_profile': { 'xon': 18432, 'xoff': 30720, 'size': 49152, 'dynamic_th': 0 }, |
| 164 | + 'pg_lossless_25G_300m_profile': { 'xon': 18432, 'xoff': 53248, 'size': 71680, 'dynamic_th': 0 }, |
| 165 | + 'pg_lossless_40G_300m_profile': { 'xon': 18432, 'xoff': 75776, 'size': 94208, 'dynamic_th': 0 }, |
| 166 | + 'pg_lossless_50G_300m_profile': { 'xon': 18432, 'xoff': 75776, 'size': 94208, 'dynamic_th': 0 }, |
| 167 | + 'pg_lossless_100G_300m_profile':{ 'xon': 18432, 'xoff': 165888,'size': 184320,'dynamic_th': 0 }, |
149 | 168 | }
|
150 | 169 | -%}
|
151 | 170 |
|
|
159 | 178 | }
|
160 | 179 | %}
|
161 | 180 |
|
162 |
| -{% set switch_role = DEVICE_METADATA['localhost']['type'] %} |
163 |
| - |
164 |
| -{%- macro cable_length(port_name) -%} |
| 181 | +{% macro cable_length(port_name) -%} |
165 | 182 | {%- set cable_len = [] -%}
|
166 | 183 | {%- for local_port in DEVICE_NEIGHBOR -%}
|
167 | 184 | {%- if local_port == port_name -%}
|
168 |
| - {%- if DEVICE_NEIGHBOR_METADATA[DEVICE_NEIGHBOR[local_port].name] -%} |
| 185 | + {%- if DEVICE_NEIGHBOR_METADATA is defined and DEVICE_NEIGHBOR_METADATA[DEVICE_NEIGHBOR[local_port].name] -%} |
169 | 186 | {%- set neighbor = DEVICE_NEIGHBOR_METADATA[DEVICE_NEIGHBOR[local_port].name] -%}
|
170 | 187 | {%- set neighbor_role = neighbor.type -%}
|
171 | 188 | {%- set roles1 = switch_role + '_' + neighbor_role %}
|
|
201 | 218 | {{ new_speed.0 }}_{{ new_cable.0 }}
|
202 | 219 | {%- endmacro -%}
|
203 | 220 |
|
204 |
| -{% set ingress_lossless_pg_pool_size = [] %} |
205 | 221 | {% set used_pg_profiles = [] %}
|
206 | 222 | {% for port in PORT %}
|
207 | 223 | {%- if PORT[port].speed -%}
|
|
215 | 231 | {% set port_config = find_closest_greater_config(speed, cable) -%}
|
216 | 232 | {%- endif -%}
|
217 | 233 | {% set profile = portconfig2profile[port_config] -%}
|
218 |
| - {% if ingress_lossless_pg_pool_size.append(pg_profiles[profile]['size']) %}{% endif %} |
219 | 234 | {# add to list profiles which were actually used #}
|
220 |
| - {%- if profile not in used_pg_profiles and used_pg_profiles.append(profile) %}{% endif -%} |
| 235 | + {%- if profile not in used_pg_profiles and used_pg_profiles.append(profile) %}{% endif %} |
221 | 236 | {
|
222 | 237 | "BUFFER_PG_TABLE:{{ port }}:{{ pg_range }}": {
|
223 | 238 | "profile" : "[BUFFER_PROFILE_TABLE:{{ profile }}]"
|
|
240 | 255 | },
|
241 | 256 | "OP": "SET"
|
242 | 257 | },
|
243 |
| -{% endfor -%} |
244 |
| - |
245 |
| - {# Lossless pool declaration #} |
246 |
| - { |
247 |
| - "BUFFER_POOL_TABLE:ingress_lossless_pool": { |
248 |
| - "size": "{{ ingress_lossless_pg_pool_size | sum + non_pg_lossless_pool_size }}", |
249 |
| - "type": "ingress", |
250 |
| - "mode": "dynamic" |
251 |
| - }, |
252 |
| - "OP": "SET" |
253 |
| - }, |
| 258 | +{% endfor %} |
254 | 259 | {
|
255 | 260 | "BUFFER_PG_TABLE:{{ port_names }}:0-1": {
|
256 | 261 | "profile" : "[BUFFER_PROFILE_TABLE:pg_lossy_profile]"
|
|
0 commit comments