DPDK patches and discussions
 help / color / mirror / Atom feed
From: Fan Zhang <roy.fan.zhang@intel.com>
To: dev@dpdk.org
Cc: pablo.de.lara.guarch@intel.com, stable@dpdk.com
Subject: [dpdk-dev] [PATCH v3] app/test-crypto-perf: fix crypto operation resubmission
Date: Tue, 18 Apr 2017 15:48:31 +0100	[thread overview]
Message-ID: <1492526911-110534-1-git-send-email-roy.fan.zhang@intel.com> (raw)
In-Reply-To: <1492526226-109903-1-git-send-email-roy.fan.zhang@intel.com>

This patch fixes the crypto operation resubmission problem in crypto
perferformance test. Originally, when needed crypto ops amount is
smaller than the enqueued crypto ops in the last round, one or more
processed crypto operations will be re-enqueued.

Fixes: f8be1786b1b8 ("app/crypto-perf: introduce performance test application")

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
---

v3:
- Added changes
- Added Pablo's ack

v2:
- Fixed memmove src and size calculation

 app/test-crypto-perf/cperf_test_throughput.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/app/test-crypto-perf/cperf_test_throughput.c b/app/test-crypto-perf/cperf_test_throughput.c
index 70ec4ff..61b27ea 100644
--- a/app/test-crypto-perf/cperf_test_throughput.c
+++ b/app/test-crypto-perf/cperf_test_throughput.c
@@ -348,6 +348,19 @@ cperf_throughput_test_runner(void *test_ctx)
 					ops_needed, ctx->sess, ctx->options,
 					ctx->test_vector);
 
+			/**
+			 * When ops_needed is smaller than ops_enqd, the
+			 * unused ops need to be moved to the front for
+			 * next round use.
+			 */
+			if (unlikely(ops_enqd > ops_needed)) {
+				size_t nb_b_to_mov = ops_unused * sizeof(
+						struct rte_crypto_op *);
+
+				memmove(&ops[ops_needed], &ops[ops_enqd],
+					nb_b_to_mov);
+			}
+
 #ifdef CPERF_LINEARIZATION_ENABLE
 			if (linearize) {
 				/* PMD doesn't support scatter-gather and source buffer
-- 
2.7.4

  reply	other threads:[~2017-04-18 14:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-10 14:57 [dpdk-dev] [PATCH] " Fan Zhang
2017-04-17 20:28 ` De Lara Guarch, Pablo
2017-04-18 14:37 ` [dpdk-dev] [PATCH v2] " Fan Zhang
2017-04-18 14:48   ` Fan Zhang [this message]
2017-04-18 15:24     ` [dpdk-dev] [PATCH v3] " De Lara Guarch, Pablo
2017-04-18 15:26       ` 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=1492526911-110534-1-git-send-email-roy.fan.zhang@intel.com \
    --to=roy.fan.zhang@intel.com \
    --cc=dev@dpdk.org \
    --cc=pablo.de.lara.guarch@intel.com \
    --cc=stable@dpdk.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).