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