[2/2] crypto/caam_jr: fix total length in AUTH only sg case

Message ID 1554736925-13184-2-git-send-email-g.singh@nxp.com (mailing list archive)
State Accepted, archived
Delegated to: akhil goyal
Headers
Series [1/2] crypto/caam_jr: fix the shared desc endianness |

Checks

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

Commit Message

Gagandeep Singh April 8, 2019, 8:59 a.m. UTC
  CAAM return wrong digest value in AUTH only sg test case
because digest calculated on wrong length of data

Fixes: 71dd6b9d44e7 ("crypto/caam_jr: add scatter gather")
Cc: g.singh@nxp.com

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
---
 drivers/crypto/caam_jr/caam_jr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Akhil Goyal April 9, 2019, 2:06 p.m. UTC | #1
> -----Original Message-----
> From: Gagandeep Singh
> Sent: Monday, April 8, 2019 2:30 PM
> To: dev@dpdk.org; Akhil Goyal <akhil.goyal@nxp.com>
> Cc: Gagandeep Singh <G.Singh@nxp.com>
> Subject: [PATCH 2/2] crypto/caam_jr: fix total length in AUTH only sg case
> 
> CAAM return wrong digest value in AUTH only sg test case
> because digest calculated on wrong length of data
> 
> Fixes: 71dd6b9d44e7 ("crypto/caam_jr: add scatter gather")
> Cc: g.singh@nxp.com
> 
> Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
> ---
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
  

Patch

diff --git a/drivers/crypto/caam_jr/caam_jr.c b/drivers/crypto/caam_jr/caam_jr.c
index 20452e3..efc69b6 100644
--- a/drivers/crypto/caam_jr/caam_jr.c
+++ b/drivers/crypto/caam_jr/caam_jr.c
@@ -798,7 +798,7 @@  void caam_jr_stats_reset(struct rte_cryptodev *dev)
 		sg->len = cpu_to_caam32(ses->digest_length);
 		length += ses->digest_length;
 	} else {
-		length -= ses->digest_length;
+		sg->len -= ses->digest_length;
 	}
 
 	/* last element*/