DPDK patches and discussions
 help / color / mirror / Atom feed
From: Maxime Coquelin <maxime.coquelin@redhat.com>
To: dev@dpdk.org, david.marchand@redhat.com, chenbox@nvidia.com
Cc: Maxime Coquelin <maxime.coquelin@redhat.com>, stable@dpdk.org
Subject: [PATCH 4/4] net/virtio: fix shadow control queue allocation
Date: Wed, 27 Mar 2024 10:40:32 +0100	[thread overview]
Message-ID: <20240327094032.2400951-5-maxime.coquelin@redhat.com> (raw)
In-Reply-To: <20240327094032.2400951-1-maxime.coquelin@redhat.com>

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

Let's just rely on hw_cvq flag as in other places.

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 | 2 +-
 1 file changed, 1 insertion(+), 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..5240b44481 100644
--- a/drivers/net/virtio/virtio_user/virtio_user_dev.c
+++ b/drivers/net/virtio/virtio_user/virtio_user_dev.c
@@ -615,7 +615,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->hw_cvq)
 		nr_vrings++;
 
 	dev->callfds = rte_zmalloc("virtio_user_dev", nr_vrings * sizeof(*dev->callfds), 0);
-- 
2.44.0


  parent reply	other threads:[~2024-03-27  9:41 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-27  9:40 [PATCH 0/4] Virtio-user queues setup fixes Maxime Coquelin
2024-03-27  9:40 ` [PATCH 1/4] net/virtio: rename Virtio-user queue iterator Maxime Coquelin
2024-03-27  9:40 ` [PATCH 2/4] net/virtio: use iterator to destroy Virtio-user queues Maxime Coquelin
2024-03-27  9:40 ` [PATCH 3/4] net/virtio: fix shadow control queue notification init Maxime Coquelin
2024-03-27  9:40 ` Maxime Coquelin [this message]
2024-03-27 10:04 ` [PATCH 0/4] Virtio-user queues setup fixes David Marchand

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240327094032.2400951-5-maxime.coquelin@redhat.com \
    --to=maxime.coquelin@redhat.com \
    --cc=chenbox@nvidia.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).