Skip to content

Generate PFC storm using PFC backpressure on Arista DCS-7060X6 devices#15594

Closed
veronica-arista wants to merge 6 commits intosonic-net:masterfrom
veronica-arista:master-pfcwd-storm-gen-via-pfc-backpres
Closed

Generate PFC storm using PFC backpressure on Arista DCS-7060X6 devices#15594
veronica-arista wants to merge 6 commits intosonic-net:masterfrom
veronica-arista:master-pfcwd-storm-gen-via-pfc-backpres

Conversation

@veronica-arista
Copy link
Contributor

Description of PR

Add a pfc_gen script for Arista DCS-7060X6 fanout devices to generate pfc pause frames by setting PFC backpressure status in hardware. Enable the storm generation to use this script on interfaces that are connected to Arista DCS-7060X6 fanout devices running EOS.

Summary:
Fixes # (issue)

Type of change

  • Bug fix
  • Testbed and Framework(new/improvement)
  • Test case(new/improvement)

Back port request

  • 202012
  • 202205
  • 202305
  • 202311
  • 202405

Approach

What is the motivation for this PR?

Adds more reliable PFC storm generation for interfaces connected to Arista DCS-7060X6 fanout devices

How did you do it?

How did you verify/test it?

Ran the pfcwd tests on t1 switch with interfaces connected to Arista DCS-7060X6 device, ensured the new script was used and pfc storm was appropriately detected.

Any platform specific information?

Supported testbed topology if it's a new test case?

Documentation

Add a pfc_gen script that generates storm by directly setting PFC
backpressure status in hardware (using broadcom shell commands) and
modify pfc_storm to use this new script if the port is connected to th5
MPC. Intended to upstream for MSFT.
@mssonicbld
Copy link
Collaborator

The pre-commit check detected issues in the files touched by this pull request.
The pre-commit check is a mandatory check, please fix detected issues.

Detailed pre-commit check results:
trim trailing whitespace.................................................Failed
- hook id: trailing-whitespace
- exit code: 1
- files were modified by this hook

Fixing tests/common/helpers/pfc_gen_th5.py

fix end of files.........................................................Passed
check yaml...........................................(no files to check)Skipped
check for added large files..............................................Passed
check python ast.........................................................Passed
flake8...................................................................Failed
- hook id: flake8
- exit code: 1

tests/common/helpers/pfc_gen_th5.py:7:1: F401 'binascii' imported but unused
tests/common/helpers/pfc_gen_th5.py:59:31: F541 f-string is missing placeholders
tests/common/helpers/pfc_gen_th5.py:62:52: W605 invalid escape sequence 'S'
tests/common/helpers/pfc_gen_th5.py:62:67: W605 invalid escape sequence '['
tests/common/helpers/pfc_gen_th5.py:62:75: W605 invalid escape sequence 'd'
...
[truncated extra lines, please run pre-commit locally to view full check results]

To run the pre-commit checks locally, you can follow below steps:

  1. Ensure that default python is python3. In sonic-mgmt docker container, default python is python2. You can run
    the check by activating the python3 virtual environment in sonic-mgmt docker container or outside of sonic-mgmt
    docker container.
  2. Ensure that the pre-commit package is installed:
sudo pip install pre-commit
  1. Go to repository root folder
  2. Install the pre-commit hooks:
pre-commit install
  1. Use pre-commit to check staged file:
pre-commit
  1. Alternatively, you can check committed files using:
pre-commit run --from-ref <commit_id> --to-ref <commit_id>

@auspham
Copy link
Contributor

auspham commented Dec 22, 2024

hi @veronica-arista would this also be suitable for Arista-7260CX3?

@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Pull request contains merge conflicts.

@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@StormLiangMS
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Deploy the pfc generation file on the fanout
"""
if self.peer_device.os in ('eos', 'sonic'):
if ((self.peer_device.os == 'eos' and self._get_eos_fanout_version()[0].startswith('Arista DCS-7060X6')) or
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have the fanout_hosts in this class, Can you check whether we could get this information from the fanout_hosts to avoid creating the new function here, thanks

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does fanout_hosts contain in your testbed? We only have testbeds with eos devices as fanouts and the device version is not populated in the testbeds I'm using.

(Pdb) p self.fanout_hosts
{'nv681': { os: 'eos', hostname: 'nv681', device_type: 'FanoutLeaf' }}

"""
if self.peer_device.os in ('eos', 'sonic'):
if ((self.peer_device.os == 'eos' and self._get_eos_fanout_version()[0].startswith('Arista DCS-7060X6')) or
(self.peer_device.os == 'sonic' and self._get_sonic_fanout_hwsku().startswith('Arista-7060X6-64'))):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same with above, could you please double check, thanks a lot.

elif self.fanout_asic_type == 'mellanox' and self.peer_device.os == 'sonic':
self.pfc_start_template = os.path.join(
TEMPLATES_DIR, "pfc_storm_mlnx_{}.j2".format(self.peer_device.os))
elif ((self.peer_device.os == 'eos' and self._get_eos_fanout_version()[0].startswith('Arista DCS-7060X6')) or
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We implement the support for 7060X6 in this PR, May I know what's the plan for other devices? like 7060,7260, thanks.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are working on this currently, the 7060 support can be available sooner, the other listed devices will take longer.

@StormLiangMS
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@StormLiangMS
Copy link
Collaborator

hi @lipxu any more comments for this PR? Let's assume this one is for 7060X6 only.

@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@veronica-arista
Copy link
Contributor Author

veronica-arista commented Apr 12, 2025

Since you wanted to merge this PR as is now, I opened #17971 on top of these changes to add support for:
Arista-7060X6
Arista-7060CX
Arista-7260CX3
Arista-7260QX3

mssonicbld added a commit to mssonicbld/sonic-mgmt.msft that referenced this pull request Apr 24, 2025
<!--
Please make sure you've read and understood our contributing guidelines;
https://github.com/sonic-net/SONiC/blob/gh-pages/CONTRIBUTING.md

Please provide following information to help code review process a bit easier:
-->
### Description of PR
NOTE: This is a duplicate of sonic-net/sonic-mgmt#17971, as @veronica-arista is away.

Add a pfc_gen script for Arista fanout devices to generate pfc pause frames by setting PFC backpressure status in hardware. Enable the storm generation to use this script on interfaces that are connected to Arista fanout devices running EOS or Sonic. Currently supports the following Arista devices:
Arista-7060X6
Arista-7060DX5
Arista-7060PX5
Arista-7060CX
Arista-7260CX3
Arista-7260QX3

This is implemented on top of PR sonic-net/sonic-mgmt#15594

Summary:
Fixes # (issue)

### Type of change

<!--
- Fill x for your type of change.
- e.g.
- [x] Bug fix
-->

- [ ] Bug fix
- [ ] Testbed and Framework(new/improvement)
- [ ] New Test case
    - [ ] Skipped for non-supported platforms
- [x] Test case improvement

### Back port request
- [x] 202012
- [ ] 202205
- [ ] 202305
- [ ] 202311
- [ ] 202405
- [x] 202411

### Approach
#### What is the motivation for this PR?
Adds more reliable PFC storm generation for interfaces connected to Arista fanout devices

#### How did you do it?

#### How did you verify/test it?
Ran sonic-mgmt pfcwd tests on testbed with Arista fanout switches of the listed SKUs running EOS.
Ran the pfc_gen script manually on Arista switches running Sonic.

#### Any platform specific information?

#### Supported testbed topology if it's a new test case?

### Documentation
<!--
(If it's a new feature, new test case)
Did you update documentation/Wiki relevant to your implementation?
Link to the wiki page?
-->
mssonicbld added a commit to Azure/sonic-mgmt.msft that referenced this pull request Apr 24, 2025
…tional Arista devices (#222)

<!--
Please make sure you've read and understood our contributing guidelines;
https://github.com/sonic-net/SONiC/blob/gh-pages/CONTRIBUTING.md

Please provide following information to help code review process a bit easier:
-->
### Description of PR
NOTE: This is a duplicate of sonic-net/sonic-mgmt#17971, as @veronica-arista is away.

Add a pfc_gen script for Arista fanout devices to generate pfc pause frames by setting PFC backpressure status in hardware. Enable the storm generation to use this script on interfaces that are connected to Arista fanout devices running EOS or Sonic. Currently supports the following Arista devices:
Arista-7060X6
Arista-7060DX5
Arista-7060PX5
Arista-7060CX
Arista-7260CX3
Arista-7260QX3

This is implemented on top of PR sonic-net/sonic-mgmt#15594

Summary:
Fixes # (issue)

### Type of change

<!--
- Fill x for your type of change.
- e.g.
- [x] Bug fix
-->

- [ ] Bug fix
- [ ] Testbed and Framework(new/improvement)
- [ ] New Test case
 - [ ] Skipped for non-supported platforms
- [x] Test case improvement

### Back port request
- [x] 202012
- [ ] 202205
- [ ] 202305
- [ ] 202311
- [ ] 202405
- [x] 202411

### Approach
#### What is the motivation for this PR?
Adds more reliable PFC storm generation for interfaces connected to Arista fanout devices

#### How did you do it?

#### How did you verify/test it?
Ran sonic-mgmt pfcwd tests on testbed with Arista fanout switches of the listed SKUs running EOS.
Ran the pfc_gen script manually on Arista switches running Sonic.

#### Any platform specific information?

#### Supported testbed topology if it's a new test case?

### Documentation
<!--
(If it's a new feature, new test case)
Did you update documentation/Wiki relevant to your implementation?
Link to the wiki page?
-->
@veronica-arista
Copy link
Contributor Author

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.

5 participants