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

luca.boccassi at gmail.com luca.boccassi at gmail.com
Mon Feb 17 18:04:48 CET 2025


Hi,

FYI, your patch has been queued to stable release 22.11.8

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/19/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/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/883c3357a84ec219cedc9a6ca0e00847b13f20aa

Thanks.

Luca Boccassi

---
>From 883c3357a84ec219cedc9a6ca0e00847b13f20aa 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

[ 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 1bcc61e777..501e4c47d6 100644
--- a/examples/l3fwd-power/main.c
+++ b/examples/l3fwd-power/main.c
@@ -1537,8 +1537,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 9201019711..d0067657e9 100644
--- a/examples/l3fwd/main.c
+++ b/examples/l3fwd/main.c
@@ -303,8 +303,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.47.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2025-02-17 16:13:19.464653932 +0000
+++ 0075-examples-l3fwd-fix-socket-ID-check.patch	2025-02-17 16:13:16.870441592 +0000
@@ -1 +1 @@
-From a7216f081767c7259dd3fba5eda0ca7b0bcb4595 Mon Sep 17 00:00:00 2001
+From 883c3357a84ec219cedc9a6ca0e00847b13f20aa Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit a7216f081767c7259dd3fba5eda0ca7b0bcb4595 ]
+
@@ -16 +17,0 @@
-Cc: stable at dpdk.org
@@ -25 +26 @@
-index d279e664b3..e27b8531b5 100644
+index 1bcc61e777..501e4c47d6 100644
@@ -28 +29 @@
-@@ -1412,8 +1412,8 @@ check_lcore_params(void)
+@@ -1537,8 +1537,8 @@ check_lcore_params(void)
@@ -40 +41 @@
-index 994b7dd8e5..ae3b4f6439 100644
+index 9201019711..d0067657e9 100644
@@ -43 +44 @@
-@@ -311,8 +311,9 @@ check_lcore_params(void)
+@@ -303,8 +303,9 @@ check_lcore_params(void)


More information about the stable mailing list