From 3386ca38bdc4c835489ed088e2ea0843e90dc5b6 Mon Sep 17 00:00:00 2001 From: Gagandeep Singh Date: Mon, 8 Apr 2019 08:59:30 +0000 Subject: [PATCH] crypto/caam_jr: fix total length in auth only s/g 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: stable@dpdk.org Signed-off-by: Gagandeep Singh Acked-by: Akhil Goyal --- drivers/crypto/caam_jr/caam_jr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/crypto/caam_jr/caam_jr.c b/drivers/crypto/caam_jr/caam_jr.c index da9e9821e3..5028bd2a4c 100644 --- a/drivers/crypto/caam_jr/caam_jr.c +++ b/drivers/crypto/caam_jr/caam_jr.c @@ -799,7 +799,7 @@ build_auth_only_sg(struct rte_crypto_op *op, struct caam_jr_session *ses) sg->len = cpu_to_caam32(ses->digest_length); length += ses->digest_length; } else { - length -= ses->digest_length; + sg->len -= ses->digest_length; } /* last element*/ -- 2.20.1