Skip to content

PCI driver helpers and xe-vfio-pci FLR improvement

Marcin Bernatowicz igt-dev 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest6 patches 4 repliesIn review
  2. v37 patches 11 repliesSuperseded
  3. v24 patches 1 replySuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v14 patches4 repliesSuperseded

V4 -> V3 from the cover letter

- Clarify igt_pci_get_bound_driver_name() doc that driver/driver_len are optional (NULL/0 valid when only checking bound/unbound) (Lukasz)
- Drop patch checking IOMMU group presence before loading xe-vfio-pci (Lukasz)

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6lib/igt_sriov_device: Add helper to get VF PCI slot addresslib/igt_sriov_device.c lib/igt_sriov_device.h+26 -00 replies
2/6lib/igt_pci: Add generic PCI driver override and bind/unbind helperslib/igt_pci.c lib/igt_pci.h+366 -11 reply
3/6tests/intel/xe_sriov_flr: Attach VFs to xe-vfio-pci before initiating FLRtests/intel/xe_sriov_flr.c+65 -00 replies
4/6lib/igt_kmod: Fix PCI bind/unbind for module/driver name mismatchlib/igt_kmod.c+51 -390 replies
5/6tests/intel/xe_sriov_flr: Add --wait-flr-ms optiontests/intel/xe_sriov_flr.c+34 -20 replies
6/6tests/intel/xe_sriov_flr: Add --no-xe-vfio-pci optiontests/intel/xe_sriov_flr.c+11 -20 replies

Reviews trailers per patch

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

PatchLukasz Laguna
1/6R-b
2/6R-b
3/6R-b
4/6R-b
5/6R-b
6/6R-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 i-g-t 0/6] PCI driver helpers and xe-vfio-pci FLR improvement

This series improves PCI driver management infrastructure in IGT and updates the xe_sriov_flr test to rely on xe-vfio-pci FLR semantics.

It introduces generic PCI driver helpers for driver_override handling and explicit bind/unbind operations.
Adds a small SR-IOV utility to resolve VF PCI slot addresses. Fixes igt_kmod PCI bind/unbind logic to correctly handle module vs driver name mismatches (e.g. xe_vfio_pci vs xe-vfio-pci), marking those helpers as deprecated in favor of driver-level APIs.

The xe_sriov_flr test is updated to attach VFs to xe-vfio-pci before initiating FLR, allowing the test to wait for FLR completion via the driver.

V4 -> V3:
- Clarify igt_pci_get_bound_driver_name() doc that driver/driver_len are optional (NULL/0 valid when only checking bound/unbound) (Lukasz)
- Drop patch checking IOMMU group presence before loading xe-vfio-pci (Lukasz)

V3 -> V2:
- Add --wait-flr-ms option to configure post FLR sleep time
- Add --no-xe-vfio-pci option to skip xe-vfio-pci load
- Skip xe-vfio-pci load/bind when IOMMU is off

V2 -> V1:
- Add igt_pci_get_bound_driver_name() to query the currently bound PCI driver via the /sys/bus/pci/devices/<BDF>/driver symlink.
- Extend igt_pci_bind_driver_override() and igt_pci_unbind_driver_override() with a timeout_ms parameter so callers can wait for bind/unbind to actually complete, instead of relying on drivers_probe write success. drivers_probe only initiates an async reprobe, so a successful write does not mean bind/unbind succeeded - verify the effective bound driver with a timeout.
- Unbind VFs only if they were successfully bound.

Marcin Bernatowicz (6):
lib/igt_sriov_device: Add helper to get VF PCI slot address lib/igt_pci: Add generic PCI driver override and bind/unbind helpers tests/intel/xe_sriov_flr: Attach VFs to xe-vfio-pci before initiating
FLR
lib/igt_kmod: Fix PCI bind/unbind for module/driver name mismatch tests/intel/xe_sriov_flr: Add --wait-flr-ms option tests/intel/xe_sriov_flr: Add --no-xe-vfio-pci option

 lib/igt_kmod.c             |  90 ++++++----
 lib/igt_pci.c              | 354 +++++++++++++++++++++++++++++++++++++
 lib/igt_pci.h              |  13 +-
 lib/igt_sriov_device.c     |  25 +++
 lib/igt_sriov_device.h     |   1 +
 tests/intel/xe_sriov_flr.c | 110 +++++++++++-
 6 files changed, 551 insertions(+), 42 deletions(-)
Signature · 1 line
2.43.0