On Tue, 9 Aug 2022 19:44:41 +0800
"lihuisong (C)" <lihuis...@huawei.com> wrote:

> 在 2022/8/5 23:35, Stephen Hemminger 写道:
> > On Fri, 5 Aug 2022 11:10:22 +0800
> > Huisong Li <lihuis...@huawei.com> wrote:
> >  
> >> Currently, the steps for binding device from dpdk driver to kernel
> >> driver is as follows:
> >> echo $BDF > /sys/bus/pci/drivers/vfio-pci/unbind
> >> echo $BDF > /sys/bus/pci/drivers/$kernel_driver/bind
> >>
> >> This steps cannot bind device from dpdk driver to kernel driver on
> >> platform with kernel 5.19. The 'driver_override' must be specify
> >> kernel driver before binding device to kernel driver.
> >>
> >> Fixes: 720b7a058260 ("usertools: fix device binding with kernel tools")
> >> Cc: sta...@dpdk.org
> >>
> >> Signed-off-by: Huisong Li <lihuis...@huawei.com>  
> > Not sure exactly what you did and why.
> > The patch seems to just remove the check that the driver
> > is in the set of dpdk_drivers.
> > .  
> Currently, the end of the operation binding device from kernel driver to
> dpdk driver write '\00' to driver_override file so as to this device can
> be bound to any other driver. And perform following steps to
> bind device dpdk driver to kernel driver:
> echo $BDF > /sys/bus/pci/drivers/vfio-pci/unbind
> echo $BDF > /sys/bus/pci/drivers/$kernel_driver/bind


> 
> However, due to the patch[1] merged into 5.19 kernel, 'driver_override'
> in the pci_dev is no longer NULL by writing '\00' to driver_override file.
> This causes PCI match device failure and the device will never be bound to
> their kernel driver.


Linux kernel does not look favorably on API changes and that looks like
the kernel changed behavior. That should be reported and fixed there.

> In 5.19 kernel, I found that dpdk-devbind.py need to write '\n' to
> driver_override file if we want to bind divce to any other driver.
> But I think it is not necessary to write empty to driver_override
> file. After all, the device has only one kernel driver, and binding
> to dpdk driver(like, vfio-pci) must specify driver_override.
> 
> [1] 23d99baf9d72 ("PCI: Use driver_set_override() instead of open-coding")

The method of using driver override is based off of what the
upstream driverctl package https://gitlab.com/driverctl/driverctl does.
In fact, I would recommend the driverctl package to users over using
our python script.

Reply via email to