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>
Subject: [PATCH 1/4] net/virtio: rename Virtio-user queue iterator
Date: Wed, 27 Mar 2024 10:40:29 +0100 [thread overview]
Message-ID: <20240327094032.2400951-2-maxime.coquelin@redhat.com> (raw)
In-Reply-To: <20240327094032.2400951-1-maxime.coquelin@redhat.com>
This is a preliminary rework to prepare for iterating
over queues for non-setup operations.
Also, remove the error log that does not provide much
information given the callbacks already provide one.
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
drivers/net/virtio/virtio_user/virtio_user_dev.c | 13 +++++--------
1 file changed, 5 insertions(+), 8 deletions(-)
diff --git a/drivers/net/virtio/virtio_user/virtio_user_dev.c b/drivers/net/virtio/virtio_user/virtio_user_dev.c
index 4fdfe70e7c..c3d44880f5 100644
--- a/drivers/net/virtio/virtio_user/virtio_user_dev.c
+++ b/drivers/net/virtio/virtio_user/virtio_user_dev.c
@@ -129,7 +129,7 @@ virtio_user_kick_queue(struct virtio_user_dev *dev, uint32_t queue_sel)
}
static int
-virtio_user_queue_setup(struct virtio_user_dev *dev,
+virtio_user_foreach_queue(struct virtio_user_dev *dev,
int (*fn)(struct virtio_user_dev *, uint32_t))
{
uint32_t i, nr_vq;
@@ -138,12 +138,9 @@ virtio_user_queue_setup(struct virtio_user_dev *dev,
if (dev->hw_cvq)
nr_vq++;
- for (i = 0; i < nr_vq; i++) {
- if (fn(dev, i) < 0) {
- PMD_DRV_LOG(ERR, "(%s) setup VQ %u failed", dev->path, i);
+ for (i = 0; i < nr_vq; i++)
+ if (fn(dev, i) < 0)
return -1;
- }
- }
return 0;
}
@@ -157,7 +154,7 @@ virtio_user_dev_set_features(struct virtio_user_dev *dev)
pthread_mutex_lock(&dev->mutex);
/* Step 0: tell vhost to create queues */
- if (virtio_user_queue_setup(dev, virtio_user_create_queue) < 0)
+ if (virtio_user_foreach_queue(dev, virtio_user_create_queue) < 0)
goto error;
features = dev->features;
@@ -205,7 +202,7 @@ virtio_user_start_device(struct virtio_user_dev *dev)
goto error;
/* Step 3: kick queues */
- ret = virtio_user_queue_setup(dev, virtio_user_kick_queue);
+ ret = virtio_user_foreach_queue(dev, virtio_user_kick_queue);
if (ret < 0)
goto error;
--
2.44.0
next prev parent reply other threads:[~2024-03-27 9:40 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 ` Maxime Coquelin [this message]
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 ` [PATCH 4/4] net/virtio: fix shadow control queue allocation Maxime Coquelin
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-2-maxime.coquelin@redhat.com \
--to=maxime.coquelin@redhat.com \
--cc=chenbox@nvidia.com \
--cc=david.marchand@redhat.com \
--cc=dev@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).