From: Akhil Goyal <akhil.goyal@nxp.com>
To: "dev@dpdk.org" <dev@dpdk.org>
Cc: "declan.doherty@intel.com" <declan.doherty@intel.com>,
Akhil Goyal <akhil.goyal@nxp.com>
Subject: [dpdk-dev] [PATCH] app/test-crypto-perf: improve dequeue logic
Date: Wed, 27 Mar 2019 11:47:44 +0000 [thread overview]
Message-ID: <20190327113823.13481-1-akhil.goyal@nxp.com> (raw)
Message-ID: <20190327114744.pKwQCJwaksE1Fvr-km6O4dxyswLGO5NcMfnOW3iA3AI@z> (raw)
In case of hardware PMDs (which may take a longer duration
for processing the packets), there may be a case when the
number of enqueued packets are more than the dequeued.
So if the difference is more than 8 times the burst size,
more dequeue operations should be performed otherwise all
the buffers will be blocked in hardware.
Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
---
app/test-crypto-perf/cperf_test_throughput.c | 40 +++++++++++---------
1 file changed, 23 insertions(+), 17 deletions(-)
diff --git a/app/test-crypto-perf/cperf_test_throughput.c b/app/test-crypto-perf/cperf_test_throughput.c
index 2767f4ea8..d24a6dda0 100644
--- a/app/test-crypto-perf/cperf_test_throughput.c
+++ b/app/test-crypto-perf/cperf_test_throughput.c
@@ -208,23 +208,29 @@ cperf_throughput_test_runner(void *test_ctx)
/* 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);
}
--
2.17.1
next reply other threads:[~2019-03-27 11:47 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-27 11:47 Akhil Goyal [this message]
2019-03-27 11:47 ` Akhil Goyal
2019-03-27 15:20 ` Zhang, Roy Fan
2019-03-27 15:20 ` Zhang, Roy Fan
2019-03-27 17:31 ` Kevin Traynor
2019-03-27 17:31 ` Kevin Traynor
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=20190327113823.13481-1-akhil.goyal@nxp.com \
--to=akhil.goyal@nxp.com \
--cc=declan.doherty@intel.com \
--cc=dev@dpdk.org \
/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).