crypto/qat: fix NULL authentication request

Message ID 20210510102011.44343-1-adamx.dybkowski@intel.com (mailing list archive)
State Accepted, archived
Delegated to: akhil goyal
Headers
Series crypto/qat: fix NULL authentication request |

Checks

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

Commit Message

Dybkowski, AdamX May 10, 2021, 10:20 a.m. UTC
  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")

Signed-off-by: Adam Dybkowski <adamx.dybkowski@intel.com>
---
 drivers/crypto/qat/qat_sym.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
  

Comments

Fan Zhang May 10, 2021, 11:41 a.m. UTC | #1
> -----Original Message-----
> From: Dybkowski, AdamX <adamx.dybkowski@intel.com>
> Sent: Monday, May 10, 2021 11:20 AM
> To: dev@dpdk.org; Zhang, Roy Fan <roy.fan.zhang@intel.com>; Kusztal,
> ArkadiuszX <arkadiuszx.kusztal@intel.com>; gakhil@marvell.com
> Cc: Dybkowski, AdamX <adamx.dybkowski@intel.com>
> 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")
> 
> Signed-off-by: Adam Dybkowski <adamx.dybkowski@intel.com>
> ---
>  drivers/crypto/qat/qat_sym.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/crypto/qat/qat_sym.c b/drivers/crypto/qat/qat_sym.c
> index a1f5676c04..9415ec7d32 100644
> --- a/drivers/crypto/qat/qat_sym.c
> +++ b/drivers/crypto/qat/qat_sym.c
> @@ -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;
> 
>  	}
> 
> --
> 2.25.1

Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
  
Iremonger, Bernard May 12, 2021, 2:16 p.m. UTC | #2
Hi Adam,

> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Zhang, Roy Fan
> Sent: Monday, May 10, 2021 12:42 PM
> To: Dybkowski, AdamX <adamx.dybkowski@intel.com>; dev@dpdk.org;
> Kusztal, ArkadiuszX <arkadiuszx.kusztal@intel.com>; gakhil@marvell.com
> Subject: Re: [dpdk-dev] [PATCH] crypto/qat: fix NULL authentication request
> 
> > -----Original Message-----
> > From: Dybkowski, AdamX <adamx.dybkowski@intel.com>
> > Sent: Monday, May 10, 2021 11:20 AM
> > To: dev@dpdk.org; Zhang, Roy Fan <roy.fan.zhang@intel.com>; Kusztal,
> > ArkadiuszX <arkadiuszx.kusztal@intel.com>; gakhil@marvell.com
> > Cc: Dybkowski, AdamX <adamx.dybkowski@intel.com>
> > 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")
> >
> > Signed-off-by: Adam Dybkowski <adamx.dybkowski@intel.com>
> > ---
> >  drivers/crypto/qat/qat_sym.c | 6 ++++--
> >  1 file changed, 4 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/crypto/qat/qat_sym.c
> > b/drivers/crypto/qat/qat_sym.c index a1f5676c04..9415ec7d32 100644
> > --- a/drivers/crypto/qat/qat_sym.c
> > +++ b/drivers/crypto/qat/qat_sym.c
> > @@ -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;
> >
> >  	}
> >
> > --
> > 2.25.1
> 
> Acked-by: Fan Zhang <roy.fan.zhang@intel.com>

This patch should be backported, the following line should be added after the Fixes line:
Cc: stable@dpdk.org

Regards,

Bernard.
  
Akhil Goyal May 12, 2021, 4:08 p.m. UTC | #3
> > > 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")
> > >
> > > Signed-off-by: Adam Dybkowski <adamx.dybkowski@intel.com>
> > > ---
> > Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
> 
> This patch should be backported, the following line should be added after
> the Fixes line:
> Cc: stable@dpdk.org
Applied to dpdk-next-crypto

Thanks
  

Patch

diff --git a/drivers/crypto/qat/qat_sym.c b/drivers/crypto/qat/qat_sym.c
index a1f5676c04..9415ec7d32 100644
--- a/drivers/crypto/qat/qat_sym.c
+++ b/drivers/crypto/qat/qat_sym.c
@@ -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;
 
 	}