Skip to content

Commit

Permalink
[Dynamic buffer calculation] Support dynamic buffer calculation
Browse files Browse the repository at this point in the history
1. add tables required for the feature:
 - ASIC_TABLE in files/build_templates/asic_table.j2
 - PERIPHERAL_TABLE in files/build_templates/peripheral_table.j2
 - PORT_PERIPHERAL_TABLE on a per-platform basis in device/mellanox/x86_64-mlnx_msn3800-r0/port_peripheral_config.j2
 - DEFAULT_LOSSLESS_BUFFER_PARAMETER and LOSSLESS_TRAFFIC_PATTERN in files/build_templates/buffers_config.j2
 - Add lossless PGs (3-4) for each port in files/build_templates/buffers_config.j2
2. copy the newly introduced j2 files into image and rendering them when system starts
3. update the CLI options for buffermgrd so that it can start with dynamic mode
4. Adjust the order in which swss daemons start, making buffermgrd start before orchagent.
   This is to make sure buffermgrd can get everything ready before orchagent starts especially during warm reboot.
5. Optimize the way in which orchagent fetches the asic vendor name:
   - fetch the vendor name when creates the docker and pass it as a docker environment variable
   - orchagent and buffermgrd can use this passed-in variable
6. Clear buffer related tables from STATE_DB when swss docker starts
7. Update the src/sonic-config-engine/tests/sample_output/buffers-dell6100.json according to the buffer_config.j2
8. Remove buffer pool sizes for ingress pools and egress_lossy_pool
   Update the buffer settings for dynamic buffer calculation

Signed-off-by: Stephen Sun <[email protected]>
  • Loading branch information
stephens authored and Stephen Sun committed Jul 1, 2020
1 parent 5f16e96 commit 761bdf3
Show file tree
Hide file tree
Showing 18 changed files with 331 additions and 88 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
{% set default_cable = '5m' %}
{% set ingress_lossless_pool_size = '5029836' %}
{% set ingress_lossy_pool_size = '5029836' %}
{% set egress_lossless_pool_size = '14024599' %}
{% set egress_lossy_pool_size = '5029836' %}
{% set egress_lossless_pool_size = '14024640' %}

{%- macro generate_port_lists(PORT_ALL) %}
{# Generate list of ports #}
Expand All @@ -14,12 +11,10 @@
{%- macro generate_buffer_pool_and_profiles() %}
"BUFFER_POOL": {
"ingress_lossless_pool": {
"size": "{{ ingress_lossless_pool_size }}",
"type": "ingress",
"mode": "dynamic"
},
"ingress_lossy_pool": {
"size": "{{ ingress_lossy_pool_size }}",
"type": "ingress",
"mode": "dynamic"
},
Expand All @@ -29,7 +24,6 @@
"mode": "dynamic"
},
"egress_lossy_pool": {
"size": "{{ egress_lossy_pool_size }}",
"type": "egress",
"mode": "dynamic"
}
Expand All @@ -38,7 +32,7 @@
"ingress_lossless_profile": {
"pool":"[BUFFER_POOL|ingress_lossless_pool]",
"size":"0",
"dynamic_th":"0"
"dynamic_th":"7"
},
"ingress_lossy_profile": {
"pool":"[BUFFER_POOL|ingress_lossy_pool]",
Expand All @@ -52,8 +46,8 @@
},
"egress_lossy_profile": {
"pool":"[BUFFER_POOL|egress_lossy_pool]",
"size":"4096",
"dynamic_th":"3"
"size":"9216",
"dynamic_th":"7"
},
"q_lossy_profile": {
"pool":"[BUFFER_POOL|egress_lossy_pool]",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
{% set default_cable = '5m' %}
{% set ingress_lossless_pool_size = '2097100' %}
{% set ingress_lossy_pool_size = '2097100' %}
{% set egress_lossless_pool_size = '14024599' %}
{% set egress_lossy_pool_size = '2097100' %}
{% set egress_lossless_pool_size = '14024640' %}

{%- macro generate_port_lists(PORT_ALL) %}
{# Generate list of ports #}
Expand All @@ -14,12 +11,10 @@
{%- macro generate_buffer_pool_and_profiles() %}
"BUFFER_POOL": {
"ingress_lossless_pool": {
"size": "{{ ingress_lossless_pool_size }}",
"type": "ingress",
"mode": "dynamic"
},
"ingress_lossy_pool": {
"size": "{{ ingress_lossy_pool_size }}",
"type": "ingress",
"mode": "dynamic"
},
Expand All @@ -29,7 +24,6 @@
"mode": "dynamic"
},
"egress_lossy_pool": {
"size": "{{ egress_lossy_pool_size }}",
"type": "egress",
"mode": "dynamic"
}
Expand All @@ -38,7 +32,7 @@
"ingress_lossless_profile": {
"pool":"[BUFFER_POOL|ingress_lossless_pool]",
"size":"0",
"dynamic_th":"0"
"dynamic_th":"7"
},
"ingress_lossy_profile": {
"pool":"[BUFFER_POOL|ingress_lossy_pool]",
Expand All @@ -52,8 +46,8 @@
},
"egress_lossy_profile": {
"pool":"[BUFFER_POOL|egress_lossy_pool]",
"size":"4096",
"dynamic_th":"3"
"size":"9216",
"dynamic_th":"7"
},
"q_lossy_profile": {
"pool":"[BUFFER_POOL|egress_lossy_pool]",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
{% set default_cable = '5m' %}
{% set ingress_lossless_pool_size = '14983147' %}
{% set ingress_lossy_pool_size = '14983147' %}
{% set egress_lossless_pool_size = '34340822' %}
{% set egress_lossy_pool_size = '14983147' %}
{% set egress_lossless_pool_size = '34340832' %}

{%- macro generate_port_lists(PORT_ALL) %}
{# Generate list of ports #}
Expand All @@ -14,12 +11,10 @@
{%- macro generate_buffer_pool_and_profiles() %}
"BUFFER_POOL": {
"ingress_lossless_pool": {
"size": "{{ ingress_lossless_pool_size }}",
"type": "ingress",
"mode": "dynamic"
},
"ingress_lossy_pool": {
"size": "{{ ingress_lossy_pool_size }}",
"type": "ingress",
"mode": "dynamic"
},
Expand All @@ -29,7 +24,6 @@
"mode": "dynamic"
},
"egress_lossy_pool": {
"size": "{{ egress_lossy_pool_size }}",
"type": "egress",
"mode": "dynamic"
}
Expand All @@ -38,7 +32,7 @@
"ingress_lossless_profile": {
"pool":"[BUFFER_POOL|ingress_lossless_pool]",
"size":"0",
"dynamic_th":"0"
"dynamic_th":"7"
},
"ingress_lossy_profile": {
"pool":"[BUFFER_POOL|ingress_lossy_pool]",
Expand All @@ -52,8 +46,8 @@
},
"egress_lossy_profile": {
"pool":"[BUFFER_POOL|egress_lossy_pool]",
"size":"4096",
"dynamic_th":"3"
"size":"9216",
"dynamic_th":"7"
},
"q_lossy_profile": {
"pool":"[BUFFER_POOL|egress_lossy_pool]",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
{% set default_cable = '5m' %}
{% set ingress_lossless_pool_size = '9158635' %}
{% set ingress_lossy_pool_size = '9158635' %}
{% set egress_lossless_pool_size = '34340822' %}
{% set egress_lossy_pool_size = '9158635' %}
{% set egress_lossless_pool_size = '34340832' %}

{%- macro generate_port_lists(PORT_ALL) %}
{# Generate list of ports #}
Expand All @@ -14,12 +11,10 @@
{%- macro generate_buffer_pool_and_profiles() %}
"BUFFER_POOL": {
"ingress_lossless_pool": {
"size": "{{ ingress_lossless_pool_size }}",
"type": "ingress",
"mode": "dynamic"
},
"ingress_lossy_pool": {
"size": "{{ ingress_lossy_pool_size }}",
"type": "ingress",
"mode": "dynamic"
},
Expand All @@ -29,7 +24,6 @@
"mode": "dynamic"
},
"egress_lossy_pool": {
"size": "{{ egress_lossy_pool_size }}",
"type": "egress",
"mode": "dynamic"
}
Expand All @@ -38,7 +32,7 @@
"ingress_lossless_profile": {
"pool":"[BUFFER_POOL|ingress_lossless_pool]",
"size":"0",
"dynamic_th":"0"
"dynamic_th":"7"
},
"ingress_lossy_profile": {
"pool":"[BUFFER_POOL|ingress_lossy_pool]",
Expand All @@ -52,8 +46,8 @@
},
"egress_lossy_profile": {
"pool":"[BUFFER_POOL|egress_lossy_pool]",
"size":"4096",
"dynamic_th":"3"
"size":"9216",
"dynamic_th":"7"
},
"q_lossy_profile": {
"pool":"[BUFFER_POOL|egress_lossy_pool]",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
{% set default_cable = '5m' %}
{% set ingress_lossless_pool_size = '28196784' %}
{% set ingress_lossy_pool_size = '28196784' %}
{% set egress_lossless_pool_size = '34340832' %}
{% set egress_lossy_pool_size = '28196784' %}

{%- macro generate_port_lists(PORT_ALL) %}
{# Generate list of ports #}
Expand All @@ -14,12 +11,10 @@
{%- macro generate_buffer_pool_and_profiles() %}
"BUFFER_POOL": {
"ingress_lossless_pool": {
"size": "{{ ingress_lossless_pool_size }}",
"type": "ingress",
"mode": "dynamic"
},
"ingress_lossy_pool": {
"size": "{{ ingress_lossy_pool_size }}",
"type": "ingress",
"mode": "dynamic"
},
Expand All @@ -29,7 +24,6 @@
"mode": "dynamic"
},
"egress_lossy_pool": {
"size": "{{ egress_lossy_pool_size }}",
"type": "egress",
"mode": "dynamic"
}
Expand All @@ -38,7 +32,7 @@
"ingress_lossless_profile": {
"pool":"[BUFFER_POOL|ingress_lossless_pool]",
"size":"0",
"dynamic_th":"0"
"dynamic_th":"7"
},
"ingress_lossy_profile": {
"pool":"[BUFFER_POOL|ingress_lossy_pool]",
Expand All @@ -52,8 +46,8 @@
},
"egress_lossy_profile": {
"pool":"[BUFFER_POOL|egress_lossy_pool]",
"size":"4096",
"dynamic_th":"3"
"size":"9216",
"dynamic_th":"7"
},
"q_lossy_profile": {
"pool":"[BUFFER_POOL|egress_lossy_pool]",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
{% set default_cable = '5m' %}
{% set ingress_lossless_pool_size = '17891280' %}
{% set ingress_lossy_pool_size = '17891280' %}
{% set egress_lossless_pool_size = '34340832' %}
{% set egress_lossy_pool_size = '17891280' %}

{%- macro generate_port_lists(PORT_ALL) %}
{# Generate list of ports #}
Expand All @@ -14,12 +11,10 @@
{%- macro generate_buffer_pool_and_profiles() %}
"BUFFER_POOL": {
"ingress_lossless_pool": {
"size": "{{ ingress_lossless_pool_size }}",
"type": "ingress",
"mode": "dynamic"
},
"ingress_lossy_pool": {
"size": "{{ ingress_lossy_pool_size }}",
"type": "ingress",
"mode": "dynamic"
},
Expand All @@ -29,7 +24,6 @@
"mode": "dynamic"
},
"egress_lossy_pool": {
"size": "{{ egress_lossy_pool_size }}",
"type": "egress",
"mode": "dynamic"
}
Expand All @@ -38,7 +32,7 @@
"ingress_lossless_profile": {
"pool":"[BUFFER_POOL|ingress_lossless_pool]",
"size":"0",
"dynamic_th":"0"
"dynamic_th":"7"
},
"ingress_lossy_profile": {
"pool":"[BUFFER_POOL|ingress_lossy_pool]",
Expand All @@ -52,8 +46,8 @@
},
"egress_lossy_profile": {
"pool":"[BUFFER_POOL|egress_lossy_pool]",
"size":"4096",
"dynamic_th":"3"
"size":"9216",
"dynamic_th":"7"
},
"q_lossy_profile": {
"pool":"[BUFFER_POOL|egress_lossy_pool]",
Expand Down
10 changes: 10 additions & 0 deletions device/mellanox/x86_64-mlnx_msn3800-r0/port_peripheral_config.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[
{%- include 'peripheral_table.j2' %}
,
{
"PORT_PERIPHERAL_TABLE:global": {
"gearbox_model": "MELLANOX-GEARBOX-1"
},
"OP": "SET"
}
]
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
{% set default_cable = '5m' %}
{% set ingress_lossless_pool_size = '56623104' %}
{% set ingress_lossy_pool_size = '56623104' %}
{% set egress_lossless_pool_size = '60817392' %}
{% set egress_lossy_pool_size = '56623104' %}

{%- macro generate_port_lists(PORT_ALL) %}
{# Generate list of ports #}
Expand All @@ -14,12 +11,10 @@
{%- macro generate_buffer_pool_and_profiles() %}
"BUFFER_POOL": {
"ingress_lossless_pool": {
"size": "{{ ingress_lossless_pool_size }}",
"type": "ingress",
"mode": "dynamic"
},
"ingress_lossy_pool": {
"size": "{{ ingress_lossy_pool_size }}",
"type": "ingress",
"mode": "dynamic"
},
Expand All @@ -29,7 +24,6 @@
"mode": "dynamic"
},
"egress_lossy_pool": {
"size": "{{ egress_lossy_pool_size }}",
"type": "egress",
"mode": "dynamic"
}
Expand All @@ -38,7 +32,7 @@
"ingress_lossless_profile": {
"pool":"[BUFFER_POOL|ingress_lossless_pool]",
"size":"0",
"dynamic_th":"0"
"dynamic_th":"7"
},
"ingress_lossy_profile": {
"pool":"[BUFFER_POOL|ingress_lossy_pool]",
Expand All @@ -52,8 +46,8 @@
},
"egress_lossy_profile": {
"pool":"[BUFFER_POOL|egress_lossy_pool]",
"size":"4096",
"dynamic_th":"3"
"size":"9216",
"dynamic_th":"7"
},
"q_lossy_profile": {
"pool":"[BUFFER_POOL|egress_lossy_pool]",
Expand Down
Loading

0 comments on commit 761bdf3

Please sign in to comment.