From mboxrd@z Thu Jan 1 00:00:00 1970 From: Subject: [PATCH] test_cryptodev_perf: IV and digest should be stored at a DMAeble address Date: Mon, 26 Sep 2016 22:03:00 +0530 Message-ID: <20160926163300.22990-3-akhil.goyal@nxp.com> References: <20160926163300.22990-1-akhil.goyal@nxp.com> Mime-Version: 1.0 Content-Type: text/plain Cc: Akhil Goyal To: Return-path: Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0069.outbound.protection.outlook.com [104.47.33.69]) by dpdk.org (Postfix) with ESMTP id 35ECD3238 for ; Mon, 26 Sep 2016 13:05:07 +0200 (CEST) In-Reply-To: <20160926163300.22990-1-akhil.goyal@nxp.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Akhil Goyal For physical crypto devices, IV and digest are processed by the crypto device which need the contents to be written on some DMA able address. So in order to do that, IV and digest are accomodated in the packet. Signed-off-by: Akhil Goyal --- app/test/test_cryptodev_perf.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app/test/test_cryptodev_perf.c b/app/test/test_cryptodev_perf.c index 0ea7ec1..930d5b8 100644 --- a/app/test/test_cryptodev_perf.c +++ b/app/test/test_cryptodev_perf.c @@ -2366,9 +2366,13 @@ test_perf_set_crypto_op(struct rte_crypto_op *op, struct rte_mbuf *m, op->sym->auth.aad.length = AES_CBC_CIPHER_IV_LENGTH; /* Cipher Parameters */ - op->sym->cipher.iv.data = aes_cbc_iv; + op->sym->cipher.iv.data = (uint8_t *)m->buf_addr + m->data_off; + op->sym->cipher.iv.phys_addr = rte_pktmbuf_mtophys(m); op->sym->cipher.iv.length = AES_CBC_CIPHER_IV_LENGTH; + rte_memcpy(op->sym->cipher.iv.data, aes_cbc_iv, + AES_CBC_CIPHER_IV_LENGTH); + /* Data lengths/offsets Parameters */ op->sym->auth.data.offset = 0; op->sym->auth.data.length = data_len; @@ -2468,7 +2472,9 @@ test_perf_aes_sha(uint8_t dev_id, uint16_t queue_id, rte_pktmbuf_free(mbufs[k]); return -1; } - + /* Make room for Digest and IV in mbuf */ + rte_pktmbuf_append(mbufs[i], digest_length); + rte_pktmbuf_prepend(mbufs[i], AES_CBC_CIPHER_IV_LENGTH); } -- 1.9.1