diff options
author | Maxime Coquelin <maxime.coquelin@redhat.com> | 2024-03-28 14:08:13 +0100 |
---|---|---|
committer | Maxime Coquelin <maxime.coquelin@redhat.com> | 2024-06-12 09:55:52 +0200 |
commit | c9fa5a05b327e1cbb7c8964cd3ea61d0662b1965 (patch) | |
tree | 618cfb37ec445352e3e70517ff5f16ab9a59a6f5 | |
parent | 519ff2809805d04d586e490a9a20ab1e8d348a26 (diff) |
net/virtio-user: fix control queue allocation
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@dpdk.org
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: David Marchand <david.marchand@redhat.com>
-rw-r--r-- | drivers/net/virtio/virtio_user/virtio_user_dev.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/virtio/virtio_user/virtio_user_dev.c b/drivers/net/virtio/virtio_user/virtio_user_dev.c index ba067d6d9c..1365c8a5c8 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); |