From ff92d10af68e87561046ba1c0b41a44d6a1dea5c Mon Sep 17 00:00:00 2001 From: Vipin Varghese Date: Wed, 20 Mar 2024 07:10:53 +0530 Subject: [PATCH] app/dma-perf: clarify incorrect NUMA config In case incorrect NUMA configuration, the current commit shares 1) either `source or destination numa is greater` 2) instead of `actual NUMA` it is `acture NUMA` 3) uses `printf` instead of PRINT_ERR current patch changes the above to 1) identify if source or|and destination is incorrect 2) fix wording to incorrect 3) use PRINT_ERR macro Signed-off-by: Vipin Varghese --- app/test-dma-perf/benchmark.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/app/test-dma-perf/benchmark.c b/app/test-dma-perf/benchmark.c index 5eebb4de775..6d617ea200c 100644 --- a/app/test-dma-perf/benchmark.c +++ b/app/test-dma-perf/benchmark.c @@ -445,11 +445,16 @@ setup_memory_env(struct test_configure *cfg, unsigned int nr_sockets; uint32_t nr_buf = cfg->nr_buf; uint32_t i; + bool is_src_numa_incorrect, is_dst_numa_incorrect; nr_sockets = rte_socket_count(); - if (cfg->src_numa_node >= nr_sockets || - cfg->dst_numa_node >= nr_sockets) { - printf("Error: Source or destination numa exceeds the acture numa nodes.\n"); + is_src_numa_incorrect = (cfg->src_numa_node >= nr_sockets); + is_dst_numa_incorrect = (cfg->dst_numa_node >= nr_sockets); + + if (is_src_numa_incorrect || is_dst_numa_incorrect) { + PRINT_ERR("Error: Incorrect NUMA config for %s.\n", + (is_src_numa_incorrect && is_dst_numa_incorrect) ? "source & destination" : + (is_src_numa_incorrect) ? "source" : "destination"); return -1; }