[PATCH 1/8] app/test-crypto-perf: improve dequeue logic
Gagandeep Singh
g.singh at nxp.com
Mon Apr 25 06:14:16 CEST 2022
Issue more dequeue commands if the gap between enqueued
and dequeued packets is more than burst size *8
Signed-off-by: Gagandeep Singh <g.singh at nxp.com>
---
app/test-crypto-perf/cperf_test_throughput.c | 42 +++++++++++---------
1 file changed, 23 insertions(+), 19 deletions(-)
diff --git a/app/test-crypto-perf/cperf_test_throughput.c b/app/test-crypto-perf/cperf_test_throughput.c
index cecf30e470..5cd8919c91 100644
--- a/app/test-crypto-perf/cperf_test_throughput.c
+++ b/app/test-crypto-perf/cperf_test_throughput.c
@@ -223,26 +223,30 @@ cperf_throughput_test_runner(void *test_ctx)
ops_unused = burst_size - ops_enqd;
ops_enqd_total += ops_enqd;
-
/* Dequeue processed burst of ops from crypto device */
- ops_deqd = rte_cryptodev_dequeue_burst(ctx->dev_id, ctx->qp_id,
- ops_processed, test_burst_size);
-
- if (likely(ops_deqd)) {
- /* Free crypto ops so they can be reused. */
- rte_mempool_put_bulk(ctx->pool,
- (void **)ops_processed, ops_deqd);
-
- ops_deqd_total += ops_deqd;
- } else {
- /**
- * Count dequeue polls which didn't return any
- * processed operations. This statistic is mainly
- * relevant to hw accelerators.
- */
- ops_deqd_failed++;
- }
-
+ do {
+ ops_deqd = rte_cryptodev_dequeue_burst(
+ ctx->dev_id, ctx->qp_id,
+ ops_processed, test_burst_size);
+
+ if (likely(ops_deqd)) {
+ /* Free crypto ops for reuse */
+ rte_mempool_put_bulk(ctx->pool,
+ (void **)ops_processed,
+ ops_deqd);
+
+ ops_deqd_total += ops_deqd;
+ } else {
+ /**
+ * Count dequeue polls which didn't
+ * return any processed operations.
+ * This statistic is mainly relevant
+ * to hw accelerators.
+ */
+ ops_deqd_failed++;
+ }
+ } while (ops_enqd_total - ops_deqd_total >
+ test_burst_size * 8);
}
/* Dequeue any operations still in the crypto device */
--
2.25.1
More information about the dev
mailing list