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 <david.marchand@redhat.com> Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
DPDK is a set of libraries and drivers for fast packet processing. It supports many processor architectures and both FreeBSD and Linux. The DPDK uses the Open Source BSD-3-Clause license for the core libraries and drivers. The kernel components are GPL-2.0 licensed. Please check the doc directory for release notes, API documentation, and sample application information. For questions and usage discussions, subscribe to: users@dpdk.org Report bugs and issues to the development mailing list: dev@dpdk.org
Description
Languages
C
99.1%
Meson
0.5%
Python
0.2%
Shell
0.1%