[PATCH v3 10/10] app/test-dma-perf: fix parsing of DMA address

fengchengwen fengchengwen at huawei.com
Mon Nov 18 03:44:43 CET 2024


On 2024/11/16 4:06, Stephen Hemminger wrote:
> There was useless loop when looking at the DMA address.
> It looks like it was meant to skip whitespace before
> calling strtok.
> 
> Good time to replace strtok with strtok_r as well.

Please delete this line, with this fixed:
Acked-by: Chengwen Feng <fengchengwen at huawei.com>

> 
> Link: https://pvs-studio.com/en/blog/posts/cpp/1179/
> 
> Fixes: 623dc9364dc6 ("app/dma-perf: introduce DMA performance test")
> Cc: cheng1.jiang at intel.com
> Cc: stable at dpdk.org
> 
> Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
> Acked-by: Bruce Richardson <bruce.richardson at intel.com>
> ---
>  app/test-dma-perf/main.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/app/test-dma-perf/main.c b/app/test-dma-perf/main.c
> index 18219918cc..8d46b1258b 100644
> --- a/app/test-dma-perf/main.c
> +++ b/app/test-dma-perf/main.c
> @@ -229,8 +229,8 @@ parse_lcore_dma(struct test_configure *test_case, const char *value)
>  		return -1;
>  	addrs = input;
>  
> -	while (*addrs == '\0')
> -		addrs++;
> +	while (isspace(*addrs))
> +		++addrs;
>  	if (*addrs == '\0') {
>  		fprintf(stderr, "No input DMA addresses\n");
>  		ret = -1;



More information about the stable mailing list