DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] app/testbbdev: fix unchecked return value
@ 2018-05-16 13:57 Kamil Chalupnik
  2018-05-17 12:40 ` Mokhtar, Amr
  0 siblings, 1 reply; 5+ messages in thread
From: Kamil Chalupnik @ 2018-05-16 13:57 UTC (permalink / raw)
  To: amr.mokhtar, pablo.de.lara.guarch; +Cc: dev, Kamil Chalupnik

Fixing CHECKED_RETURN issue by checking values returned
by rte_bbdev_dec_op_alloc_bulk and rte_bbdev_enc_op_alloc_bulk
functions.

Fixes: f714a18885a6 ("app/testbbdev: add test application for bbdev")
Coverity issue: 279447, 279456

Signed-off-by: Kamil Chalupnik <kamilx.chalupnik@intel.com>
---
 app/test-bbdev/test_bbdev_perf.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test-bbdev/test_bbdev_perf.c
index ca162d9..6861edc 100644
--- a/app/test-bbdev/test_bbdev_perf.c
+++ b/app/test-bbdev/test_bbdev_perf.c
@@ -1731,7 +1731,9 @@ latency_test_dec(struct rte_mempool *mempool,
 		if (unlikely(num_to_process - dequeued < burst_sz))
 			burst_sz = num_to_process - dequeued;
 
-		rte_bbdev_dec_op_alloc_bulk(mempool, ops_enq, burst_sz);
+		ret = rte_bbdev_dec_op_alloc_bulk(mempool, ops_enq, burst_sz);
+		TEST_ASSERT_SUCCESS(ret,
+				"rte_bbdev_dec_op_alloc_bulk() failed");
 		if (test_vector.op_type != RTE_BBDEV_OP_NONE)
 			copy_reference_dec_op(ops_enq, burst_sz, dequeued,
 					bufs->inputs,
@@ -1798,7 +1800,9 @@ latency_test_enc(struct rte_mempool *mempool,
 		if (unlikely(num_to_process - dequeued < burst_sz))
 			burst_sz = num_to_process - dequeued;
 
-		rte_bbdev_enc_op_alloc_bulk(mempool, ops_enq, burst_sz);
+		ret = rte_bbdev_enc_op_alloc_bulk(mempool, ops_enq, burst_sz);
+		TEST_ASSERT_SUCCESS(ret,
+				"rte_bbdev_enc_op_alloc_bulk() failed");
 		if (test_vector.op_type != RTE_BBDEV_OP_NONE)
 			copy_reference_enc_op(ops_enq, burst_sz, dequeued,
 					bufs->inputs,
-- 
2.5.5

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

* Re: [dpdk-dev] [PATCH] app/testbbdev: fix unchecked return value
  2018-05-16 13:57 [dpdk-dev] [PATCH] app/testbbdev: fix unchecked return value Kamil Chalupnik
@ 2018-05-17 12:40 ` Mokhtar, Amr
  2018-05-17 16:15   ` De Lara Guarch, Pablo
  0 siblings, 1 reply; 5+ messages in thread
From: Mokhtar, Amr @ 2018-05-17 12:40 UTC (permalink / raw)
  To: Chalupnik, KamilX, De Lara Guarch, Pablo; +Cc: dev


> -----Original Message-----
> From: Chalupnik, KamilX
> Sent: Wednesday 16 May 2018 14:57
> To: Mokhtar, Amr <amr.mokhtar@intel.com>; De Lara Guarch, Pablo
> <pablo.de.lara.guarch@intel.com>
> Cc: dev@dpdk.org; Chalupnik, KamilX <kamilx.chalupnik@intel.com>
> Subject: [PATCH] app/testbbdev: fix unchecked return value
> 
> Fixing CHECKED_RETURN issue by checking values returned
> by rte_bbdev_dec_op_alloc_bulk and rte_bbdev_enc_op_alloc_bulk
> functions.
> 
> Fixes: f714a18885a6 ("app/testbbdev: add test application for bbdev")
> Coverity issue: 279447, 279456
> 
> Signed-off-by: Kamil Chalupnik <kamilx.chalupnik@intel.com>

Acked-by: Amr Mokhtar <amr.mokhtar@intel.com>

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

* Re: [dpdk-dev] [PATCH] app/testbbdev: fix unchecked return value
  2018-05-17 12:40 ` Mokhtar, Amr
@ 2018-05-17 16:15   ` De Lara Guarch, Pablo
  0 siblings, 0 replies; 5+ messages in thread
From: De Lara Guarch, Pablo @ 2018-05-17 16:15 UTC (permalink / raw)
  To: Mokhtar, Amr, Chalupnik, KamilX; +Cc: dev, stable



> -----Original Message-----
> From: Mokhtar, Amr
> Sent: Thursday, May 17, 2018 1:41 PM
> To: Chalupnik, KamilX <kamilx.chalupnik@intel.com>; De Lara Guarch, Pablo
> <pablo.de.lara.guarch@intel.com>
> Cc: dev@dpdk.org
> Subject: RE: [PATCH] app/testbbdev: fix unchecked return value
> 
> 
> > -----Original Message-----
> > From: Chalupnik, KamilX
> > Sent: Wednesday 16 May 2018 14:57
> > To: Mokhtar, Amr <amr.mokhtar@intel.com>; De Lara Guarch, Pablo
> > <pablo.de.lara.guarch@intel.com>
> > Cc: dev@dpdk.org; Chalupnik, KamilX <kamilx.chalupnik@intel.com>
> > Subject: [PATCH] app/testbbdev: fix unchecked return value
> >
> > Fixing CHECKED_RETURN issue by checking values returned by
> > rte_bbdev_dec_op_alloc_bulk and rte_bbdev_enc_op_alloc_bulk functions.
> >
> > Fixes: f714a18885a6 ("app/testbbdev: add test application for bbdev")
> > Coverity issue: 279447, 279456

Added Cc: stable@dpdk.org

> >
> > Signed-off-by: Kamil Chalupnik <kamilx.chalupnik@intel.com>
> 
> Acked-by: Amr Mokhtar <amr.mokhtar@intel.com>

Applied to dpdk-next-crypto.

By the way, could you change your author name to Kamil Chalupnik,
to match your "Signed-off-by:" line.

Thanks,
Pablo

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

* Re: [dpdk-dev] [PATCH] app/testbbdev: fix unchecked return value
  2018-01-31 13:54 Amr Mokhtar
@ 2018-01-31 15:25 ` Thomas Monjalon
  0 siblings, 0 replies; 5+ messages in thread
From: Thomas Monjalon @ 2018-01-31 15:25 UTC (permalink / raw)
  To: Amr Mokhtar; +Cc: dev

31/01/2018 14:54, Amr Mokhtar:
> add check for rte_bbdev_callback_register() retun
> 
> Coverity issue: 257027
> Fixes: f714a18885a6 ("app/testbbdev: add test application for bbdev")
> 
> Signed-off-by: Amr Mokhtar <amr.mokhtar@intel.com>

Applied, thanks

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

* [dpdk-dev] [PATCH] app/testbbdev: fix unchecked return value
@ 2018-01-31 13:54 Amr Mokhtar
  2018-01-31 15:25 ` Thomas Monjalon
  0 siblings, 1 reply; 5+ messages in thread
From: Amr Mokhtar @ 2018-01-31 13:54 UTC (permalink / raw)
  To: dev; +Cc: Amr Mokhtar

add check for rte_bbdev_callback_register() retun

Coverity issue: 257027
Fixes: f714a18885a6 ("app/testbbdev: add test application for bbdev")

Signed-off-by: Amr Mokhtar <amr.mokhtar@intel.com>
---
 app/test-bbdev/test_bbdev_perf.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test-bbdev/test_bbdev_perf.c
index f7b51ca..21efad4 100644
--- a/app/test-bbdev/test_bbdev_perf.c
+++ b/app/test-bbdev/test_bbdev_perf.c
@@ -1557,9 +1557,11 @@ throughput_test(struct active_device *ad,
 			throughput_function = throughput_intr_lcore_enc;
 
 		/* Dequeue interrupt callback registration */
-		rte_bbdev_callback_register(ad->dev_id, RTE_BBDEV_EVENT_DEQUEUE,
-				dequeue_event_callback,
+		ret = rte_bbdev_callback_register(ad->dev_id,
+				RTE_BBDEV_EVENT_DEQUEUE, dequeue_event_callback,
 				&t_params);
+		if (ret < 0)
+			return ret;
 	} else {
 		if (test_vector.op_type == RTE_BBDEV_OP_TURBO_DEC)
 			throughput_function = throughput_pmd_lcore_dec;
-- 
2.7.4

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

end of thread, other threads:[~2018-05-17 16:15 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-16 13:57 [dpdk-dev] [PATCH] app/testbbdev: fix unchecked return value Kamil Chalupnik
2018-05-17 12:40 ` Mokhtar, Amr
2018-05-17 16:15   ` De Lara Guarch, Pablo
  -- strict thread matches above, loose matches on Subject: below --
2018-01-31 13:54 Amr Mokhtar
2018-01-31 15:25 ` Thomas Monjalon

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