Skip to content

Fix multi-asic behaviour for PFC #3520

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

Closed
wants to merge 12 commits into from

Conversation

arista-hpandya
Copy link
Contributor

What I did

Added multi-asic support to PFC by:

  • Add namespace arg for show and config cmds for pfc
  • Replace test DB with JSON to support verification of multiple namespaces in unit test
  • Add unit tests for multi-asic behaviour
  • Added a test vector file for better test organization

This is a logical successor of #3057 and is a part of the larger efforts to add multi-asic functionality tracked in #15148

How I did it

I used the multi_asic helper functions from sonic_py_common and utilities_common to handle multiple namespaces

How to verify it

There were three stages of verification:

  • Verify the single-asic and multi-asic unit tests for pfc pass
  • Verify the behaviour on a single-asic linecard on a DUT
  • Verify the behaviour on a multi-asic linecard on a DUT

Previous command output (if the output of a command-line utility has changed)

New command output (if the output of a command-line utility has changed)

The namespace argument is the new addition to the pfc command.

Case 1: If namespace is specified in a multi-asic device
Behaviour: We will run the command only on the specified namespace
e.g: pfc show asymmetric --namespace asic0
image

Case 2: If no namespace is specified in a multi-asic device
Behaviour: We will run the command on all namespaces
e.g: pfc show priority
pfc show priority

Case 3: If a namespace is specified in single-asic device (other than default '')
Behaviour: We will raise an invalid argument error
e.g: pfc show asymmetric --namespace asic0
pfc invalid namespace cw

Case 4: If no namespace is specified in single-asic device
Behaviour: We will run it on the only valid namespace - default namespace
e.g: pfc show priority
pfc config prio cw

bktsim-arista and others added 12 commits May 28, 2024 02:40
This change puts contents originally in pfc/main.py into a class,
to support the usage of the multi-asic helper in a future change.
This change is required, as multi-asic helper relies on certain members
of the class to exist. The multi-asic class helper will be used to add
multi-asic support to pfc commands.
Removed the use of the environment variable to test `config asymmetric
on`. Instead replaced the validation method with a direct check for the
expected CONFIG_DB entry. Also removed the unnecessary classmethods in
TestPfcBase.
- Add multi-asic support for pfc show and config methods
- Replace DB file with JSON for unit test
- Add unit tests for multi-asic pfc support
- Add a test vector file for better testcase organization
@arista-hpandya arista-hpandya deleted the multi-asic-pfc branch September 23, 2024 17:40
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