app/bbdev: add explicit check for counters
authorNicolas Chautru <nicolas.chautru@intel.com>
Mon, 26 Oct 2020 17:48:05 +0000 (10:48 -0700)
committerAkhil Goyal <akhil.goyal@nxp.com>
Mon, 2 Nov 2020 08:24:41 +0000 (09:24 +0100)
Adding explicit check in ut that the stats counters
have the expect values.
This was identified as a gap from code coverage.

Signed-off-by: Nicolas Chautru <nicolas.chautru@intel.com>
Acked-by: Aidan Goddard <aidan.goddard@accelercomm.com>
Acked-by: Dave Burley <dave.burley@accelercomm.com>
app/test-bbdev/test_bbdev_perf.c

index 55208ef..de148b1 100644 (file)
@@ -4777,6 +4777,23 @@ offload_cost_test(struct active_device *ad,
                        (double)(time_st.deq_max_time * 1000000) /
                        rte_get_tsc_hz());
 
+       struct rte_bbdev_stats stats = {0};
+       get_bbdev_queue_stats(ad->dev_id, queue_id, &stats);
+       if (op_type != RTE_BBDEV_OP_LDPC_DEC) {
+               TEST_ASSERT_SUCCESS(stats.enqueued_count != num_to_process,
+                               "Mismatch in enqueue count %10"PRIu64" %d",
+                               stats.enqueued_count, num_to_process);
+               TEST_ASSERT_SUCCESS(stats.dequeued_count != num_to_process,
+                               "Mismatch in dequeue count %10"PRIu64" %d",
+                               stats.dequeued_count, num_to_process);
+       }
+       TEST_ASSERT_SUCCESS(stats.enqueue_err_count != 0,
+                       "Enqueue count Error %10"PRIu64"",
+                       stats.enqueue_err_count);
+       TEST_ASSERT_SUCCESS(stats.dequeue_err_count != 0,
+                       "Dequeue count Error (%10"PRIu64"",
+                       stats.dequeue_err_count);
+
        return TEST_SUCCESS;
 #endif
 }