[dpdk-dev] crypto/qat: fix AES-GMAC length of data

Message ID 1499780135-28975-1-git-send-email-arkadiuszx.kusztal@intel.com (mailing list archive)
State Not Applicable, archived
Delegated to: Pablo de Lara Guarch
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation fail Compilation issues

Commit Message

Arkadiusz Kusztal July 11, 2017, 1:35 p.m. UTC
  Fix AES-GMAC length of the data copied to the hardware to avoid
copying more data than necessary.

Fixes: 2fa64f840d65 ("crypto/qat: add GMAC capability")

Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
---
 drivers/crypto/qat/qat_crypto.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Comments

Fiona Trahe July 11, 2017, 1:46 p.m. UTC | #1
> -----Original Message-----
> From: Kusztal, ArkadiuszX
> Sent: Tuesday, July 11, 2017 2:36 PM
> To: dev@dpdk.org
> Cc: Trahe, Fiona <fiona.trahe@intel.com>; De Lara Guarch, Pablo <pablo.de.lara.guarch@intel.com>;
> Griffin, John <john.griffin@intel.com>; Jain, Deepak K <deepak.k.jain@intel.com>; Singh, Abhinav
> <abhinav.singh@intel.com>; Kusztal, ArkadiuszX <arkadiuszx.kusztal@intel.com>
> Subject: [PATCH] crypto/qat: fix AES-GMAC length of data
> 
> Fix AES-GMAC length of the data copied to the hardware to avoid
> copying more data than necessary.
> 
> Fixes: 2fa64f840d65 ("crypto/qat: add GMAC capability")
> 
> Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
  

Patch

diff --git a/drivers/crypto/qat/qat_crypto.c b/drivers/crypto/qat/qat_crypto.c
index 7e04f21..6764553 100644
--- a/drivers/crypto/qat/qat_crypto.c
+++ b/drivers/crypto/qat/qat_crypto.c
@@ -1363,10 +1363,10 @@  qat_write_hw_desc_entry(struct rte_crypto_op *op, uint8_t *out_msg,
 		if (!do_aead) {
 			qat_req->comn_mid.dst_length =
 				qat_req->comn_mid.src_length =
-					rte_pktmbuf_data_len(op->sym->m_src);
+					op->sym->auth.data.length;
 			auth_param->u1.aad_adr = 0;
 			auth_param->auth_len = op->sym->auth.data.length;
-			auth_param->auth_off = op->sym->auth.data.offset;
+			auth_param->auth_off = 0;
 			auth_param->u2.aad_sz = 0;
 		}
 	}