[v1] crypto/qat: fix QAT GEN4 AEAD job in raw data path

Message ID 20220121103830.14058-1-kai.ji@intel.com (mailing list archive)
State Accepted, archived
Delegated to: akhil goyal
Headers
Series [v1] crypto/qat: fix QAT GEN4 AEAD job in raw data path |

Checks

Context Check Description
ci/checkpatch warning coding style issues
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/github-robot: build success github build: passed
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-aarch64-unit-testing success Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-abi-testing success Testing PASS

Commit Message

Ji, Kai Jan. 21, 2022, 10:38 a.m. UTC
  This patch fix the cipher params configuration in AEAD job if
QAT GEN4 unified cipher slice(UCS) enabled.

Fixes: 328d690d2f60 ("crypto/qat: update raw data path")
Cc: roy.fan.zhang@intel.com

Signed-off-by: Kai Ji <kai.ji@intel.com>
---
 drivers/crypto/qat/qat_sym_hw_dp.c | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)
  

Comments

Fan Zhang Jan. 21, 2022, 10:40 a.m. UTC | #1
> -----Original Message-----
> From: Ji, Kai <kai.ji@intel.com>
> Sent: Friday, January 21, 2022 10:39 AM
> To: dev@dpdk.org
> Cc: stable@dpdk.org; Ji, Kai <kai.ji@intel.com>; Zhang, Roy Fan
> <roy.fan.zhang@intel.com>
> Subject: [dpdk-dev v1] crypto/qat: fix QAT GEN4 AEAD job in raw data path
> 
> This patch fix the cipher params configuration in AEAD job if
> QAT GEN4 unified cipher slice(UCS) enabled.
> 
> Fixes: 328d690d2f60 ("crypto/qat: update raw data path")
> Cc: roy.fan.zhang@intel.com
> 
> Signed-off-by: Kai Ji <kai.ji@intel.com>
> ---
Nice catch, thanks!
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
  
Akhil Goyal Feb. 8, 2022, 9:30 p.m. UTC | #2
> > This patch fix the cipher params configuration in AEAD job if
> > QAT GEN4 unified cipher slice(UCS) enabled.
> >
> > Fixes: 328d690d2f60 ("crypto/qat: update raw data path")
> > Cc: roy.fan.zhang@intel.com
> >
> > Signed-off-by: Kai Ji <kai.ji@intel.com>
> > ---
> Nice catch, thanks!
> Acked-by: Fan Zhang <roy.fan.zhang@intel.com>

Applied to dpdk-next-crypto
  

Patch

diff --git a/drivers/crypto/qat/qat_sym_hw_dp.c b/drivers/crypto/qat/qat_sym_hw_dp.c
index 12825e448b..792ad2b213 100644
--- a/drivers/crypto/qat/qat_sym_hw_dp.c
+++ b/drivers/crypto/qat/qat_sym_hw_dp.c
@@ -533,8 +533,20 @@  enqueue_one_aead_job(struct qat_sym_session *ctx,
 	/* CPM 1.7 uses single pass to treat AEAD as cipher operation */
 	if (ctx->is_single_pass) {
 		enqueue_one_cipher_job(ctx, req, iv, ofs, data_len);
-		cipher_param->spc_aad_addr = aad->iova;
-		cipher_param->spc_auth_res_addr = digest->iova;
+
+		if (ctx->is_ucs) {
+			/* QAT GEN4 uses single pass to treat AEAD as cipher
+			 * operation
+			 */
+			struct icp_qat_fw_la_cipher_20_req_params *cipher_param_20 =
+				(void *)&req->serv_specif_rqpars;
+			cipher_param_20->spc_aad_addr = aad->iova;
+			cipher_param_20->spc_auth_res_addr = digest->iova;
+		} else {
+			cipher_param->spc_aad_addr = aad->iova;
+			cipher_param->spc_auth_res_addr = digest->iova;
+		}
+
 		return;
 	}