Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Dynamic buffer calc] Support dynamic buffer calculation #4881

Merged

Conversation

stephenxs
Copy link
Collaborator

@stephenxs stephenxs commented Jul 1, 2020

- Why I did it
To support dynamic buffer calculation.
This PR also depends on the following PRs for sub modules

- How I did it

  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
  1. copy the newly introduced j2 files into image and rendering them when system starts
  2. update the CLI options for buffermgrd so that it can start with dynamic mode
  3. 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.
  4. 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
  5. Clear buffer related tables from STATE_DB when swss docker starts
  6. Update the src/sonic-config-engine/tests/sample_output/buffers-dell6100.json according to the buffer_config.j2
  7. Remove buffer pool sizes for ingress pools and egress_lossy_pool
    Update the buffer settings for dynamic buffer calculation

Signed-off-by: Stephen Sun stephens@nvidia.com

- How to verify it

- Description for the changelog

- A picture of a cute animal (not mandatory but encouraged)

@lguohan lguohan requested a review from neethajohn July 2, 2020 07:23
@stephenxs stephenxs changed the title [Dynamic buffer calculation] Support dynamic buffer calculation [Dynamic buffer calc] Support dynamic buffer calculation Aug 6, 2020
@stephenxs stephenxs marked this pull request as ready for review August 14, 2020 11:55
@neethajohn
Copy link
Contributor

Can you also include testcases to ensure that the asic_table.j2 and peripheral_table.j2 are rendered properly?

neethajohn
neethajohn previously approved these changes Nov 20, 2020
1. add tables required for the feature:
 - ASIC_TABLE in platform/mellanox/asic_table.j2 (Mellanox specific)
 - PERIPHERAL_TABLE in platform/mellanox/peripheral_table.j2 (Mellanox specific)
 - PORT_PERIPHERAL_TABLE on a per-platform basis in device/mellanox/x86_64-mlnx_msn3800-r0/port_peripheral_config.j2 (Mellanox specific)
 - 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 <stephens@nvidia.com>
1. If all the buffer configuration aligns the default, use dynamic
buffer calculation mode. Otherwise, use the traditional mode
2. Dynamic mode is adopted in switches newly installed from scratch and
traditional mode in switches installed from ninigraph
This is done by:
- introducing a wrapper to buffermgrd, which enables it to test which
mode is adopted and feed buffermgrd with corresponding CLI arguments
- preparing default buffer configuration templates for both dynamic and
traditional mode for each SKU
- introduce "buffer_model" in DEVICE_METADATA|localhost for mellanox platform

Signed-off-by: Stephen Sun <stephens@nvidia.com>
Signed-off-by: Stephen Sun <stephens@nvidia.com>
- For Mellanox, dynamic by default
- For other vendors, traditional mode.

Signed-off-by: Stephen Sun <stephens@nvidia.com>
Signed-off-by: Stephen Sun <stephens@nvidia.com>
…able

Signed-off-by: Stephen Sun <stephens@nvidia.com>
Signed-off-by: Stephen Sun <stephens@nvidia.com>
@stephenxs
Copy link
Collaborator Author

retest this, please

@liat-grozovik liat-grozovik merged this pull request into sonic-net:master Dec 8, 2020
@stephenxs stephenxs deleted the dynamic-buffer-calculation branch December 8, 2020 22:24
@stephenxs stephenxs restored the dynamic-buffer-calculation branch December 11, 2020 00:53
@qiluo-msft
Copy link
Collaborator

This PR is wrong merged and we manually remove the commit from master branch. Discussing with PR owner to submit another one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants