[v2,4/4] net/virtio-user: fix control queue allocation
Checks
Commit Message
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>
---
drivers/net/virtio/virtio_user/virtio_user_dev.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
Comments
On Thu, Mar 28, 2024 at 2:08 PM Maxime Coquelin
<maxime.coquelin@redhat.com> wrote:
>
> 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>
@@ -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);