patch 'test/hash: fix jhash 32-bit key type' has been queued to stable release 24.11.9
luca.boccassi at gmail.com
luca.boccassi at gmail.com
Tue Oct 27 12:50:07 CET 2026
Hi,
FYI, your patch has been queued to stable release 24.11.9
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 10/29/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/b9202f89706711d2b858d7b6fe10d50f59e46f3c
Thanks.
Luca Boccassi
---
>From b9202f89706711d2b858d7b6fe10d50f59e46f3c Mon Sep 17 00:00:00 2001
From: Stephen Hemminger <stephen at networkplumber.org>
Date: Mon, 7 Sep 2026 11:31:20 -0700
Subject: [PATCH] test/hash: fix jhash 32-bit key type
[ upstream commit 87f8c97e179431fd152f16e348b3a95693875517 ]
verify_jhash_32bits() declares the key as an array of bytes, then
casts it to unaligned_uint32_t * to pass to rte_jhash_32b(), which
takes a const uint32_t *. Clang reports:
passing 1-byte aligned argument to 4-byte aligned parameter 1 of
'rte_jhash_32b' may result in an unaligned pointer access
[-Walign-mismatch]
This already happens on armv8 aarch32, where unaligned types have
alignment 1, and will happen everywhere once that is true on all
architectures.
Declare the key as an array of uint32_t and drop the cast.
Fixes: 7621d6a8d0bd ("eal: add and use unaligned integer types")
Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
---
app/test/test_hash_functions.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/app/test/test_hash_functions.c b/app/test/test_hash_functions.c
index 70820d1f197..fdff304d2b8 100644
--- a/app/test/test_hash_functions.c
+++ b/app/test/test_hash_functions.c
@@ -185,12 +185,12 @@ verify_precalculated_hash_func_tests(void)
static int
verify_jhash_32bits(void)
{
- unsigned i, j;
- uint8_t key[64];
+ unsigned int i, j;
+ uint32_t key[16];
uint32_t hash, hash32;
- for (i = 0; i < 64; i++)
- key[i] = rand() & 0xff;
+ for (i = 0; i < RTE_DIM(key); i++)
+ key[i] = (uint32_t) rte_rand();
for (i = 0; i < RTE_DIM(hashtest_key_lens); i++) {
for (j = 0; j < RTE_DIM(hashtest_initvals); j++) {
@@ -199,9 +199,9 @@ verify_jhash_32bits(void)
hash = rte_jhash(key, hashtest_key_lens[i],
hashtest_initvals[j]);
/* Divide key length by 4 in rte_jhash for 32 bits */
- hash32 = rte_jhash_32b((const unaligned_uint32_t *)key,
- hashtest_key_lens[i] >> 2,
- hashtest_initvals[j]);
+ hash32 = rte_jhash_32b(key,
+ hashtest_key_lens[i] / sizeof(uint32_t),
+ hashtest_initvals[j]);
if (hash != hash32) {
printf("rte_jhash returns different value (0x%x)"
"than rte_jhash_32b (0x%x)\n",
--
2.47.3
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2026-10-27 11:43:58.107918291 +0000
+++ 0113-test-hash-fix-jhash-32-bit-key-type.patch 2026-10-27 11:43:53.646063535 +0000
@@ -1 +1 @@
-From 87f8c97e179431fd152f16e348b3a95693875517 Mon Sep 17 00:00:00 2001
+From b9202f89706711d2b858d7b6fe10d50f59e46f3c Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 87f8c97e179431fd152f16e348b3a95693875517 ]
+
@@ -21 +22,0 @@
-Cc: stable at dpdk.org
@@ -29 +30 @@
-index 70820d1f19..fdff304d2b 100644
+index 70820d1f197..fdff304d2b8 100644
More information about the stable
mailing list