crypto/qat: fix null auth issues when using vfio_pci

Message ID 20190809092901.17788-1-damianx.nowak@intel.com (mailing list archive)
State Accepted, archived
Delegated to: akhil goyal
Headers
Series crypto/qat: fix null auth issues when using vfio_pci |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation fail Compilation issues
ci/iol-Compile-Testing success Compile Testing PASS
ci/intel-Performance-Testing success Performance Testing PASS
ci/mellanox-Performance-Testing success Performance Testing PASS

Commit Message

Damian Nowak Aug. 9, 2019, 9:29 a.m. UTC
  When running auth NULL cases while using
vfio_pci, DMAR read/write faults appear. It
happens even if digest_length is set to 0.
This is caused by auth_res_addr initialized
as 0x0.

Fixes: 4e0955bddb08
Cc: Fiona Trahe <fiona.trahe@intel.com>

Signed-off-by: Damian Nowak <damianx.nowak@intel.com>
---
 drivers/crypto/qat/qat_sym.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
  

Comments

Akhil Goyal Oct. 15, 2019, 1:42 p.m. UTC | #1
Hi Fiona,

Could you please Ack the following change.

Thanks,
Akhil

> -----Original Message-----
> From: Damian Nowak <damianx.nowak@intel.com>
> Sent: Friday, August 9, 2019 2:59 PM
> To: dev@dpdk.org
> Cc: Akhil Goyal <akhil.goyal@nxp.com>; fiona.trahe@intel.com;
> arkadiuszx.kusztal@intel.com; Damian Nowak <damianx.nowak@intel.com>
> Subject: [PATCH] crypto/qat: fix null auth issues when using vfio_pci
> 
> When running auth NULL cases while using
> vfio_pci, DMAR read/write faults appear. It
> happens even if digest_length is set to 0.
> This is caused by auth_res_addr initialized
> as 0x0.
> 
> Fixes: 4e0955bddb08
> Cc: Fiona Trahe <fiona.trahe@intel.com>
> 
> Signed-off-by: Damian Nowak <damianx.nowak@intel.com>
> ---
>  drivers/crypto/qat/qat_sym.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/crypto/qat/qat_sym.c b/drivers/crypto/qat/qat_sym.c
> index 46ef27a..6aa514c 100644
> --- a/drivers/crypto/qat/qat_sym.c
> +++ b/drivers/crypto/qat/qat_sym.c
> @@ -307,9 +307,8 @@ qat_sym_build_request(void *in_op, uint8_t *out_msg,
>  		}
>  		min_ofs = auth_ofs;
> 
> -		if (likely(ctx->qat_hash_alg !=
> ICP_QAT_HW_AUTH_ALGO_NULL))
> -			auth_param->auth_res_addr =
> -					op->sym->auth.digest.phys_addr;
> +		auth_param->auth_res_addr =
> +			op->sym->auth.digest.phys_addr;
> 
>  	}
> 
> --
> 2.7.4
  
Fiona Trahe Oct. 17, 2019, 1:17 p.m. UTC | #2
> -----Original Message-----
> From: Nowak, DamianX
> Sent: Friday, August 9, 2019 10:29 AM
> To: dev@dpdk.org
> Cc: akhil.goyal@nxp.com; Trahe, Fiona <fiona.trahe@intel.com>; Kusztal, ArkadiuszX
> <arkadiuszx.kusztal@intel.com>; Nowak, DamianX <damianx.nowak@intel.com>
> Subject: [PATCH] crypto/qat: fix null auth issues when using vfio_pci
> 
> When running auth NULL cases while using
> vfio_pci, DMAR read/write faults appear. It
> happens even if digest_length is set to 0.
> This is caused by auth_res_addr initialized
> as 0x0.
> 
> Fixes: 4e0955bddb08
> Cc: Fiona Trahe <fiona.trahe@intel.com>
> 
> Signed-off-by: Damian Nowak <damianx.nowak@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
  
Akhil Goyal Oct. 21, 2019, 9:43 a.m. UTC | #3
> >
> > When running auth NULL cases while using
> > vfio_pci, DMAR read/write faults appear. It
> > happens even if digest_length is set to 0.
> > This is caused by auth_res_addr initialized
> > as 0x0.
> >
> > Fixes: 4e0955bddb08
> > Cc: Fiona Trahe <fiona.trahe@intel.com>
> >
> > Signed-off-by: Damian Nowak <damianx.nowak@intel.com>
> Acked-by: Fiona Trahe <fiona.trahe@intel.com>

Applied to dpdk-next-crypto

Thanks
  
Akhil Goyal Oct. 21, 2019, 9:44 a.m. UTC | #4
> 
> 
> > >
> > > When running auth NULL cases while using
> > > vfio_pci, DMAR read/write faults appear. It
> > > happens even if digest_length is set to 0.
> > > This is caused by auth_res_addr initialized
> > > as 0x0.
> > >
> > > Fixes: 4e0955bddb08
> > > Cc: Fiona Trahe <fiona.trahe@intel.com>
> > >
> > > Signed-off-by: Damian Nowak <damianx.nowak@intel.com>
> > Acked-by: Fiona Trahe <fiona.trahe@intel.com>
> 
> Applied to dpdk-next-crypto
> 
> Thanks

Cc: stable@dpdk.org
  

Patch

diff --git a/drivers/crypto/qat/qat_sym.c b/drivers/crypto/qat/qat_sym.c
index 46ef27a..6aa514c 100644
--- a/drivers/crypto/qat/qat_sym.c
+++ b/drivers/crypto/qat/qat_sym.c
@@ -307,9 +307,8 @@  qat_sym_build_request(void *in_op, uint8_t *out_msg,
 		}
 		min_ofs = auth_ofs;
 
-		if (likely(ctx->qat_hash_alg != ICP_QAT_HW_AUTH_ALGO_NULL))
-			auth_param->auth_res_addr =
-					op->sym->auth.digest.phys_addr;
+		auth_param->auth_res_addr =
+			op->sym->auth.digest.phys_addr;
 
 	}