Content-Type: multipart/mixed; boundary="===============6721895605069208085==" MIME-Version: 1.0 From: Harris, James R Subject: [SPDK] Re: Clarification regarding VFIO driver bind in the setup.sh Date: Wed, 18 Aug 2021 00:00:57 +0000 Message-ID: <9ECE3CF3-BC04-4063-B565-8530C0B5FE84@intel.com> In-Reply-To: 20210816223624.2778.21718@ml01.vlan13.01.org List-ID: To: spdk@lists.01.org --===============6721895605069208085== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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 dev= ices 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 o= nly do the necessary sysfs writes. Are these extra writes to /bind a problem in your use case, or was your que= stion more out of curiosity? Regards, Jim =EF=BB=BFOn 8/16/21, 3:36 PM, "chandanga(a)google.com" wrote: I needed a clarification regarding the VFIO setup script for SPDK (http= s://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> /de= v/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 drive= r) 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 ste= ps are required? Thanks. _______________________________________________ SPDK mailing list -- spdk(a)lists.01.org To unsubscribe send an email to spdk-leave(a)lists.01.org --===============6721895605069208085==--