[2/2] app/dma-perf: fix infinite loop

Message ID 20250321040316.104126-3-huangdengdui@huawei.com (mailing list archive)
State Changes Requested
Delegated to: Thomas Monjalon
Headers
Series fix the problem of dma-perf infinite loop |

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/github-robot: build success github build: passed
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/intel-Functional success Functional PASS
ci/iol-marvell-Functional success Functional Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-unit-amd64-testing success Testing PASS
ci/iol-abi-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
ci/iol-compile-amd64-testing success Testing PASS
ci/iol-mellanox-Functional success Functional Testing PASS

Commit Message

Dengdui Huang March 21, 2025, 4:03 a.m. UTC
When a core that is not used by the rte is specified in the config
for testing, the problem of infinite loop occurs. The root cause
is that the program waits for the completion of the test task when
the test worker fails to be started on the lcore. This patch fix it.

Fixes: 533d7e7f66f3 ("app/dma-perf: support config per device")
Cc: stable@dpdk.org

Signed-off-by: Dengdui Huang <huangdengdui@huawei.com>
---
 app/test-dma-perf/benchmark.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
  

Comments

Stephen Hemminger March 21, 2025, 3:58 p.m. UTC | #1
On Fri, 21 Mar 2025 12:03:16 +0800
Dengdui Huang <huangdengdui@huawei.com> wrote:

> When a core that is not used by the rte is specified in the config
> for testing, the problem of infinite loop occurs. The root cause
> is that the program waits for the completion of the test task when
> the test worker fails to be started on the lcore. This patch fix it.
> 
> Fixes: 533d7e7f66f3 ("app/dma-perf: support config per device")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Dengdui Huang <huangdengdui@huawei.com>
> ---
>  app/test-dma-perf/benchmark.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/app/test-dma-perf/benchmark.c b/app/test-dma-perf/benchmark.c
> index 6d617ea200..351c1c966e 100644
> --- a/app/test-dma-perf/benchmark.c
> +++ b/app/test-dma-perf/benchmark.c
> @@ -751,7 +751,10 @@ mem_copy_benchmark(struct test_configure *cfg)
>  				goto out;
>  		}
>  
> -		rte_eal_remote_launch(get_work_function(cfg), (void *)(lcores[i]), lcore_id);
> +		if (rte_eal_remote_launch(get_work_function(cfg), (void *)(lcores[i]), lcore_id)) {
> +			printf("Error: Fail to start the test on lcore %d\n", lcore_id);

Convention is to log errors on stderr and lcore_id is unsigned not signed value.
  
Dengdui Huang March 24, 2025, 3:42 a.m. UTC | #2
On 2025/3/21 23:58, Stephen Hemminger wrote:
> On Fri, 21 Mar 2025 12:03:16 +0800
> Dengdui Huang <huangdengdui@huawei.com> wrote:
> 
>> When a core that is not used by the rte is specified in the config
>> for testing, the problem of infinite loop occurs. The root cause
>> is that the program waits for the completion of the test task when
>> the test worker fails to be started on the lcore. This patch fix it.
>>
>> Fixes: 533d7e7f66f3 ("app/dma-perf: support config per device")
>> Cc: stable@dpdk.org
>>
>> Signed-off-by: Dengdui Huang <huangdengdui@huawei.com>
>> ---
>>  app/test-dma-perf/benchmark.c | 5 ++++-
>>  1 file changed, 4 insertions(+), 1 deletion(-)
>>
>> diff --git a/app/test-dma-perf/benchmark.c b/app/test-dma-perf/benchmark.c
>> index 6d617ea200..351c1c966e 100644
>> --- a/app/test-dma-perf/benchmark.c
>> +++ b/app/test-dma-perf/benchmark.c
>> @@ -751,7 +751,10 @@ mem_copy_benchmark(struct test_configure *cfg)
>>  				goto out;
>>  		}
>>  
>> -		rte_eal_remote_launch(get_work_function(cfg), (void *)(lcores[i]), lcore_id);
>> +		if (rte_eal_remote_launch(get_work_function(cfg), (void *)(lcores[i]), lcore_id)) {
>> +			printf("Error: Fail to start the test on lcore %d\n", lcore_id);
> 
> Convention is to log errors on stderr and lcore_id is unsigned not signed value.

OK, I'll fix it for the next version.
  

Patch

diff --git a/app/test-dma-perf/benchmark.c b/app/test-dma-perf/benchmark.c
index 6d617ea200..351c1c966e 100644
--- a/app/test-dma-perf/benchmark.c
+++ b/app/test-dma-perf/benchmark.c
@@ -751,7 +751,10 @@  mem_copy_benchmark(struct test_configure *cfg)
 				goto out;
 		}
 
-		rte_eal_remote_launch(get_work_function(cfg), (void *)(lcores[i]), lcore_id);
+		if (rte_eal_remote_launch(get_work_function(cfg), (void *)(lcores[i]), lcore_id)) {
+			printf("Error: Fail to start the test on lcore %d\n", lcore_id);
+			goto out;
+		}
 	}
 
 	while (1) {