Skip to content

Add PCI configuration tests for SR-IOV VFs

Piórkowski, Piotr igt-dev 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest4 patches 2 repliesIn review
  2. v34 patches 0 repliesSuperseded
  3. v24 patches 4 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v14 patches4 repliesSuperseded

Changes in v4 from the cover letter

- Added igt_pci_regs.h with the PCI register definitions used by the helpers and the test, instead of relying on linux/pci_regs.h, which may be too old on some distributions.
- Used a BAR type specific attribute mask when validating the VF BARs, so the address bits of an I/O BAR are no longer masked out along with the memory BAR attribute bits.

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4lib/igt_pci: Add raw configuration space helperslib/igt_pci.c lib/igt_pci.h lib/igt_pci_regs.h +2 more+272 -201 reply
2/4tests/sriov_pci_config: Add VF core config checkslib/igt_pci_regs.h tests/meson.build tests/sriov_pci_config.c+251 -01 reply
3/4tests/sriov_pci_config: Add optional capability checkslib/igt_pci_regs.h tests/sriov_pci_config.c+141 -00 replies
4/4intel-ci: Block igt@sriov_pci_config.*tests/intel-ci/xe.blocklist.txt+1 -00 replies

Reviews trailers per patch

All 4 patches have a Reviewed-by or Acked-by.

PatchLukasz LagunaMarcin Bernatowicz
1/4R-b
2/4R-b
3/4R-b
4/4R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v4 thread

Cover letter [PATCH v4 0/4] Add PCI configuration tests for SR-IOV VFs

From: Piotr Piórkowski <[email protected]>

This series introduces PCI configuration space tests for SR-IOV Virtual Functions. It verifies the required values and read-only fields in the common PCI header, BARs, PCI Express capabilities, and optional Power Management, AER, and ATS capabilities. The series also adds the PCI helpers needed to read raw configuration space and find standard and extended capabilities.

v3 -> v4:
- Added igt_pci_regs.h with the PCI register definitions used by the helpers and the test, instead of relying on linux/pci_regs.h, which may be too old on some distributions.
- Used a BAR type specific attribute mask when validating the VF BARs, so the address bits of an I/O BAR are no longer masked out along with the memory BAR attribute bits.

v2 -> v3:
- Shared the standard capability list walk between find_pci_cap_offset() and igt_pci_config_raw_find_cap_offset().
- Masked the reserved low bits of capability pointers instead of rejecting them.
- Reported an inaccessible (0xff) capability pointer as -ENODEV.
- Stopped the extended capability walk on an all-ones header.
- Documented the remaining raw configuration space helpers.
- Used PCI_CFG_SPACE_EXP_SIZE from linux/pci_regs.h instead of a local definition.
- Moved the test state from globals to igt_main().
- Rejected a 64-bit memory BAR type in BAR5.

v1 -> v2:
- Dropped the unused find_pci_ext_cap_offset() helper.
- Registered sriov_pci_config in tests/meson.build.
- Enabled the VF and read its configuration space once in the fixture instead of repeating the setup for every subtest.
- Restored the driver autoprobe state and disabled the VF in the final fixture.
- Removed redundant informational messages.
- Simplified subtest descriptions while retaining detailed documentation.
- Corrected PCI register macro names for compatibility with pci_regs.h.
- Improved malformed conventional and extended capability chain handling.
- Added unit tests for valid, invalid, cyclic, and boundary capability chains.
- Added sriov_pci_config to the Xe CI blocklist as a separate patch, since it is intended for HW verification rather than recurring CI runs.

Piotr Piórkowski (4):
lib/igt_pci: Add raw configuration space helpers tests/sriov_pci_config: Add VF core config checks tests/sriov_pci_config: Add optional capability checks
intel-ci: Block igt@sriov_pci_config.*

 lib/igt_pci.c                   | 191 +++++++++++++++++--
 lib/igt_pci.h                   |   7 +-
 lib/igt_pci_regs.h              |  84 +++++++++
 lib/tests/igt_pci.c             |  76 ++++++++
 lib/tests/meson.build           |   1 +
 tests/intel-ci/xe.blocklist.txt |   1 +
 tests/meson.build               |   1 +
 tests/sriov_pci_config.c        | 324 ++++++++++++++++++++++++++++++++
 8 files changed, 665 insertions(+), 20 deletions(-)
 create mode 100644 lib/igt_pci_regs.h
 create mode 100644 lib/tests/igt_pci.c
 create mode 100644 tests/sriov_pci_config.c
Signature · 1 line
2.34.1