Skip to content

Commit

Permalink
app/bbdev: check statistics failure
Browse files Browse the repository at this point in the history
[ upstream commit ce1b62899167f6e2c49d8496afa43a9162167c6b ]

Add check for return value from get_bbdev_queue_stats.

Coverity issue: 383155
Fixes: c256043 ("app/bbdev: add explicit check for counters")

Signed-off-by: Hernan Vargas <hernan.vargas@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
  • Loading branch information
Hernanlv authored and bluca committed Mar 21, 2023
1 parent 80f678d commit cca0666
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions app/test-bbdev/test_bbdev_perf.c
Expand Up @@ -4703,7 +4703,7 @@ offload_cost_test(struct active_device *ad,
printf("Set RTE_BBDEV_OFFLOAD_COST to 'y' to turn the test on.\n");
return TEST_SKIPPED;
#else
int iter;
int iter, ret;
uint16_t burst_sz = op_params->burst_sz;
const uint16_t num_to_process = op_params->num_to_process;
const enum rte_bbdev_op_type op_type = test_vector.op_type;
Expand Down Expand Up @@ -4794,7 +4794,10 @@ offload_cost_test(struct active_device *ad,
rte_get_tsc_hz());

struct rte_bbdev_stats stats = {0};
get_bbdev_queue_stats(ad->dev_id, queue_id, &stats);
ret = get_bbdev_queue_stats(ad->dev_id, queue_id, &stats);
TEST_ASSERT_SUCCESS(ret,
"Failed to get stats for queue (%u) of device (%u)",
queue_id, ad->dev_id);
if (op_type != RTE_BBDEV_OP_LDPC_DEC) {
TEST_ASSERT_SUCCESS(stats.enqueued_count != num_to_process,
"Mismatch in enqueue count %10"PRIu64" %d",
Expand Down

0 comments on commit cca0666

Please sign in to comment.