Skip to content

Commit

Permalink
test/hash: fix bulk lookup check
Browse files Browse the repository at this point in the history
[ upstream commit 521171c ]

Check return value after bulk lookup.

Coverity issue: 357746
Fixes: 14b8ab5 ("hash: add bulk lookup with signatures array")

Signed-off-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
  • Loading branch information
vmedvedk authored and kevintraynor committed Nov 23, 2022
1 parent 1e81619 commit e2413f6
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion app/test/test_hash_perf.c
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,11 @@ timed_lookups_multi(unsigned int with_hash, unsigned int with_data,
(const void **)keys_burst,
&signatures[j * BURST_SIZE],
BURST_SIZE, positions_burst);
if (ret != 0) {
printf("rte_hash_lookup_with_hash_bulk failed with %d\n",
ret);
return -1;
}
for (k = 0; k < BURST_SIZE; k++) {
if (positions_burst[k] !=
positions[j *
Expand All @@ -492,10 +497,14 @@ timed_lookups_multi(unsigned int with_hash, unsigned int with_data,
}
}
} else {
rte_hash_lookup_bulk(h[table_index],
ret = rte_hash_lookup_bulk(h[table_index],
(const void **) keys_burst,
BURST_SIZE,
positions_burst);
if (ret != 0) {
printf("rte_hash_lookup_bulk failed with %d\n", ret);
return -1;
}
for (k = 0; k < BURST_SIZE; k++) {
if (positions_burst[k] != positions[j * BURST_SIZE + k]) {
printf("Key looked up in %d, should be in %d\n",
Expand Down

0 comments on commit e2413f6

Please sign in to comment.