patch 'net/virtio-user: fix control queue destruction' has been queued to stable release 23.11.2
Xueming Li
xuemingl at nvidia.com
Fri Jul 12 12:44:39 CEST 2024
Hi,
FYI, your patch has been queued to stable release 23.11.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 07/14/24. So please
shout if anyone has objections.
Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.
Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging
This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=9f5bb6deb44b1f930706cae2af544fa05a2fe7d3
Thanks.
Xueming Li <xuemingl at nvidia.com>
---
>From 9f5bb6deb44b1f930706cae2af544fa05a2fe7d3 Mon Sep 17 00:00:00 2001
From: Maxime Coquelin <maxime.coquelin at redhat.com>
Date: Thu, 28 Mar 2024 14:08:11 +0100
Subject: [PATCH] net/virtio-user: fix control queue destruction
Cc: Xueming Li <xuemingl at nvidia.com>
[ upstream commit bffcdad5ecaf1e1030271357cd9871f87857b1e4 ]
This patch uses the freshly renamed iterator to destroy
queues at stop time. Doing this, we fix the missing
control queue destruction.
Fixes: 90966e8e5b67 ("net/virtio-user: send shadow virtqueue info to the backend")
Signed-off-by: Maxime Coquelin <maxime.coquelin at redhat.com>
Acked-by: David Marchand <david.marchand at redhat.com>
---
.../net/virtio/virtio_user/virtio_user_dev.c | 43 +++++++++++++++----
1 file changed, 34 insertions(+), 9 deletions(-)
diff --git a/drivers/net/virtio/virtio_user/virtio_user_dev.c b/drivers/net/virtio/virtio_user/virtio_user_dev.c
index 4fd89a8e97..ce9e73493d 100644
--- a/drivers/net/virtio/virtio_user/virtio_user_dev.c
+++ b/drivers/net/virtio/virtio_user/virtio_user_dev.c
@@ -32,6 +32,22 @@ const char * const virtio_user_backend_strings[] = {
[VIRTIO_USER_BACKEND_VHOST_VDPA] = "VHOST_VDPA",
};
+static int
+virtio_user_destroy_queue(struct virtio_user_dev *dev, uint32_t queue_sel)
+{
+ struct vhost_vring_state state;
+ int ret;
+
+ state.index = queue_sel;
+ ret = dev->ops->get_vring_base(dev, &state);
+ if (ret < 0) {
+ PMD_DRV_LOG(ERR, "(%s) Failed to destroy queue %u", dev->path, queue_sel);
+ return -1;
+ }
+
+ return 0;
+}
+
static int
virtio_user_create_queue(struct virtio_user_dev *dev, uint32_t queue_sel)
{
@@ -127,6 +143,22 @@ err:
return -1;
}
+static int
+virtio_user_foreach_queue(struct virtio_user_dev *dev, int (*fn)(struct virtio_user_dev *, uint32_t))
+{
+ uint32_t i, nr_vq;
+
+ nr_vq = dev->max_queue_pairs * 2;
+ if (dev->hw_cvq)
+ nr_vq++;
+
+ for (i = 0; i < nr_vq; i++)
+ if (fn(dev, i) < 0)
+ return -1;
+
+ return 0;
+}
+
static int
virtio_user_queue_setup(struct virtio_user_dev *dev,
int (*fn)(struct virtio_user_dev *, uint32_t))
@@ -239,7 +271,6 @@ error:
int virtio_user_stop_device(struct virtio_user_dev *dev)
{
- struct vhost_vring_state state;
uint32_t i;
int ret;
@@ -260,14 +291,8 @@ int virtio_user_stop_device(struct virtio_user_dev *dev)
}
/* Stop the backend. */
- for (i = 0; i < dev->max_queue_pairs * 2; ++i) {
- state.index = i;
- ret = dev->ops->get_vring_base(dev, &state);
- if (ret < 0) {
- PMD_DRV_LOG(ERR, "(%s) get_vring_base failed, index=%u", dev->path, i);
- goto err;
- }
- }
+ if (virtio_user_foreach_queue(dev, virtio_user_destroy_queue) < 0)
+ goto err;
dev->started = false;
--
2.34.1
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2024-07-12 18:40:16.623225225 +0800
+++ 0053-net-virtio-user-fix-control-queue-destruction.patch 2024-07-12 18:40:14.096594228 +0800
@@ -1 +1 @@
-From bffcdad5ecaf1e1030271357cd9871f87857b1e4 Mon Sep 17 00:00:00 2001
+From 9f5bb6deb44b1f930706cae2af544fa05a2fe7d3 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit bffcdad5ecaf1e1030271357cd9871f87857b1e4 ]
@@ -11 +13,0 @@
-Cc: stable at dpdk.org
@@ -16,2 +18,2 @@
- .../net/virtio/virtio_user/virtio_user_dev.c | 27 ++++++++++++-------
- 1 file changed, 18 insertions(+), 9 deletions(-)
+ .../net/virtio/virtio_user/virtio_user_dev.c | 43 +++++++++++++++----
+ 1 file changed, 34 insertions(+), 9 deletions(-)
@@ -20 +22 @@
-index 5e998750ae..07f45984fe 100644
+index 4fd89a8e97..ce9e73493d 100644
@@ -23 +25 @@
-@@ -33,6 +33,22 @@ const char * const virtio_user_backend_strings[] = {
+@@ -32,6 +32,22 @@ const char * const virtio_user_backend_strings[] = {
@@ -46 +48,24 @@
-@@ -237,7 +253,6 @@ error:
+@@ -127,6 +143,22 @@ err:
+ return -1;
+ }
+
++static int
++virtio_user_foreach_queue(struct virtio_user_dev *dev, int (*fn)(struct virtio_user_dev *, uint32_t))
++{
++ uint32_t i, nr_vq;
++
++ nr_vq = dev->max_queue_pairs * 2;
++ if (dev->hw_cvq)
++ nr_vq++;
++
++ for (i = 0; i < nr_vq; i++)
++ if (fn(dev, i) < 0)
++ return -1;
++
++ return 0;
++}
++
+ static int
+ virtio_user_queue_setup(struct virtio_user_dev *dev,
+ int (*fn)(struct virtio_user_dev *, uint32_t))
+@@ -239,7 +271,6 @@ error:
@@ -54 +79 @@
-@@ -258,14 +273,8 @@ int virtio_user_stop_device(struct virtio_user_dev *dev)
+@@ -260,14 +291,8 @@ int virtio_user_stop_device(struct virtio_user_dev *dev)
More information about the stable
mailing list