History

vdpa: add driver_override support

`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.

Stefano Garzarella committed 4 years ago

Commit 539fec71 parent 9c25cde3 files · +96 −0Browse files

Showing the changes to include (1 of 3 files). Show all

Unified · Split

include/linux/vdpa.h+2−0
@@ -64,6 +64,7 @@ struct vdpa_mgmt_dev; · 63 unmodified lines
6464 * struct vdpa_device - representation of a vDPA device
6565 * @dev: underlying device
6666 * @dma_dev: the actual device that is performing DMA
67+ * @driver_override: driver name to force a match
6768 * @config: the configuration ops for this device.
6869 * @cf_mutex: Protects get and set access to configuration layout.
6970 * @index: device index
@@ -76,6 +77,7 @@ struct vdpa_mgmt_dev; · 6 unmodified lines
7677 struct vdpa_device {
7778 struct device dev;
7879 struct device *dma_dev;
80+ const char *driver_override;
7981 const struct vdpa_config_ops *config;
8082 struct mutex cf_mutex; /* Protects get/set config */
8183 unsigned int index;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t