patch 'vhost: fix log when setting max queue num' has been queued to stable release 24.11.2

Kevin Traynor ktraynor at redhat.com
Thu Feb 13 10:57:32 CET 2025


Hi,

FYI, your patch has been queued to stable release 24.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 02/17/25. 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://github.com/kevintraynor/dpdk-stable

This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable/commit/821f370cbf4f3031197c8980dec2827fe03b811b

Thanks.

Kevin

---
>From 821f370cbf4f3031197c8980dec2827fe03b811b Mon Sep 17 00:00:00 2001
From: Maxime Coquelin <maxime.coquelin at redhat.com>
Date: Thu, 9 Jan 2025 15:31:30 +0100
Subject: [PATCH] vhost: fix log when setting max queue num

[ upstream commit 274292190d1384b028552adc601dda4b197f2417 ]

rte_vhost_driver_set_max_queue_num API returns early when
called for a Vhost-user device, as this API is intended to
limit the maximum number of queue pairs supported by VDUSE
devices. However, a log mentioning the maximum number of
queue pairs is being set is emitted unconditionally, which
may confuse the end user.

This patch moves this log after the backend type is
checked, so that it is only called with VDUSE backends.
The check on the requested value is also moved at the same
place.

Fixes: e1808999d36b ("vhost: restrict set max queue pair API to VDUSE")

Signed-off-by: Maxime Coquelin <maxime.coquelin at redhat.com>
Reviewed-by: Ilya Maximets <i.maximets at ovn.org>
Reviewed-by: Chenbo Xia <chenbox at nvidia.com>
Acked-by: Kevin Traynor <ktraynor at redhat.com>
---
 lib/vhost/socket.c | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/lib/vhost/socket.c b/lib/vhost/socket.c
index d29d15494c..05a7e5902f 100644
--- a/lib/vhost/socket.c
+++ b/lib/vhost/socket.c
@@ -845,12 +845,4 @@ rte_vhost_driver_set_max_queue_num(const char *path, uint32_t max_queue_pairs)
 	int ret = 0;
 
-	VHOST_CONFIG_LOG(path, INFO, "Setting max queue pairs to %u", max_queue_pairs);
-
-	if (max_queue_pairs > VHOST_MAX_QUEUE_PAIRS) {
-		VHOST_CONFIG_LOG(path, ERR, "Library only supports up to %u queue pairs",
-				VHOST_MAX_QUEUE_PAIRS);
-		return -1;
-	}
-
 	pthread_mutex_lock(&vhost_user.mutex);
 	vsocket = find_vhost_user_socket(path);
@@ -873,4 +865,13 @@ rte_vhost_driver_set_max_queue_num(const char *path, uint32_t max_queue_pairs)
 	}
 
+	VHOST_CONFIG_LOG(path, INFO, "Setting max queue pairs to %u", max_queue_pairs);
+
+	if (max_queue_pairs > VHOST_MAX_QUEUE_PAIRS) {
+		VHOST_CONFIG_LOG(path, ERR, "Library only supports up to %u queue pairs",
+				VHOST_MAX_QUEUE_PAIRS);
+		ret = -1;
+		goto unlock_exit;
+	}
+
 	vsocket->max_queue_pairs = max_queue_pairs;
 
-- 
2.48.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2025-02-12 17:29:35.181348861 +0000
+++ 0005-vhost-fix-log-when-setting-max-queue-num.patch	2025-02-12 17:29:34.125944587 +0000
@@ -1 +1 @@
-From 274292190d1384b028552adc601dda4b197f2417 Mon Sep 17 00:00:00 2001
+From 821f370cbf4f3031197c8980dec2827fe03b811b Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 274292190d1384b028552adc601dda4b197f2417 ]
+
@@ -19 +20,0 @@
-Cc: stable at dpdk.org



More information about the stable mailing list