patch 'test/hash: check memory allocation' has been queued to stable release 22.11.11

luca.boccassi at gmail.com luca.boccassi at gmail.com
Wed Nov 12 17:52:15 CET 2025


Hi,

FYI, your patch has been queued to stable release 22.11.11

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 11/14/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/382d9f327ed1d097b89e78b5b5e0cfa578fbbca9

Thanks.

Luca Boccassi

---
>From 382d9f327ed1d097b89e78b5b5e0cfa578fbbca9 Mon Sep 17 00:00:00 2001
From: Thomas Monjalon <thomas at monjalon.net>
Date: Thu, 30 Oct 2025 17:03:20 +0100
Subject: [PATCH] test/hash: check memory allocation

[ upstream commit 77e23b2d7ee45d153f588611a3fa479e4cf0c9b6 ]

When reserving a specific memory amount, it was possible to pass
the first allocations and fail on a later allocation
where there was no check, resulting in a crash.
It is fixed by stopping the test if allocation failed.

Fixes: fd368e1982bc ("test/hash: test more corner cases")
Fixes: 9c7d8eed1a45 ("test/hash: add RCU tests")

Signed-off-by: Thomas Monjalon <thomas at monjalon.net>
Reviewed-by: David Marchand <david.marchand at redhat.com>
---
 app/test/test_hash_readwrite.c         | 5 +++++
 app/test/test_hash_readwrite_lf_perf.c | 4 ++++
 2 files changed, 9 insertions(+)

diff --git a/app/test/test_hash_readwrite.c b/app/test/test_hash_readwrite.c
index 9cc5f3487c..f85d291569 100644
--- a/app/test/test_hash_readwrite.c
+++ b/app/test/test_hash_readwrite.c
@@ -64,6 +64,11 @@ test_hash_readwrite_worker(__rte_unused void *arg)
 
 	ret = rte_malloc(NULL, sizeof(int) *
 				tbl_rw_test_param.num_insert, 0);
+	if (ret == NULL) {
+		printf("allocation failed\n");
+		return -1;
+	}
+
 	for (i = 0; i < rte_lcore_count(); i++) {
 		if (worker_core_ids[i] == lcore_id)
 			break;
diff --git a/app/test/test_hash_readwrite_lf_perf.c b/app/test/test_hash_readwrite_lf_perf.c
index cf86046a2f..b06322ce35 100644
--- a/app/test/test_hash_readwrite_lf_perf.c
+++ b/app/test/test_hash_readwrite_lf_perf.c
@@ -1310,6 +1310,10 @@ test_hash_rcu_qsbr_writer_perf(struct rwc_perf *rwc_perf_results, int rwc_lf,
 
 	sz = rte_rcu_qsbr_get_memsize(RTE_MAX_LCORE);
 	rv = (struct rte_rcu_qsbr *)rte_zmalloc(NULL, sz, RTE_CACHE_LINE_SIZE);
+	if (rv == NULL) {
+		printf("allocation failed\n");
+		goto err;
+	}
 	rcu_config.v = rv;
 
 	if (rte_hash_rcu_qsbr_add(tbl_rwc_test_param.h, &rcu_config) < 0) {
-- 
2.47.3

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2025-11-12 16:20:41.054036146 +0000
+++ 0001-test-hash-check-memory-allocation.patch	2025-11-12 16:20:40.875715664 +0000
@@ -1 +1 @@
-From 77e23b2d7ee45d153f588611a3fa479e4cf0c9b6 Mon Sep 17 00:00:00 2001
+From 382d9f327ed1d097b89e78b5b5e0cfa578fbbca9 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 77e23b2d7ee45d153f588611a3fa479e4cf0c9b6 ]
+
@@ -13 +14,0 @@
-Cc: stable at dpdk.org
@@ -23 +24 @@
-index 82fe03cc5a..22ccd6df6a 100644
+index 9cc5f3487c..f85d291569 100644
@@ -26 +27 @@
-@@ -70,6 +70,11 @@ test_hash_readwrite_worker(__rte_unused void *arg)
+@@ -64,6 +64,11 @@ test_hash_readwrite_worker(__rte_unused void *arg)
@@ -39 +40 @@
-index 864c3059d9..bef987d29d 100644
+index cf86046a2f..b06322ce35 100644


More information about the stable mailing list