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: [email protected]
Signed-off-by: Chengwen Feng <[email protected]>
---
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 694ad25cbe..6643ccc95f 100644
--- a/app/test-dma-perf/benchmark.c
+++ b/app/test-dma-perf/benchmark.c
@@ -525,6 +525,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