[PATCH 1/7] app/test: fix unused but set variables

Medvedkin, Vladimir vladimir.medvedkin at intel.com
Fri Nov 12 15:29:54 CET 2021



On 12/11/2021 15:01, Conor Walsh wrote:
> This patch fixes unused but set variables within the following test apps:
>   - test distributor perf
>   - test thash perf
> 
> Bugzilla ID: 881
> 
> Fixes: c0de0eb82e40 ("distributor: switch over to new API")
> Fixes: 239fffe0402e ("test/thash: add performance tests for Toeplitz hash")
> 
> Signed-off-by: Conor Walsh <conor.walsh at intel.com>
> Reported-by: Liang Longfeng <longfengx.liang at intel.com>
> ---
>   app/test/test_distributor_perf.c | 3 ---
>   app/test/test_thash_perf.c       | 2 ++
>   2 files changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/app/test/test_distributor_perf.c b/app/test/test_distributor_perf.c
> index fdbeae6d2f..92e330f194 100644
> --- a/app/test/test_distributor_perf.c
> +++ b/app/test/test_distributor_perf.c
> @@ -108,7 +108,6 @@ static int
>   handle_work(void *arg)
>   {
>   	struct rte_distributor *d = arg;
> -	unsigned int count = 0;
>   	unsigned int num = 0;
>   	int i;
>   	unsigned int id = __atomic_fetch_add(&worker_idx, 1, __ATOMIC_RELAXED);
> @@ -120,11 +119,9 @@ handle_work(void *arg)
>   	num = rte_distributor_get_pkt(d, id, buf, buf, num);
>   	while (!quit) {
>   		worker_stats[id].handled_packets += num;
> -		count += num;
>   		num = rte_distributor_get_pkt(d, id, buf, buf, num);
>   	}
>   	worker_stats[id].handled_packets += num;
> -	count += num;
>   	rte_distributor_return_pkt(d, id, buf, num);
>   	return 0;
>   }
> diff --git a/app/test/test_thash_perf.c b/app/test/test_thash_perf.c
> index 7aa9360120..c95785d8bb 100644
> --- a/app/test/test_thash_perf.c
> +++ b/app/test/test_thash_perf.c
> @@ -61,6 +61,8 @@ run_rss_calc(uint32_t *tuples[BATCH_SZ], enum test_rss_type type, int len,
>   	}
>   	end_tsc = rte_rdtsc_precise();
>   
> +	RTE_SET_USED(hash);
> +
>   	return end_tsc - start_tsc;
>   }
>   
> 

Acked-by: Vladimir Medvedkin <vladimir.medvedkin at intel.com>

-- 
Regards,
Vladimir


More information about the dev mailing list