DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH 2/2] test/hash: fix coverity warning
@ 2022-11-03 18:13 Vladimir Medvedkin
  2022-11-03 18:33 ` Stephen Hemminger
  2022-11-03 18:52 ` [PATCH v2] " Vladimir Medvedkin
  0 siblings, 2 replies; 4+ messages in thread
From: Vladimir Medvedkin @ 2022-11-03 18:13 UTC (permalink / raw)
  To: dev; +Cc: stable, Yipeng Wang, Sameh Gobriel, Bruce Richardson

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 2/2] test/hash: fix coverity warning
  2022-11-03 18:13 [PATCH 2/2] test/hash: fix coverity warning Vladimir Medvedkin
@ 2022-11-03 18:33 ` Stephen Hemminger
  2022-11-03 18:52   ` Medvedkin, Vladimir
  2022-11-03 18:52 ` [PATCH v2] " Vladimir Medvedkin
  1 sibling, 1 reply; 4+ messages in thread
From: Stephen Hemminger @ 2022-11-03 18:33 UTC (permalink / raw)
  To: Vladimir Medvedkin
  Cc: dev, stable, Yipeng Wang, Sameh Gobriel, Bruce Richardson

On Thu,  3 Nov 2022 18:13:38 +0000
Vladimir Medvedkin <vladimir.medvedkin@intel.com> wrote:

> +				if (ret != 0) {
> +					printf("rte_hash_lookup_with_hash_bulk"
> +						" failed with %d\n", ret);
> +					return -1;
> +				}

It makes it harder to search for error messages when they are split.
Ignore any checkpatch warnings about this.

Also, shouldn't test failures be printed on stderr rather than stdout?

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 2/2] test/hash: fix coverity warning
  2022-11-03 18:33 ` Stephen Hemminger
@ 2022-11-03 18:52   ` Medvedkin, Vladimir
  0 siblings, 0 replies; 4+ messages in thread
From: Medvedkin, Vladimir @ 2022-11-03 18:52 UTC (permalink / raw)
  To: Stephen Hemminger
  Cc: dev, stable, Yipeng Wang, Sameh Gobriel, Bruce Richardson

Hi Stephen,

On 03/11/2022 18:33, Stephen Hemminger wrote:
> On Thu,  3 Nov 2022 18:13:38 +0000
> Vladimir Medvedkin <vladimir.medvedkin@intel.com> wrote:
>
>> +				if (ret != 0) {
>> +					printf("rte_hash_lookup_with_hash_bulk"
>> +						" failed with %d\n", ret);
>> +					return -1;
>> +				}
> It makes it harder to search for error messages when they are split.
> Ignore any checkpatch warnings about this.

Will fix, thanks!

>
> Also, shouldn't test failures be printed on stderr rather than stdout?

It seems that most of the tests print on stdout.

-- 
Regards,
Vladimir


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v2] test/hash: fix coverity warning
  2022-11-03 18:13 [PATCH 2/2] test/hash: fix coverity warning Vladimir Medvedkin
  2022-11-03 18:33 ` Stephen Hemminger
@ 2022-11-03 18:52 ` Vladimir Medvedkin
  1 sibling, 0 replies; 4+ messages in thread
From: Vladimir Medvedkin @ 2022-11-03 18:52 UTC (permalink / raw)
  To: dev; +Cc: stephen, stable, Yipeng Wang, Sameh Gobriel, Bruce Richardson

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 | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/app/test/test_hash_perf.c b/app/test/test_hash_perf.c
index 5d36c0f454..1a90acd1ba 100644
--- a/app/test/test_hash_perf.c
+++ b/app/test/test_hash_perf.c
@@ -475,6 +475,10 @@ 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 +491,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",
-- 
2.25.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-11-03 18:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-03 18:13 [PATCH 2/2] test/hash: fix coverity warning Vladimir Medvedkin
2022-11-03 18:33 ` Stephen Hemminger
2022-11-03 18:52   ` Medvedkin, Vladimir
2022-11-03 18:52 ` [PATCH v2] " Vladimir Medvedkin

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).