DPDK patches and discussions
 help / color / mirror / Atom feed
From: Fiona Trahe <fiona.trahe@intel.com>
To: dev@dpdk.org
Cc: pablo.de.lara.guarch@intel.com, fiona.trahe@intel.com,
	john.griffin@intel.com, deepak.k.jain@intel.com,
	arkadiuszx.kusztal@intel.com
Subject: [dpdk-dev] [PATCH 2/2] app/test: use correct offsets in AES perf test
Date: Mon, 24 Oct 2016 13:00:00 +0100	[thread overview]
Message-ID: <1477310400-4934-3-git-send-email-fiona.trahe@intel.com> (raw)
In-Reply-To: <1477310400-4934-1-git-send-email-fiona.trahe@intel.com>

offsets for digest and data need to be adjusted
to take prepended IV into account

Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
---
 app/test/test_cryptodev_perf.c | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/app/test/test_cryptodev_perf.c b/app/test/test_cryptodev_perf.c
index e05e11b..53dd8f5 100644
--- a/app/test/test_cryptodev_perf.c
+++ b/app/test/test_cryptodev_perf.c
@@ -2714,26 +2714,27 @@ test_perf_set_crypto_op_aes(struct rte_crypto_op *op, struct rte_mbuf *m,
 	}
 
 	/* Authentication Parameters */
-	op->sym->auth.digest.data = (uint8_t *)m->buf_addr +
-					(m->data_off + data_len);
-	op->sym->auth.digest.phys_addr = rte_pktmbuf_mtophys_offset(m, data_len);
+	op->sym->auth.digest.data = rte_pktmbuf_mtod_offset(m, uint8_t *,
+			AES_CIPHER_IV_LENGTH + data_len);
+	op->sym->auth.digest.phys_addr = rte_pktmbuf_mtophys_offset(m,
+			AES_CIPHER_IV_LENGTH + data_len);
 	op->sym->auth.digest.length = digest_len;
 	op->sym->auth.aad.data = aes_iv;
 	op->sym->auth.aad.length = AES_CIPHER_IV_LENGTH;
 
 	/* Cipher Parameters */
-	op->sym->cipher.iv.data = (uint8_t *)m->buf_addr + m->data_off;
+	op->sym->cipher.iv.data = rte_pktmbuf_mtod(m, uint8_t *);
 	op->sym->cipher.iv.phys_addr = rte_pktmbuf_mtophys(m);
 	op->sym->cipher.iv.length = AES_CIPHER_IV_LENGTH;
 
 	rte_memcpy(op->sym->cipher.iv.data, aes_iv, AES_CIPHER_IV_LENGTH);
 
 	/* Data lengths/offsets Parameters */
-	op->sym->auth.data.offset = 0;
+	op->sym->auth.data.offset = AES_CIPHER_IV_LENGTH;
 	op->sym->auth.data.length = data_len;
 
-	op->sym->cipher.data.offset = AES_BLOCK_SIZE;
-	op->sym->cipher.data.length = data_len - AES_BLOCK_SIZE;
+	op->sym->cipher.data.offset = AES_CIPHER_IV_LENGTH;
+	op->sym->cipher.data.length = data_len;
 
 	op->sym->m_src = m;
 
-- 
2.5.0

  parent reply	other threads:[~2016-10-24 12:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-24 11:59 [dpdk-dev] [PATCH 0/2] crypto/qat: performance optimisation Fiona Trahe
2016-10-24 11:59 ` [dpdk-dev] [PATCH 1/2] crypto/qat: rework request builder for performance Fiona Trahe
2016-10-24 13:34   ` Jain, Deepak K
2016-10-24 12:00 ` Fiona Trahe [this message]
2016-10-24 13:35   ` [dpdk-dev] [PATCH 2/2] app/test: use correct offsets in AES perf test Jain, Deepak K
2016-10-25 14:45 ` [dpdk-dev] [PATCH 0/2] crypto/qat: performance optimisation 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=1477310400-4934-3-git-send-email-fiona.trahe@intel.com \
    --to=fiona.trahe@intel.com \
    --cc=arkadiuszx.kusztal@intel.com \
    --cc=deepak.k.jain@intel.com \
    --cc=dev@dpdk.org \
    --cc=john.griffin@intel.com \
    --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).