All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] test/test: improve dequeue logic for crypto operation
@ 2017-04-03 10:53 akhil.goyal
  2017-04-04 15:11 ` De Lara Guarch, Pablo
  0 siblings, 1 reply; 8+ messages in thread
From: akhil.goyal @ 2017-04-03 10:53 UTC (permalink / raw)
  To: dev; +Cc: declan.doherty, pablo.de.lara.guarch, Akhil Goyal

From: Akhil Goyal <akhil.goyal@nxp.com>

While enqueue/dequeue operations in test_perf_aes_sha,
the underlying implementation may not be able to dequeue
the same number of buffers as enqueued. So, it may be
necessary to perform more dequeue operations if the gap
is more than pparams->burst_size * NUM_MBUF_SETS.

Other algos may also need to update the logic if required.

Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
---
 test/test/test_cryptodev_perf.c | 24 ++++++++++++++----------
 1 file changed, 14 insertions(+), 10 deletions(-)

diff --git a/test/test/test_cryptodev_perf.c b/test/test/test_cryptodev_perf.c
index 9cdbc39..70ee5bc 100644
--- a/test/test/test_cryptodev_perf.c
+++ b/test/test/test_cryptodev_perf.c
@@ -3229,17 +3229,21 @@ test_perf_aes_sha(uint8_t dev_id, uint16_t queue_id,
 			total_enqueued += burst_enqueued;
 		}
 
-		/* dequeue burst */
-		burst_dequeued = rte_cryptodev_dequeue_burst(dev_id, queue_id,
-				proc_ops, pparams->burst_size);
-		if (burst_dequeued == 0)
-			failed_polls++;
-		else {
-			processed += burst_dequeued;
+		do {
+			/* dequeue burst */
+			burst_dequeued = rte_cryptodev_dequeue_burst(dev_id,
+						queue_id, proc_ops,
+						pparams->burst_size);
+			if (burst_dequeued == 0)
+				failed_polls++;
+			else {
+				processed += burst_dequeued;
 
-			for (l = 0; l < burst_dequeued; l++)
-				rte_crypto_op_free(proc_ops[l]);
-		}
+				for (l = 0; l < burst_dequeued; l++)
+					rte_crypto_op_free(proc_ops[l]);
+			}
+		} while ((total_enqueued - processed) >
+			(pparams->burst_size * NUM_MBUF_SETS));
 		j++;
 	}
 
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2017-05-02  7:23 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-03 10:53 [PATCH] test/test: improve dequeue logic for crypto operation akhil.goyal
2017-04-04 15:11 ` De Lara Guarch, Pablo
2017-04-20 10:48   ` Akhil Goyal
2017-04-26  9:38     ` De Lara Guarch, Pablo
2017-04-26  9:53       ` Akhil Goyal
2017-04-26 10:42         ` De Lara Guarch, Pablo
2017-04-26 11:02           ` Akhil Goyal
2017-05-02  7:22             ` De Lara Guarch, Pablo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.