* [SPDK] Re: Clarification regarding VFIO driver bind in the setup.sh
@ 2021-08-18 0:00 Harris, James R
0 siblings, 0 replies; only message in thread
From: Harris, James R @ 2021-08-18 0:00 UTC (permalink / raw)
To: spdk
[-- Attachment #1: Type: text/plain, Size: 1616 bytes --]
Hi,
For binding to vfio-pci (or uio_pci_generic), the first line is sufficient.
This same function is also used though for `setup.sh reset` to bind the devices back to their respective kernel mode drivers. For that case, the bind is required (but not the new_id).
So both steps are there since the linux_bind_driver() function is used for both cases. It could probably be optimized to check the $driver_name and only do the necessary sysfs writes.
Are these extra writes to /bind a problem in your use case, or was your question more out of curiosity?
Regards,
Jim
On 8/16/21, 3:36 PM, "chandanga(a)google.com" <chandanga(a)google.com> wrote:
I needed a clarification regarding the VFIO setup script for SPDK (https://github.com/spdk/spdk/blob/master/scripts/setup.sh).
In the linux_bind_driver() method, we have the following lines:
echo "$ven_dev_id" > "/sys/bus/pci/drivers/$driver_name/new_id" 2> /dev/null || true
echo "$bdf" > "/sys/bus/pci/drivers/$driver_name/bind" 2> /dev/null || true
I'm wondering if both steps are necessary? It looks like if we set the vendor_id, device_id into "/sys/bus/pci/drivers/vfio-pci/new_id", this will automatically assign all the VFs (which are not assigned to the NVMe driver) to the VFIO driver. Hence, the second line (echoing the $bdf to the bind file) becomes redundant. Is this correct? Any reason why both of these steps are required? Thanks.
_______________________________________________
SPDK mailing list -- spdk(a)lists.01.org
To unsubscribe send an email to spdk-leave(a)lists.01.org
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-08-18 0:00 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-18 0:00 [SPDK] Re: Clarification regarding VFIO driver bind in the setup.sh Harris, James R
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.