`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.
Showing the changes to include (1 of 3 files). Show all
Unified · Split
| @@ -64,6 +64,7 @@ struct vdpa_mgmt_dev; · 63 unmodified lines | ||
| 64 | 64 | * struct vdpa_device - representation of a vDPA device |
| 65 | 65 | * @dev: underlying device |
| 66 | 66 | * @dma_dev: the actual device that is performing DMA |
| 67 | + * @driver_override: driver name to force a match | |
| 67 | 68 | * @config: the configuration ops for this device. |
| 68 | 69 | * @cf_mutex: Protects get and set access to configuration layout. |
| 69 | 70 | * @index: device index |
| @@ -76,6 +77,7 @@ struct vdpa_mgmt_dev; · 6 unmodified lines | ||
| 76 | 77 | struct vdpa_device { |
| 77 | 78 | struct device dev; |
| 78 | 79 | struct device *dma_dev; |
| 80 | + const char *driver_override; | |
| 79 | 81 | const struct vdpa_config_ops *config; |
| 80 | 82 | struct mutex cf_mutex; /* Protects get/set config */ |
| 81 | 83 | unsigned int index; |