From 6dfcdf8fd54ae2b94a2897e3744f7dd80fbcae2f Mon Sep 17 00:00:00 2001 From: Conor Walsh Date: Mon, 15 Nov 2021 17:58:50 +0000 Subject: [PATCH] test/thash: fix build with clang 13 run_rss_calc() is used to compare the number of cycles spent computing a hash value for different implementations. clang 13 reports the hash variable as being unused, but run_rss_calc() needs this variable as a placeholder for computing the hash value. Bugzilla ID: 881 Fixes: 239fffe0402e ("test/thash: add performance tests for Toeplitz hash") Reported-by: Liang Longfeng Signed-off-by: Conor Walsh Acked-by: Vladimir Medvedkin Reviewed-by: David Marchand --- app/test/test_thash_perf.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/test/test_thash_perf.c b/app/test/test_thash_perf.c index 7aa9360120..687582aa32 100644 --- a/app/test/test_thash_perf.c +++ b/app/test/test_thash_perf.c @@ -61,6 +61,9 @@ run_rss_calc(uint32_t *tuples[BATCH_SZ], enum test_rss_type type, int len, } end_tsc = rte_rdtsc_precise(); + /* To avoid compiler warnings set hash to used. */ + RTE_SET_USED(hash); + return end_tsc - start_tsc; } -- 2.39.5