From: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
To: dev@dpdk.org
Cc: stable@dpdk.org, Yipeng Wang <yipeng1.wang@intel.com>,
Sameh Gobriel <sameh.gobriel@intel.com>,
Bruce Richardson <bruce.richardson@intel.com>
Subject: [PATCH 2/2] test/hash: fix coverity warning
Date: Thu, 3 Nov 2022 18:13:38 +0000 [thread overview]
Message-ID: <20221103181339.1135127-1-vladimir.medvedkin@intel.com> (raw)
Check return value after bulk lookup
Coverity issue: 357746
Fixes: 14b8ab576235 ("hash: add bulk lookup with signatures array")
Cc: stable@dpdk.org
Signed-off-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
---
app/test/test_hash_perf.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/app/test/test_hash_perf.c b/app/test/test_hash_perf.c
index 5d36c0f454..a9655e69f7 100644
--- a/app/test/test_hash_perf.c
+++ b/app/test/test_hash_perf.c
@@ -475,6 +475,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 *
@@ -487,10 +492,15 @@ 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",
--
2.25.1
next reply other threads:[~2022-11-03 18:14 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-03 18:13 Vladimir Medvedkin [this message]
2022-11-03 18:33 ` Stephen Hemminger
2022-11-03 18:52 ` Medvedkin, Vladimir
2022-11-03 18:52 ` [PATCH v2] " Vladimir Medvedkin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221103181339.1135127-1-vladimir.medvedkin@intel.com \
--to=vladimir.medvedkin@intel.com \
--cc=bruce.richardson@intel.com \
--cc=dev@dpdk.org \
--cc=sameh.gobriel@intel.com \
--cc=stable@dpdk.org \
--cc=yipeng1.wang@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).