DPDK patches and discussions
 help / color / mirror / Atom feed
From: <akhil.goyal@nxp.com>
To: <dev@dpdk.org>
Cc: <declan.doherty@intel.com>, <pablo.de.lara.guarch@intel.com>,
	Akhil Goyal <akhil.goyal@nxp.com>
Subject: [dpdk-dev] [PATCH] test/test: improve dequeue logic for crypto operation
Date: Mon, 3 Apr 2017 16:23:02 +0530	[thread overview]
Message-ID: <20170403105302.9685-1-akhil.goyal@nxp.com> (raw)

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

             reply	other threads:[~2017-04-03 10:53 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-03 10:53 akhil.goyal [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170403105302.9685-1-akhil.goyal@nxp.com \
    --to=akhil.goyal@nxp.com \
    --cc=declan.doherty@intel.com \
    --cc=dev@dpdk.org \
    --cc=pablo.de.lara.guarch@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).