| b72099be | 28-Sep-2021 |
David Marchand <[email protected]> |
net/virtio-user: fix init when using existing tap
When attaching to an existing mono queue tap, the virtio-user was not reporting that the virtio device was not properly initialised which prevented
net/virtio-user: fix init when using existing tap
When attaching to an existing mono queue tap, the virtio-user was not reporting that the virtio device was not properly initialised which prevented from starting the port later.
$ ip tuntap add test mode tap $ dpdk-testpmd --vdev \ net_virtio_user0,iface=test,path=/dev/vhost-net,queues=2 -- -i
... virtio_user_dev_init_mac(): (/dev/vhost-net) No valid MAC in devargs or device, use random vhost_kernel_open_tap(): TUNSETIFF failed: Invalid argument vhost_kernel_enable_queue_pair(): fail to open tap for vhost kernel virtio_user_start_device(): (/dev/vhost-net) Failed to start device ... Configuring Port 0 (socket 0) vhost_kernel_open_tap(): TUNSETIFF failed: Invalid argument vhost_kernel_enable_queue_pair(): fail to open tap for vhost kernel virtio_set_multiple_queues(): Multiqueue configured but send command failed, this is too late now... Fail to start port 0: Invalid argument Please stop the ports first Done
The virtio-user with vhost-kernel backend was going through a lot of complications to initialise tap fds only when using them.
For each qp enabled for the first time, a tapfd was created via TUNSETIFF with unneeded additional steps (see below) and then mapped to the right qp in the vhost-net backend. Unneeded steps (as long as it has been done once for the port): - tap features were queried while this is a constant on a running system, - the device name in DPDK was updated, - the mac address of the tap was set,
On subsequent qps state change, the vhost-net backend fd mapping was updated and the associated queue/tapfd were disabled/enabled via TUNSETQUEUE.
Now, this patch simplifies the whole logic by keeping all tapfds opened and in enabled state (from the tap point of view) at all time.
Unused ioctl defines are removed.
Tap features are validated earlier to fail initialisation asap. Tap name discovery and mac address configuration are moved when configuring qp 0.
To support attaching to mono queue tap, the virtio-user driver now tries to attach in multi queue first, then fallbacks to mono queue.
Finally (but this is more for consistency), VIRTIO_NET_F_MQ feature is exposed only if the underlying tap supports multi queue.
Signed-off-by: David Marchand <[email protected]> Reviewed-by: Maxime Coquelin <[email protected]>
show more ...
|
| c995b005 | 17-Jun-2021 |
Maxime Coquelin <[email protected]> |
net/virtio: add MAC device config getter and setter
This patch uses the new device config ops to get and set the MAC address if supported.
If a valid MAC address is passed as devarg of the Virtio-u
net/virtio: add MAC device config getter and setter
This patch uses the new device config ops to get and set the MAC address if supported.
If a valid MAC address is passed as devarg of the Virtio-user PMD, the driver will try to store it in the device config space. Otherwise the one provided in the device config space will be used, if available.
Signed-off-by: Maxime Coquelin <[email protected]> Reviewed-by: Chenbo Xia <[email protected]>
show more ...
|
| 9b7466f6 | 17-Jun-2021 |
Maxime Coquelin <[email protected]> |
net/virtio: add device config support to vDPA
This patch introduces two virtio-user callbacks to get and set device's config, and implements it for vDPA backends.
Signed-off-by: Maxime Coquelin <ma
net/virtio: add device config support to vDPA
This patch introduces two virtio-user callbacks to get and set device's config, and implements it for vDPA backends.
Signed-off-by: Maxime Coquelin <[email protected]> Reviewed-by: Chenbo Xia <[email protected]>
show more ...
|
| f078c2f0 | 17-Jun-2021 |
Maxime Coquelin <[email protected]> |
net/virtio: keep device and frontend features separated
This patch is preliminary rework to add support for getting and setting device's config space.
In order to get or set a device config such as
net/virtio: keep device and frontend features separated
This patch is preliminary rework to add support for getting and setting device's config space.
In order to get or set a device config such as its MAC address, we need to know whether the device itself support the feature, or if it is emulated by the frontend.
Signed-off-by: Maxime Coquelin <[email protected]> Reviewed-by: Chenbo Xia <[email protected]>
show more ...
|
| 2e4c1b50 | 26-Jan-2021 |
Maxime Coquelin <[email protected]> |
net/virtio: handle virtio-user setup failure properly
This patch fixes virtio_user_dev_setup() error path, by cleaning all resources it allocates. It introduces virtio_user_dev_uninit_notify() that
net/virtio: handle virtio-user setup failure properly
This patch fixes virtio_user_dev_setup() error path, by cleaning all resources it allocates. It introduces virtio_user_dev_uninit_notify() that cleans all open FDs. It implies assigning all FDs to -1 at init time.
With these changes done, virtio_user_dev_init_notify() can be simplified.
Suggested-by: Adrian Moreno <[email protected]> Signed-off-by: Maxime Coquelin <[email protected]> Reviewed-by: Chenbo Xia <[email protected]>
show more ...
|
| 432a195f | 26-Jan-2021 |
Maxime Coquelin <[email protected]> |
net/virtio: improve vhost-user error logging
This patch improves error logging in vhost_user_read, especially printing errno when recv() fails.
Suggested-by: Adrian Moreno <[email protected]> Sig
net/virtio: improve vhost-user error logging
This patch improves error logging in vhost_user_read, especially printing errno when recv() fails.
Suggested-by: Adrian Moreno <[email protected]> Signed-off-by: Maxime Coquelin <[email protected]> Reviewed-by: Chenbo Xia <[email protected]>
show more ...
|
| 4173c55a | 26-Jan-2021 |
Maxime Coquelin <[email protected]> |
net/virtio: move vhost-vDPA data to its backend
As done earlier for Vhost-user and Vhost-kernel, this patch moves the Vhost-vDPA specific data to its backend file.
Signed-off-by: Maxime Coquelin <m
net/virtio: move vhost-vDPA data to its backend
As done earlier for Vhost-user and Vhost-kernel, this patch moves the Vhost-vDPA specific data to its backend file.
Signed-off-by: Maxime Coquelin <[email protected]> Reviewed-by: Chenbo Xia <[email protected]>
show more ...
|
| 86388a3a | 26-Jan-2021 |
Maxime Coquelin <[email protected]> |
net/virtio: move vhost-kernel data to its backend
As done earlier for Vhost-user, this patch moves the Vhost-Kernel specific data to its backend file.
Signed-off-by: Maxime Coquelin <maxime.coqueli
net/virtio: move vhost-kernel data to its backend
As done earlier for Vhost-user, this patch moves the Vhost-Kernel specific data to its backend file.
Signed-off-by: Maxime Coquelin <[email protected]> Reviewed-by: Chenbo Xia <[email protected]>
show more ...
|
| 94973531 | 26-Jan-2021 |
Maxime Coquelin <[email protected]> |
net/virtio: move vhost-user specifics to its backend
This patch moves all the Vhost-user backend specific logic like Vhost FD, listen FD and interrupt handling to the vhost-user backend implementati
net/virtio: move vhost-user specifics to its backend
This patch moves all the Vhost-user backend specific logic like Vhost FD, listen FD and interrupt handling to the vhost-user backend implementation.
In order to achieve that, new ops are created to update the link status, disconnect and reconnect the server, and fetch the link state interrupt FD.
Signed-off-by: Maxime Coquelin <[email protected]> Reviewed-by: Chenbo Xia <[email protected]>
show more ...
|
| 748e5ea5 | 26-Jan-2021 |
Maxime Coquelin <[email protected]> |
net/virtio: introduce backend data
The goal of this patch is to introduce backend-specific data in order to better isolate what is backend-specific from what is generic to Virtio-user.
For now, onl
net/virtio: introduce backend data
The goal of this patch is to introduce backend-specific data in order to better isolate what is backend-specific from what is generic to Virtio-user.
For now, only Vhost-user protocol features are moved to Vhost-user backend data.
Signed-off-by: Maxime Coquelin <[email protected]> Reviewed-by: Chenbo Xia <[email protected]>
show more ...
|