patch 'examples/l3fwd: fix socket ID check' has been queued to stable release 23.11.4

Xueming Li xuemingl at nvidia.com
Tue Feb 18 13:35:20 CET 2025


Hi,

FYI, your patch has been queued to stable release 23.11.4

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
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=69dc0d8ed261b364449f78cb1ad2e727e0c3fc10

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From 69dc0d8ed261b364449f78cb1ad2e727e0c3fc10 Mon Sep 17 00:00:00 2001
From: Stephen Hemminger <stephen at networkplumber.org>
Date: Wed, 5 Feb 2025 08:23:19 -0800
Subject: [PATCH] examples/l3fwd: fix socket ID check
Cc: Xueming Li <xuemingl at nvidia.com>

[ upstream commit a7216f081767c7259dd3fba5eda0ca7b0bcb4595 ]

The expression:

  if ((socketid = rte_lcore_to_socket_id(lcore) != 0) &&

gets evaluated as socketid = (rte_lcore_to_socket_id(lcore) != 0)
which is not what was intended. This is goes all the way back
to first release.

Link: https://pvs-studio.com/en/blog/posts/cpp/1183/
Fixes: af75078fece3 ("first public release")

Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
---
 examples/l3fwd-power/main.c | 4 ++--
 examples/l3fwd/main.c       | 5 +++--
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/examples/l3fwd-power/main.c b/examples/l3fwd-power/main.c
index 7640b5a9a3..b11336e0b9 100644
--- a/examples/l3fwd-power/main.c
+++ b/examples/l3fwd-power/main.c
@@ -1411,8 +1411,8 @@ check_lcore_params(void)
 							"mask\n", lcore);
 			return -1;
 		}
-		if ((socketid = rte_lcore_to_socket_id(lcore) != 0) &&
-							(numa_on == 0)) {
+		socketid = rte_lcore_to_socket_id(lcore);
+		if (socketid != 0 && numa_on == 0) {
 			printf("warning: lcore %u is on socket %d with numa "
 						"off\n", lcore, socketid);
 		}
diff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c
index a239869ada..56d295d76f 100644
--- a/examples/l3fwd/main.c
+++ b/examples/l3fwd/main.c
@@ -307,8 +307,9 @@ check_lcore_params(void)
 			printf("error: lcore %u is not enabled in lcore mask\n", lcore);
 			return -1;
 		}
-		if ((socketid = rte_lcore_to_socket_id(lcore) != 0) &&
-			(numa_on == 0)) {
+
+		socketid = rte_lcore_to_socket_id(lcore);
+		if (socketid != 0 && numa_on == 0) {
 			printf("warning: lcore %u is on socket %d with numa off\n",
 				lcore, socketid);
 		}
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2025-02-18 19:39:03.643829128 +0800
+++ 0085-examples-l3fwd-fix-socket-ID-check.patch	2025-02-18 19:39:00.738244029 +0800
@@ -1 +1 @@
-From a7216f081767c7259dd3fba5eda0ca7b0bcb4595 Mon Sep 17 00:00:00 2001
+From 69dc0d8ed261b364449f78cb1ad2e727e0c3fc10 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit a7216f081767c7259dd3fba5eda0ca7b0bcb4595 ]
@@ -16 +18,0 @@
-Cc: stable at dpdk.org
@@ -25 +27 @@
-index d279e664b3..e27b8531b5 100644
+index 7640b5a9a3..b11336e0b9 100644
@@ -28 +30 @@
-@@ -1412,8 +1412,8 @@ check_lcore_params(void)
+@@ -1411,8 +1411,8 @@ check_lcore_params(void)
@@ -40 +42 @@
-index 994b7dd8e5..ae3b4f6439 100644
+index a239869ada..56d295d76f 100644
@@ -43 +45 @@
-@@ -311,8 +311,9 @@ check_lcore_params(void)
+@@ -307,8 +307,9 @@ check_lcore_params(void)


More information about the stable mailing list