[dpdk-dev] [PATCH v3 2/7] app/bbdev: add explicit check for counters

Aidan Goddard aidan.goddard at accelercomm.com
Tue Sep 15 11:53:25 CEST 2020


Acked-by: Aidan Goddard <aidan.goddard at accelercomm.com>


From: dev <dev-bounces at dpdk.org> on behalf of Nicolas Chautru <nicolas.chautru at intel.com>
Sent: 19 August 2020 01:05
To: dev at dpdk.org <dev at dpdk.org>; akhil.goyal at nxp.com <akhil.goyal at nxp.com>
Cc: bruce.richardson at intel.com <bruce.richardson at intel.com>; Nicolas Chautru <nicolas.chautru at intel.com>
Subject: [dpdk-dev] [PATCH v3 2/7] app/bbdev: add explicit check for counters 
 
Adding explicit check in ut that the stats counters
have the expected values. Was missing for coverage.

Signed-off-by: Nicolas Chautru <nicolas.chautru at intel.com>
---
 app/test-bbdev/test_bbdev_perf.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test-bbdev/test_bbdev_perf.c
index 1319afd..b0b6f18 100644
--- a/app/test-bbdev/test_bbdev_perf.c
+++ b/app/test-bbdev/test_bbdev_perf.c
@@ -4769,6 +4769,23 @@ typedef int (test_case_function)(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
 }
-- 
1.8.3.1


More information about the dev mailing list