patch 'vhost: restrict set max queue pair API to VDUSE' has been queued to stable release 23.11.3

Xueming Li xuemingl at nvidia.com
Mon Nov 11 07:27:37 CET 2024


Hi,

FYI, your patch has been queued to stable release 23.11.3

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 11/30/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=e1bd966815e01d4bbac59b413ec35e5ebd0a416c

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From e1bd966815e01d4bbac59b413ec35e5ebd0a416c Mon Sep 17 00:00:00 2001
From: Maxime Coquelin <maxime.coquelin at redhat.com>
Date: Thu, 3 Oct 2024 10:11:10 +0200
Subject: [PATCH] vhost: restrict set max queue pair API to VDUSE
Cc: Xueming Li <xuemingl at nvidia.com>

[ upstream commit e1808999d36bb2e136a649f4651f36030aa468f1 ]

In order to avoid breaking Vhost-user live-migration, we want the
rte_vhost_driver_set_max_queue_num API to only be effective with
VDUSE.

Furthermore, this API is only really needed for VDUSE where the
device number of queues is defined by the backend. For Vhost-user,
this is defined by the frontend (e.g. QEMU), so the advantages of
restricting more the maximum number of queue pairs is limited to
a small memory gain (a handful of pointers).

Fixes: 4aa1f88ac13d ("vhost: add API to set max queue pairs")

Reported-by: Yu Jiang <yux.jiang at intel.com>
Signed-off-by: Maxime Coquelin <maxime.coquelin at redhat.com>
Acked-by: David Marchand <david.marchand at redhat.com>
---
 lib/vhost/rte_vhost.h |  2 ++
 lib/vhost/socket.c    | 11 +++++++++++
 2 files changed, 13 insertions(+)

diff --git a/lib/vhost/rte_vhost.h b/lib/vhost/rte_vhost.h
index db92f05344..c6dba67a67 100644
--- a/lib/vhost/rte_vhost.h
+++ b/lib/vhost/rte_vhost.h
@@ -613,6 +613,8 @@ rte_vhost_driver_get_queue_num(const char *path, uint32_t *queue_num);
  * @b EXPERIMENTAL: this API may change, or be removed, without prior notice.
  *
  * Set the maximum number of queue pairs supported by the device.
+ * The value set is ignored for Vhost-user backends. It is only taken into
+ * account with VDUSE backends.
  *
  * @param path
  *  The vhost-user socket file path
diff --git a/lib/vhost/socket.c b/lib/vhost/socket.c
index 0b95c54c5b..ffb8518e74 100644
--- a/lib/vhost/socket.c
+++ b/lib/vhost/socket.c
@@ -865,6 +865,17 @@ rte_vhost_driver_set_max_queue_num(const char *path, uint32_t max_queue_pairs)
 		goto unlock_exit;
 	}

+	/*
+	 * This is only useful for VDUSE for which number of virtqueues is set
+	 * by the backend. For Vhost-user, the number of virtqueues is defined
+	 * by the frontend.
+	 */
+	if (!vsocket->is_vduse) {
+		VHOST_LOG_CONFIG(path, DEBUG, "Keeping %u max queue pairs for Vhost-user backend\n",
+				 VHOST_MAX_QUEUE_PAIRS);
+		goto unlock_exit;
+	}
+
 	vsocket->max_queue_pairs = max_queue_pairs;

 unlock_exit:
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-11-11 14:23:07.569998190 +0800
+++ 0051-vhost-restrict-set-max-queue-pair-API-to-VDUSE.patch	2024-11-11 14:23:05.122192840 +0800
@@ -1 +1 @@
-From e1808999d36bb2e136a649f4651f36030aa468f1 Mon Sep 17 00:00:00 2001
+From e1bd966815e01d4bbac59b413ec35e5ebd0a416c Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit e1808999d36bb2e136a649f4651f36030aa468f1 ]
@@ -17 +19,0 @@
-Cc: stable at dpdk.org
@@ -24,2 +26,2 @@
- lib/vhost/socket.c    | 12 ++++++++++++
- 2 files changed, 14 insertions(+)
+ lib/vhost/socket.c    | 11 +++++++++++
+ 2 files changed, 13 insertions(+)
@@ -28 +30 @@
-index c7a5f56df8..1a91a00f02 100644
+index db92f05344..c6dba67a67 100644
@@ -31 +33 @@
-@@ -614,6 +614,8 @@ rte_vhost_driver_get_queue_num(const char *path, uint32_t *queue_num);
+@@ -613,6 +613,8 @@ rte_vhost_driver_get_queue_num(const char *path, uint32_t *queue_num);
@@ -41 +43 @@
-index a75728a2e4..d29d15494c 100644
+index 0b95c54c5b..ffb8518e74 100644
@@ -44 +46 @@
-@@ -860,6 +860,18 @@ rte_vhost_driver_set_max_queue_num(const char *path, uint32_t max_queue_pairs)
+@@ -865,6 +865,17 @@ rte_vhost_driver_set_max_queue_num(const char *path, uint32_t max_queue_pairs)
@@ -54,3 +56,2 @@
-+		VHOST_CONFIG_LOG(path, DEBUG,
-+				"Keeping %u max queue pairs for Vhost-user backend",
-+				VHOST_MAX_QUEUE_PAIRS);
++		VHOST_LOG_CONFIG(path, DEBUG, "Keeping %u max queue pairs for Vhost-user backend\n",
++				 VHOST_MAX_QUEUE_PAIRS);


More information about the stable mailing list