vfio: selftests: Automate finding/setting up devices for testing
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest2 patches 6 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | vfio: selftests: Find devices that are compatible with VFIO selfteststools/ | +40 | 2 replies | |
| 2/2 | vfio: selftests: Automate setting up devices for testingtools/ | +20 | 4 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH 0/2] vfio: selftests: Automate finding/setting up devices for testing
This series introduces two improvements to make setting up devices for VFIO selftests more user-friendly.
1. Add functionality to the VFIO selftest setup script to find devices on a user's system that are compatible with the VFIO selftest framework (i.e. devices that have a VFIO selftest driver).
Example:
$ ./tools/testing/selftests/vfio/scripts/setup.sh -l
Supported devices:
0000:6a:01.0
0000:6f:01.0
0000:74:01.0
0000:79:01.0
0000:e7:01.0
0000:ec:01.0
0000:f1:01.0
0000:f6:01.02. Modify the VFIO selftest setup script to try to find and set up a compatible device automatically. "Set up the device for testing" means unbind the device from its driver, then bind it to VFIO. The user is no longer required to find a segment:bus:device.function number to pass to the script (though this functionality is still available through a -d option).
Example of automated device setup:
$ ./tools/testing/selftests/vfio/scripts/setup.sh
+ echo "0000:6a:01.0" > /sys/bus/pci/drivers/idxd/unbind
+ echo "vfio-pci" > /sys/bus/pci/devices/0000:6a:01.0/driver_override
+ echo "0000:6a:01.0" > /sys/bus/pci/drivers/vfio-pci/bind
Successfully set up 0000:6a:01.0Example of manual device setup:
$ ./tools/testing/selftests/vfio/scripts/setup.sh -d 0000:6a:01.0
+ echo "0000:6a:01.0" > /sys/bus/pci/drivers/idxd/unbind
+ echo "vfio-pci" > /sys/bus/pci/devices/0000:6a:01.0/driver_override
+ echo "0000:6a:01.0" > /sys/bus/pci/drivers/vfio-pci/bind
Successfully set up 0000:6a:01.0Josh Hilke (2):
vfio: selftests: Find devices that are compatible with VFIO selftests
vfio: selftests: Automate finding/setting up devices for testing
tools/testing/selftests/vfio/scripts/setup.sh | 63 +++++++++++++++++-- 1 file changed, 59 insertions(+), 4 deletions(-)
Signature · 1 line
2.53.0.1213.gd9a14994de-goog