app/dma-perf: calrify incorrect NUMA config

Message ID 20240306150204.1375-1-vipin.varghese@amd.com (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers
Series 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/github-robot: build success github build: passed
ci/intel-Functional success Functional PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-compile-amd64-testing success Testing PASS
ci/iol-unit-amd64-testing success Testing PASS
ci/iol-unit-arm64-testing success Testing PASS
ci/iol-compile-arm64-testing success Testing PASS
ci/iol-sample-apps-testing success Testing PASS

Commit Message

Vipin Varghese March 6, 2024, 3:02 p.m. UTC
  Current commit decalres either `source or destination numa is greater
than acture numa` as cause of error. Rephrase as `Source or Destination`
is incorrect numa by checking which is greater than available numa.

Signed-off-by: Vipin Varghese <vipin.varghese@amd.com>
---
 app/test-dma-perf/benchmark.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
  

Comments

fengchengwen March 7, 2024, 1:19 p.m. UTC | #1
Unaddressed
Hi Vipin,

On 2024/3/6 23:02, Vipin Varghese wrote:
> Current commit decalres either `source or destination numa is greater
> than acture numa` as cause of error. Rephrase as `Source or Destination`
> is incorrect numa by checking which is greater than available numa.
> 
> Signed-off-by: Vipin Varghese <vipin.varghese@amd.com>
> ---
>  app/test-dma-perf/benchmark.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/app/test-dma-perf/benchmark.c b/app/test-dma-perf/benchmark.c
> index 9b1f58c78c..5634ff8bf8 100644
> --- a/app/test-dma-perf/benchmark.c
> +++ b/app/test-dma-perf/benchmark.c
> @@ -313,7 +313,8 @@ setup_memory_env(struct test_configure *cfg, struct rte_mbuf ***srcs,
>  	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");
> +		printf("Error: %s numa exceeds the available numa nodes.\n",
> +				(cfg->src_numa_node >= nr_sockets) ? "Source" : "Destination");

There are three cases to invoking:
1) src_numa_node >= nr_sockets
2) dst_numa_node >= nr_sockets
3) both src_numa_node and dst_numa_node >= nr_sockets

It could cover cases 1&2 in your commit, but could not cover case 3.

So I think we should keep original implement.

Thanks

>  		return -1;
>  	}
>  
>
  
Vipin Varghese March 7, 2024, 4:06 p.m. UTC | #2
Unaddressed
<snipped>

>> -             printf("Error: Source or destination numa exceeds the acture numa nodes.\n");
>> +             printf("Error: %s numa exceeds the available numa nodes.\n",
>> +                             (cfg->src_numa_node >= nr_sockets) ? "Source" : "Destination");

Thank you for comments, please find my reasoning as `change is added to 
address spelling issue of acture numa to available numa`

> There are three cases to invoking:
> 1) src_numa_node >= nr_sockets
> 2) dst_numa_node >= nr_sockets
> 3) both src_numa_node and dst_numa_node >= nr_sockets

As per my testing, following scenarios are explored

1) if src-numa is incorrect, we get error message as `source is 
incorrect numa`

2) if dst-numa is incorrect, we get error message as `destination is 
incorrect numa`

3) if both src-numa and dst-numa are incorrect, we get error as `source 
is incorrect numa`, fixing source and rerunning `destination is 
incorrect numa` (which is expected)

>
> It could cover cases 1&2 in your commit, but could not cover case 3.
I am happy to make changes to reflect the third scenario also. But 
please note as shared, the real intention is to fix ` acture numa` to 
something meaningful.
> So I think we should keep original implement.

I humbly disagree, based on the explanation as shared above. I can share 
v2 patch to address

1. acture numa

2. soruce or destination or src & destination


<snipped>
  

Patch

diff --git a/app/test-dma-perf/benchmark.c b/app/test-dma-perf/benchmark.c
index 9b1f58c78c..5634ff8bf8 100644
--- a/app/test-dma-perf/benchmark.c
+++ b/app/test-dma-perf/benchmark.c
@@ -313,7 +313,8 @@  setup_memory_env(struct test_configure *cfg, struct rte_mbuf ***srcs,
 	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");
+		printf("Error: %s numa exceeds the available numa nodes.\n",
+				(cfg->src_numa_node >= nr_sockets) ? "Source" : "Destination");
 		return -1;
 	}