Linux PCI subsystem development
 help / color / mirror / Atom feed
* Usage of sriov_drivers_autoprobe
@ 2023-05-30 20:58 Ben Gardon
  2023-06-01 22:10 ` Bjorn Helgaas
  0 siblings, 1 reply; 2+ messages in thread
From: Ben Gardon @ 2023-05-30 20:58 UTC (permalink / raw)
  To: linux-pci, Bodong Wang
  Cc: Bjorn Helgaas, Eli Cohen, Gavin Shan, Alex Williamson

Hi Bodong, PCI folk generally,

I've found an issue with sriov_drivers_autoprobe not working as I
would expect it to and I'd like to check if my expectations are
incorrect or if it's not working as intended.

Please consider the sequence below

/sys/bus/pci/devices/0000:12:34.1# echo 0 > sriov_numvfs
/sys/bus/pci/devices/0000:12:34.1# echo 0 > sriov_drivers_autoprobe
/sys/bus/pci/devices/0000:12:34.1# echo 1 > sriov_numvfs
(Let's say 0000:13:ab.0 is a VF of 0000:12:34.1)
/sys/bus/pci/devices/0000:12:34.1# echo 0000:13:ab.0 >
/sys/bus/pci/drivers/vfio-pci/bind
-bash: echo: write error: No such device
/sys/bus/pci/devices/0000:12:34.1# echo 1 > sriov_drivers_autoprobe
/sys/bus/pci/devices/0000:12:34.1# echo 0000:13:ab.0 >
/sys/bus/pci/drivers/vfio-pci/bind
/sys/bus/pci/devices/0000:12:34.1# echo 0000:13:ab.0 >
/sys/bus/pci/drivers/vfio-pci/unbind
/sys/bus/pci/devices/0000:12:34.1#

From the above, we can see that having sriov_drivers_autoprobe unset
prevents even manually binding a driver, after VF initialization. This
seems unintentional, but it can be worked around by unsetting
sriov_drivers_autoprobe.

If this is how it was intended to work please let me know. If it is,
then the documentation should be updated. It says: "Note that changing
this file does not affect already-enabled VFs." But that does not
appear to be true.

Thanks for your help, and I'm sorry I'm not offering a fix, but I'm
mostly a KVM engineer and don't know the PCI subsystem well, so I
don't know how best to fix the check on sriov.drivers_autoload.
Ben

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-06-01 22:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-30 20:58 Usage of sriov_drivers_autoprobe Ben Gardon
2023-06-01 22:10 ` Bjorn Helgaas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox