[v3] app/dma-perf: calrify incorrect NUMA config

Message ID 20240320014053.1040-1-vipin.varghese@amd.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series [v3] app/dma-perf: calrify incorrect NUMA config |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/intel-Functional success Functional PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-compile-amd64-testing success Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-abi-testing success Testing PASS
ci/github-robot: build success github build: passed
ci/iol-unit-arm64-testing success Testing PASS
ci/iol-unit-amd64-testing success Testing PASS
ci/iol-compile-arm64-testing success Testing PASS
ci/iol-sample-apps-testing success Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS

Commit Message

Varghese, Vipin March 20, 2024, 1:40 a.m. UTC
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 <vipin.varghese@amd.com>
---

V3 changes:
 - use snake-case instead of camel case for static scope functions.
 - convert console words to lower case.

V2 changes:
 - inform incorrect numa
 - fix spelling from acture to actual
 - use PRINT_ERR instead of printf
---
 app/test-dma-perf/benchmark.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)
  

Comments

Thomas Monjalon Nov. 19, 2024, 5:07 p.m. UTC | #1
20/03/2024 02:40, Vipin Varghese:
> 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

This is waiting for review.
  
Gowrishankar Muthukrishnan Nov. 19, 2024, 5:56 p.m. UTC | #2
> Subject: [EXTERNAL] [PATCH v3] app/dma-perf: calrify incorrect NUMA config

Looks good to me, with minor correction in subject:  calrify  -> clarify.

Thanks,
Gowrishankar
  
Thomas Monjalon Nov. 19, 2024, 10:37 p.m. UTC | #3
20/03/2024 02:40, Vipin Varghese:
> 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 <vipin.varghese@amd.com>

Applied, thanks.
  
Varghese, Vipin Nov. 20, 2024, 5:42 p.m. UTC | #4
> 
> 20/03/2024 02:40, Vipin Varghese:
> > 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 <vipin.varghese@amd.com>
> 
> Applied, thanks.

Thanks

> 
>
  

Patch

diff --git a/app/test-dma-perf/benchmark.c b/app/test-dma-perf/benchmark.c
index d167adc4d2..a437b715bd 100644
--- a/app/test-dma-perf/benchmark.c
+++ b/app/test-dma-perf/benchmark.c
@@ -442,11 +442,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;
 	}