patch 'bitops: fix build with GCC 17' has been queued to stable release 24.11.7
luca.boccassi at gmail.com
luca.boccassi at gmail.com
Thu Jun 11 15:19:43 CEST 2026
Hi,
FYI, your patch has been queued to stable release 24.11.7
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 06/13/26. 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/48ff843561d5379cf582a2b887f72a154f69d9f5
Thanks.
Luca Boccassi
---
>From 48ff843561d5379cf582a2b887f72a154f69d9f5 Mon Sep 17 00:00:00 2001
From: Stephen Hemminger <stephen at networkplumber.org>
Date: Tue, 19 May 2026 06:49:01 -0700
Subject: [PATCH] bitops: fix build with GCC 17
[ upstream commit 254ee546271c8cfc8a764ee3209c44e58875234c ]
Newer GCC warns when a non-boolean constant is an operand of &&
(-Wconstant-logical-operand), which trips whenever RTE_IS_POWER_OF_2
is used in a static_assert with a power-of-two literal.
Make the zero check explicit.
Fixes: 7c872b96983a ("hash: validate hash bucket entries while compiling")
Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
Acked-by: Bruce Richardson <bruce.richardson at intel.com>
Acked-by: Jack Bond-Preston <jack.bond-preston at foss.arm.com>
---
lib/eal/include/rte_bitops.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/eal/include/rte_bitops.h b/lib/eal/include/rte_bitops.h
index a789412233..09c4aba794 100644
--- a/lib/eal/include/rte_bitops.h
+++ b/lib/eal/include/rte_bitops.h
@@ -1213,7 +1213,7 @@ rte_fls_u64(uint64_t x)
/**
* Macro to return 1 if n is a power of 2, 0 otherwise
*/
-#define RTE_IS_POWER_OF_2(n) ((n) && !(((n) - 1) & (n)))
+#define RTE_IS_POWER_OF_2(n) ((n) != 0 && (((n) - 1) & (n)) == 0)
/**
* Returns true if n is a power of 2
--
2.47.3
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2026-06-11 14:20:02.694579642 +0100
+++ 0034-bitops-fix-build-with-GCC-17.patch 2026-06-11 14:20:01.202745690 +0100
@@ -1 +1 @@
-From 254ee546271c8cfc8a764ee3209c44e58875234c Mon Sep 17 00:00:00 2001
+From 48ff843561d5379cf582a2b887f72a154f69d9f5 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 254ee546271c8cfc8a764ee3209c44e58875234c ]
+
@@ -12 +13,0 @@
-Cc: stable at dpdk.org
@@ -22 +23 @@
-index aa6ac73abb..b170447714 100644
+index a789412233..09c4aba794 100644
@@ -25 +26 @@
-@@ -1299,7 +1299,7 @@ rte_fls_u64(uint64_t x)
+@@ -1213,7 +1213,7 @@ rte_fls_u64(uint64_t x)
More information about the stable
mailing list