Skip to content

Commit

Permalink
app/bbdev: add allocation checks
Browse files Browse the repository at this point in the history
[ upstream commit 8abe31b1d9d9448ab4ab1d98a22314a2fa9fbfc6 ]

Adding check for error on return of the
rte_bbdev_*_op_alloc_bulk calls in bbdev-test.

Fixes: f714a18 ("app/testbbdev: add test application for bbdev")

Signed-off-by: Nicolas Chautru <nicolas.chautru@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
  • Loading branch information
nicolas-chautru authored and bluca committed Feb 22, 2023
1 parent 81d653f commit eb40823
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app/test-bbdev/test_bbdev_perf.c
Expand Up @@ -4361,7 +4361,8 @@ offload_latency_test_dec(struct rte_mempool *mempool, struct test_buffers *bufs,
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, "Allocation failed for %d ops", burst_sz);
if (test_vector.op_type != RTE_BBDEV_OP_NONE)
copy_reference_dec_op(ops_enq, burst_sz, dequeued,
bufs->inputs,
Expand Down Expand Up @@ -4446,7 +4447,8 @@ offload_latency_test_ldpc_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, "Allocation failed for %d ops", burst_sz);
if (test_vector.op_type != RTE_BBDEV_OP_NONE)
copy_reference_ldpc_dec_op(ops_enq, burst_sz, dequeued,
bufs->inputs,
Expand Down

0 comments on commit eb40823

Please sign in to comment.