[PATCH v3 11/13] app/dma-perf: fix segment fault with large size

Chengwen Feng fengchengwen at huawei.com
Mon Oct 13 05:02:34 CEST 2025


When the buf-size is too large, the test will show:

  Case process killed by signal 11

The root cause is that rte_pktmbuf_pool_create() will truncate the
buf-size to uint16 type.

This commit add a friendly error trace when encounter such case.

Fixes: 623dc9364dc6 ("app/dma-perf: introduce DMA performance test")
Cc: stable at dpdk.org

Signed-off-by: Chengwen Feng <fengchengwen at huawei.com>
---
 app/test-dma-perf/benchmark.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/app/test-dma-perf/benchmark.c b/app/test-dma-perf/benchmark.c
index 1145493152..ab2bf0cbf5 100644
--- a/app/test-dma-perf/benchmark.c
+++ b/app/test-dma-perf/benchmark.c
@@ -457,6 +457,11 @@ setup_memory_env(struct test_configure *cfg, uint32_t nr_buf,
 		return -1;
 	}
 
+	if (buf_size > UINT16_MAX) {
+		PRINT_ERR("Error: Invalid buf size: %u\n", cur_buf_size);
+		return -1;
+	}
+
 	src_pool = rte_pktmbuf_pool_create("Benchmark_DMA_SRC",
 			nr_buf,
 			0,
-- 
2.17.1



More information about the dev mailing list