Messages in this thread | | | Date | Fri, 5 Nov 2021 09:31:08 +0100 | From | Stefano Garzarella <> | Subject | Re: [PATCH] vdpa: add driver_override support |
| |
On Fri, Nov 05, 2021 at 04:26:44PM +0800, Jason Wang wrote: >On Fri, Nov 5, 2021 at 4:05 PM Stefano Garzarella <sgarzare@redhat.com> wrote: >> >> On Fri, Nov 05, 2021 at 11:01:30AM +0800, Jason Wang wrote: >> >On Fri, Nov 5, 2021 at 12:17 AM Stefano Garzarella <sgarzare@redhat.com> wrote: >> >> >> >> `driver_override` allows to control which of the vDPA bus drivers >> >> binds to a vDPA device. >> >> >> >> If `driver_override` is not set, the previous behaviour is followed: >> >> devices use the first vDPA bus driver loaded (unless auto binding >> >> is disabled). >> >> >> >> Tested on Fedora 34 with driverctl(8): >> >> $ modprobe virtio-vdpa >> >> $ modprobe vhost-vdpa >> >> $ modprobe vdpa-sim-net >> >> >> >> $ vdpa dev add mgmtdev vdpasim_net name dev1 >> >> >> >> # dev1 is attached to the first vDPA bus driver loaded >> >> $ driverctl -b vdpa list-devices >> >> dev1 virtio_vdpa >> >> >> >> $ driverctl -b vdpa set-override dev1 vhost_vdpa >> >> >> >> $ driverctl -b vdpa list-devices >> >> dev1 vhost_vdpa [*] >> >> >> >> Note: driverctl(8) integrates with udev so the binding is >> >> preserved. >> >> >> >> Suggested-by: Jason Wang <jasowang@redhat.com> >> >> Signed-off-by: Stefano Garzarella <sgarzare@redhat.com> >> >> --- >> >> include/linux/vdpa.h | 2 ++ >> >> drivers/vdpa/vdpa.c | 74 ++++++++++++++++++++++++++++++++++++++++++++ >> >> 2 files changed, 76 insertions(+) >> >> >> >> diff --git a/include/linux/vdpa.h b/include/linux/vdpa.h >> >> index c3011ccda430..ae34015b37b7 100644 >> >> --- a/include/linux/vdpa.h >> >> +++ b/include/linux/vdpa.h >> >> @@ -64,6 +64,7 @@ struct vdpa_mgmt_dev; >> >> * struct vdpa_device - representation of a vDPA device >> >> * @dev: underlying device >> >> * @dma_dev: the actual device that is performing DMA >> >> + * @driver_override: driver name to force a match >> > >> >This seems useless? >> >> I'm a bit lost, do you mean we should remove the documentation of >> `driver_override`? > >I misread the code which was misled by vdpa_mgmt_dev above:(
Yeah, the same thing happened to me now while double checking ;-)
> >The code should be fine. > >So: > >Acked-by: Jason Wang <jasowang@redhat.com> >
Thanks, Stefano
| |