-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Buffers configuration update on port speed change (#1250)
* Move buffer configuration to ConfigDB Signed-off-by: Andriy Moroz <[email protected]> * Converted Dell and Arista configs Signed-off-by: Andriy Moroz <[email protected]> * Add buffer configs for ACS-MSN2740 Signed-off-by: Andriy Moroz <[email protected]> * Updated buffers template Signed-off-by: Andriy Moroz <[email protected]> * Fixed j2 unit test Signed-off-by: Andriy Moroz <[email protected]> * Update buffers config for Force10-S6100 Signed-off-by: Andriy Moroz <[email protected]> * Update VS docker to support speed and buffers test Signed-off-by: Andriy Moroz <[email protected]> * Update buffers config generation - fixed support of sonic-to-sonic install Signed-off-by: Andriy Moroz <[email protected]>
- Loading branch information
1 parent
6f12ff2
commit 814e50f
Showing
23 changed files
with
1,096 additions
and
610 deletions.
There are no files selected for viewing
135 changes: 135 additions & 0 deletions
135
device/arista/x86_64-arista_7050_qx32/Arista-7050-QX32/buffers.json.j2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,135 @@ | ||
{# Default values which will be used if no actual configura available #} | ||
{% set default_cable = '300m' %} | ||
{% set default_speed = '100G' %} | ||
{% set default_ports_num = 32 -%} | ||
|
||
{# Port configuration to cable length look-up table #} | ||
{# Each record describes mapping of DUT (DUT port) role and neighbor role to cable length #} | ||
{# Roles described in the minigraph #} | ||
{% set ports2cable = { | ||
'torrouter_server' : '5m', | ||
'leafrouter_torrouter' : '40m', | ||
'spinerouter_leafrouter' : '300m' | ||
} | ||
%} | ||
|
||
{%- macro cable_length(port_name) -%} | ||
{%- set cable_len = [] -%} | ||
{%- for local_port in DEVICE_NEIGHBOR -%} | ||
{%- if local_port == port_name -%} | ||
{%- if DEVICE_NEIGHBOR_METADATA[DEVICE_NEIGHBOR[local_port].name] -%} | ||
{%- set neighbor = DEVICE_NEIGHBOR_METADATA[DEVICE_NEIGHBOR[local_port].name] -%} | ||
{%- set neighbor_role = neighbor.type -%} | ||
{%- set roles1 = switch_role + '_' + neighbor_role %} | ||
{%- set roles2 = neighbor_role + '_' + switch_role -%} | ||
{%- set roles1 = roles1 | lower -%} | ||
{%- set roles2 = roles2 | lower -%} | ||
{%- if roles1 in ports2cable -%} | ||
{%- if cable_len.append(ports2cable[roles1]) -%}{%- endif -%} | ||
{%- elif roles2 in ports2cable -%} | ||
{%- if cable_len.append(ports2cable[roles2]) -%}{%- endif -%} | ||
{%- endif -%} | ||
{%- endif -%} | ||
{%- endif -%} | ||
{%- endfor -%} | ||
{%- if cable_len -%} | ||
{{ cable_len.0 }} | ||
{%- else -%} | ||
{{ default_cable }} | ||
{%- endif -%} | ||
{% endmacro %} | ||
|
||
{%- if DEVICE_METADATA is defined %} | ||
{%- set switch_role = DEVICE_METADATA['localhost']['type'] %} | ||
{%- endif -%} | ||
|
||
{# Generate list of ports if not defined #} | ||
{% if PORT is not defined %} | ||
{% set PORT = [] %} | ||
{% for port_idx in range(0,default_ports_num) %} | ||
{% if PORT.append("Ethernet%d" % (port_idx*4)) %}{% endif %} | ||
{% endfor %} | ||
{% endif -%} | ||
|
||
{% set port_names_list = [] %} | ||
{% for port in PORT %} | ||
{%- if port_names_list.append(port) %}{% endif %} | ||
{% endfor %} | ||
{% set port_names = port_names_list | join(',') -%} | ||
|
||
{ | ||
"CABLE_LENGTH": { | ||
"AZURE": { | ||
{% for port in PORT %} | ||
{% set cable = cable_length(port) -%} | ||
"{{ port }}": "{{ cable }}"{%- if not loop.last -%},{% endif %} | ||
|
||
{% endfor %} | ||
} | ||
}, | ||
"BUFFER_POOL": { | ||
"ingress_lossless_pool": { | ||
"size": "7274496", | ||
"type": "ingress", | ||
"mode": "static" | ||
}, | ||
"ingress_lossy_pool": { | ||
"size": "5491712", | ||
"type": "ingress", | ||
"mode": "dynamic" | ||
}, | ||
"egress_lossless_pool0": { | ||
"size": "3637248", | ||
"type": "egress", | ||
"mode": "static" | ||
}, | ||
"egress_lossless_pool1": { | ||
"size": "3637248", | ||
"type": "egress", | ||
"mode": "static" | ||
}, | ||
"egress_lossy_pool": { | ||
"size": "5491712", | ||
"type": "egress", | ||
"mode": "dynamic" | ||
} | ||
}, | ||
"BUFFER_PROFILE": { | ||
"ingress_lossy_profile": { | ||
"pool":"[BUFFER_POOL|ingress_lossy_pool]", | ||
"size":"1518", | ||
"dynamic_th":"3" | ||
}, | ||
"egress_lossless_profile0": { | ||
"pool":"[BUFFER_POOL|egress_lossless_pool0]", | ||
"size":"1518", | ||
"static_th":"3637248" | ||
}, | ||
"egress_lossless_profile1": { | ||
"pool":"[BUFFER_POOL|egress_lossless_pool1]", | ||
"size":"1518", | ||
"static_th":"3637248" | ||
}, | ||
"egress_lossy_profile": { | ||
"pool":"[BUFFER_POOL|egress_lossy_pool]", | ||
"size":"1518", | ||
"dynamic_th":"3" | ||
} | ||
}, | ||
"BUFFER_PG": { | ||
"{{ port_names }}|0-1": { | ||
"profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" | ||
} | ||
}, | ||
"BUFFER_QUEUE": { | ||
"{{ port_names }}|3": { | ||
"profile" : "[BUFFER_PROFILE|egress_lossless_profile0]" | ||
}, | ||
"{{ port_names }}|4": { | ||
"profile" : "[BUFFER_PROFILE|egress_lossless_profile1]" | ||
}, | ||
"{{ port_names }}|0-1": { | ||
"profile" : "[BUFFER_PROFILE|egress_lossy_profile]" | ||
} | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
device/arista/x86_64-arista_7050_qx32/Arista-7050-QX32/pg_profile_lookup.ini
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# PG lossless profiles. | ||
# speed cable size xon xoff threshold | ||
10000 5m 113664 18432 76800 0 | ||
25000 5m 113664 18432 76800 0 | ||
40000 5m 113664 18432 76800 0 | ||
50000 5m 113664 18432 76800 0 | ||
100000 5m 113664 18432 76800 0 | ||
10000 40m 113664 18432 76800 0 | ||
25000 40m 113664 18432 76800 0 | ||
40000 40m 113664 18432 76800 0 | ||
50000 40m 113664 18432 76800 0 | ||
100000 40m 113664 18432 76800 0 | ||
10000 300m 113664 18432 76800 0 | ||
25000 300m 113664 18432 76800 0 | ||
40000 300m 113664 18432 76800 0 | ||
50000 300m 113664 18432 76800 0 | ||
100000 300m 113664 18432 76800 0 |
135 changes: 135 additions & 0 deletions
135
device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000/buffers.json.j2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,135 @@ | ||
{# Default values which will be used if no actual configura available #} | ||
{% set default_cable = '300m' %} | ||
{% set default_speed = '100G' %} | ||
{% set default_ports_num = 32 -%} | ||
|
||
{# Port configuration to cable length look-up table #} | ||
{# Each record describes mapping of DUT (DUT port) role and neighbor role to cable length #} | ||
{# Roles described in the minigraph #} | ||
{% set ports2cable = { | ||
'torrouter_server' : '5m', | ||
'leafrouter_torrouter' : '40m', | ||
'spinerouter_leafrouter' : '300m' | ||
} | ||
%} | ||
|
||
{%- macro cable_length(port_name) -%} | ||
{%- set cable_len = [] -%} | ||
{%- for local_port in DEVICE_NEIGHBOR -%} | ||
{%- if local_port == port_name -%} | ||
{%- if DEVICE_NEIGHBOR_METADATA[DEVICE_NEIGHBOR[local_port].name] -%} | ||
{%- set neighbor = DEVICE_NEIGHBOR_METADATA[DEVICE_NEIGHBOR[local_port].name] -%} | ||
{%- set neighbor_role = neighbor.type -%} | ||
{%- set roles1 = switch_role + '_' + neighbor_role %} | ||
{%- set roles2 = neighbor_role + '_' + switch_role -%} | ||
{%- set roles1 = roles1 | lower -%} | ||
{%- set roles2 = roles2 | lower -%} | ||
{%- if roles1 in ports2cable -%} | ||
{%- if cable_len.append(ports2cable[roles1]) -%}{%- endif -%} | ||
{%- elif roles2 in ports2cable -%} | ||
{%- if cable_len.append(ports2cable[roles2]) -%}{%- endif -%} | ||
{%- endif -%} | ||
{%- endif -%} | ||
{%- endif -%} | ||
{%- endfor -%} | ||
{%- if cable_len -%} | ||
{{ cable_len.0 }} | ||
{%- else -%} | ||
{{ default_cable }} | ||
{%- endif -%} | ||
{% endmacro %} | ||
|
||
{%- if DEVICE_METADATA is defined %} | ||
{%- set switch_role = DEVICE_METADATA['localhost']['type'] %} | ||
{%- endif -%} | ||
|
||
{# Generate list of ports if not defined #} | ||
{% if PORT is not defined %} | ||
{% set PORT = [] %} | ||
{% for port_idx in range(0,default_ports_num) %} | ||
{% if PORT.append("Ethernet%d" % (port_idx*4)) %}{% endif %} | ||
{% endfor %} | ||
{% endif -%} | ||
|
||
{% set port_names_list = [] %} | ||
{% for port in PORT %} | ||
{%- if port_names_list.append(port) %}{% endif %} | ||
{% endfor %} | ||
{% set port_names = port_names_list | join(',') -%} | ||
|
||
{ | ||
"CABLE_LENGTH": { | ||
"AZURE": { | ||
{% for port in PORT %} | ||
{% set cable = cable_length(port) -%} | ||
"{{ port }}": "{{ cable }}"{%- if not loop.last -%},{% endif %} | ||
|
||
{% endfor %} | ||
} | ||
}, | ||
"BUFFER_POOL": { | ||
"ingress_lossless_pool": { | ||
"size": "7274496", | ||
"type": "ingress", | ||
"mode": "static" | ||
}, | ||
"ingress_lossy_pool": { | ||
"size": "5491712", | ||
"type": "ingress", | ||
"mode": "dynamic" | ||
}, | ||
"egress_lossless_pool0": { | ||
"size": "3637248", | ||
"type": "egress", | ||
"mode": "static" | ||
}, | ||
"egress_lossless_pool1": { | ||
"size": "3637248", | ||
"type": "egress", | ||
"mode": "static" | ||
}, | ||
"egress_lossy_pool": { | ||
"size": "5491712", | ||
"type": "egress", | ||
"mode": "dynamic" | ||
} | ||
}, | ||
"BUFFER_PROFILE": { | ||
"ingress_lossy_profile": { | ||
"pool":"[BUFFER_POOL|ingress_lossy_pool]", | ||
"size":"1518", | ||
"dynamic_th":"3" | ||
}, | ||
"egress_lossless_profile0": { | ||
"pool":"[BUFFER_POOL|egress_lossless_pool0]", | ||
"size":"1518", | ||
"static_th":"3637248" | ||
}, | ||
"egress_lossless_profile1": { | ||
"pool":"[BUFFER_POOL|egress_lossless_pool1]", | ||
"size":"1518", | ||
"static_th":"3637248" | ||
}, | ||
"egress_lossy_profile": { | ||
"pool":"[BUFFER_POOL|egress_lossy_pool]", | ||
"size":"1518", | ||
"dynamic_th":"3" | ||
} | ||
}, | ||
"BUFFER_PG": { | ||
"{{ port_names }}|0-1": { | ||
"profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" | ||
} | ||
}, | ||
"BUFFER_QUEUE": { | ||
"{{ port_names }}|3": { | ||
"profile" : "[BUFFER_PROFILE|egress_lossless_profile0]" | ||
}, | ||
"{{ port_names }}|4": { | ||
"profile" : "[BUFFER_PROFILE|egress_lossless_profile1]" | ||
}, | ||
"{{ port_names }}|0-1": { | ||
"profile" : "[BUFFER_PROFILE|egress_lossy_profile]" | ||
} | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000/pg_profile_lookup.ini
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# PG lossless profiles. | ||
# speed cable size xon xoff threshold | ||
10000 5m 113664 18432 76800 0 | ||
25000 5m 113664 18432 76800 0 | ||
40000 5m 113664 18432 76800 0 | ||
50000 5m 113664 18432 76800 0 | ||
100000 5m 113664 18432 76800 0 | ||
10000 40m 113664 18432 76800 0 | ||
25000 40m 113664 18432 76800 0 | ||
40000 40m 113664 18432 76800 0 | ||
50000 40m 113664 18432 76800 0 | ||
100000 40m 113664 18432 76800 0 | ||
10000 300m 113664 18432 76800 0 | ||
25000 300m 113664 18432 76800 0 | ||
40000 300m 113664 18432 76800 0 | ||
50000 300m 113664 18432 76800 0 | ||
100000 300m 113664 18432 76800 0 |
Oops, something went wrong.