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

Added a procfs check for pcie peripherals to verify device ID. #429

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

assrinivasan
Copy link
Contributor

@assrinivasan assrinivasan commented Jan 25, 2024

Description

This PR adds a procfs check for PCI peripherals. It provides a device ID check to ensure that the PCI peripherals match the pcie.yaml manifest, including undercutting PCI device hijack by other drivers that might change the device ID.

Motivation and Context

The motivation for this PR is to get ahead the 'ASIC missing' issue and provide a mechanism to auto-mitigate said issues.

Fixes #191

How Has This Been Tested?

Ran following tests:

  1. Happy path
  2. Mismatched vendor ID on existing device (modified pcie.yaml) and verified that it was picked up by pcied

on the following HardwareSKUs:

  1. Arista-7050CX3-32S-D48C8
  2. Arista-7060CX-32S-D48C8
  3. Arista-7260CX3-C64
  4. Celestica-DX010-C32
  5. Celestica-E1031-T48S4
  6. Cisco-8102-C64
  7. Force10-S6100
  8. Mellanox-SN2700
  9. Mellanox-SN3800-D112C8
  10. Nokia-7215

procfs_pcie_check_deviceid_mismatch_logs.txt

Additional Information (Optional)

@assrinivasan assrinivasan self-assigned this Jan 30, 2024
@assrinivasan assrinivasan marked this pull request as ready for review January 30, 2024 18:03
try:
with open(current_file, 'rb') as f:
f.seek(2)
data = f.read(2)
Copy link
Collaborator

Choose a reason for hiding this comment

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

@assrinivasan does this result in real pcie transaction?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This does not -- this gets the intended device ID of the PCIe device by querying the procfs data file directly, thereby bypassing any SCD driver hijack or pcie*.yaml file weirdness. I added the actual transaction check in the latest commit.

@dgsudharsan dgsudharsan removed their request for review June 5, 2024 22:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enhance pcieutil to check actual presence of pcie device
2 participants