Skip to contentSkip to conversation

crypto/qat: fix NULL authentication request

PATCH Applied Adam Dybkowski 4 participants 4 messages May 10, 2021 – May 12, 2021 Crypto API

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 crypto/qat: fix NULL authentication request

This patch fixes the NULL auth generation case where the request shouldn't contain the authentication result address. Allows to run ipsec_autotest with a QAT device.

Fixes 65beb9abca6d ("crypto/qat: fix null auth when using VFIO")
---
 drivers/crypto/qat/qat_sym.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/crypto/qat/qat_sym.c +4 -2
index a1f5676c04..9415ec7d32 100644
@@ -399,8 +399,10 @@ qat_sym_build_request(void *in_op, uint8_t *out_msg,
 		}
 		min_ofs = auth_ofs;
 
-		auth_param->auth_res_addr =
-			op->sym->auth.digest.phys_addr;
+		if (ctx->qat_hash_alg != ICP_QAT_HW_AUTH_ALGO_NULL ||
+				ctx->auth_op == ICP_QAT_HW_AUTH_VERIFY)
+			auth_param->auth_res_addr =
+					op->sym->auth.digest.phys_addr;
 
 	}
 
Signature · 1 line
2.25.1
Acked-by on v1 1/1
#1 lore raw
Quoted 38 lines

-----Original Message-----
From: Dybkowski, AdamX <[email protected]>
Sent: Monday, May 10, 2021 11:20 AM
To: [email protected]; Zhang, Roy Fan <[email protected]>; Kusztal, ArkadiuszX <[email protected]>; [email protected]
Cc: Dybkowski, AdamX <[email protected]>
Subject: [PATCH] crypto/qat: fix NULL authentication request

This patch fixes the NULL auth generation case where the request shouldn't contain the authentication result address. Allows to run ipsec_autotest with a QAT device.

Fixes 65beb9abca6d ("crypto/qat: fix null auth when using VFIO")
---
 drivers/crypto/qat/qat_sym.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/crypto/qat/qat_sym.c +4 -2
index a1f5676c04..9415ec7d32 100644
@@ -399,8 +399,10 @@ qat_sym_build_request(void *in_op, uint8_t
 *out_msg,
 		}
 		min_ofs = auth_ofs;
 
-		auth_param->auth_res_addr =
-			op->sym->auth.digest.phys_addr;
+		if (ctx->qat_hash_alg != ICP_QAT_HW_AUTH_ALGO_NULL ||
+				ctx->auth_op ==
 ICP_QAT_HW_AUTH_VERIFY)
+			auth_param->auth_res_addr =
+					op->sym->auth.digest.phys_addr;
 

}

Quoted 2 lines

--
2.25.1

#2 lore raw

Hi Adam,

Quoted 44 lines

-----Original Message-----
From: dev <[email protected]> On Behalf Of Zhang, Roy Fan
Sent: Monday, May 10, 2021 12:42 PM
To: Dybkowski, AdamX <[email protected]>; [email protected]; Kusztal, ArkadiuszX <[email protected]>; [email protected]
Subject: Re: [dpdk-dev] [PATCH] crypto/qat: fix NULL authentication request

Quoted 24 lines

-----Original Message-----
From: Dybkowski, AdamX <[email protected]>
Sent: Monday, May 10, 2021 11:20 AM
To: [email protected]; Zhang, Roy Fan <[email protected]>; Kusztal, ArkadiuszX <[email protected]>; [email protected]
Cc: Dybkowski, AdamX <[email protected]>
Subject: [PATCH] crypto/qat: fix NULL authentication request

This patch fixes the NULL auth generation case where the request shouldn't contain the authentication result address. Allows to run ipsec_autotest with a QAT device.

Fixes 65beb9abca6d ("crypto/qat: fix null auth when using VFIO")
---
 drivers/crypto/qat/qat_sym.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
(quoted diff) +0 -0

b/drivers/crypto/qat/qat_sym.c index a1f5676c04..9415ec7d32 100644

drivers/crypto/qat/qat_sym.c qat_sym_build_request(void *in_op, uint8_t · line 403

Quoted 7 lines
drivers/crypto/qat/qat_sym.c +1 -2
@@ -399,8 +399,10 @@ qat_sym_build_request(void *in_op, uint8_t
 *out_msg,
 		}
 		min_ofs = auth_ofs;
 
-		auth_param->auth_res_addr =
-			op->sym->auth.digest.phys_addr;
+		if (ctx->qat_hash_alg != ICP_QAT_HW_AUTH_ALGO_NULL

||

Quoted 5 lines
drivers/crypto/qat/qat_sym.c +3 -0
+				ctx->auth_op ==
 ICP_QAT_HW_AUTH_VERIFY)
+			auth_param->auth_res_addr =
+					op->sym->auth.digest.phys_addr;
 
Quoted 6 lines
Quoted 4 lines

}

--
2.25.1

This patch should be backported, the following line should be added after the Fixes line:
Cc: [email protected]

Regards,

Bernard.

Applied
#3 lore raw
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

This patch fixes the NULL auth generation case where the request shouldn't contain the authentication result address. Allows to run ipsec_autotest with a QAT device.

Fixes 65beb9abca6d ("crypto/qat: fix null auth when using VFIO")
Quoted 7 lines
Quoted 3 lines
Quoted 2 lines

---

This patch should be backported, the following line should be added after the Fixes line:
Cc: [email protected]

Applied to dpdk-next-crypto

Thanks