[PATCH v2 4/4] net/virtio-user: fix control queue allocation

Maxime Coquelin maxime.coquelin at redhat.com
Thu Mar 28 14:08:13 CET 2024


It is possible to have the control queue without the
device advertising VIRTIO_NET_F_MQ.

Rely on the VIRTIO_NET_F_CTRL_VQ feature being advertised
instead.

Fixes: 6fdf32d1e318 ("net/virtio-user: remove max queues limitation")
Cc: stable at dpdk.org

Signed-off-by: Maxime Coquelin <maxime.coquelin at redhat.com>
---
 drivers/net/virtio/virtio_user/virtio_user_dev.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/virtio/virtio_user/virtio_user_dev.c b/drivers/net/virtio/virtio_user/virtio_user_dev.c
index 912e87fecf..b3aed48452 100644
--- a/drivers/net/virtio/virtio_user/virtio_user_dev.c
+++ b/drivers/net/virtio/virtio_user/virtio_user_dev.c
@@ -21,6 +21,7 @@
 #include <rte_io.h>
 
 #include "vhost.h"
+#include "virtio.h"
 #include "virtio_user_dev.h"
 #include "../virtio_ethdev.h"
 
@@ -615,7 +616,7 @@ virtio_user_alloc_vrings(struct virtio_user_dev *dev)
 	bool packed_ring = !!(dev->device_features & (1ull << VIRTIO_F_RING_PACKED));
 
 	nr_vrings = dev->max_queue_pairs * 2;
-	if (dev->device_features & (1ull << VIRTIO_NET_F_MQ))
+	if (dev->device_features & (1ull << VIRTIO_NET_F_CTRL_VQ))
 		nr_vrings++;
 
 	dev->callfds = rte_zmalloc("virtio_user_dev", nr_vrings * sizeof(*dev->callfds), 0);
-- 
2.44.0



More information about the stable mailing list