[v1] crypto/qat: fix struct alignment

Message ID 20230630113040.521683-1-brian.dooley@intel.com (mailing list archive)
State Accepted, archived
Delegated to: akhil goyal
Headers
Series [v1] crypto/qat: fix struct alignment |

Checks

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

Commit Message

Brian Dooley June 30, 2023, 11:30 a.m. UTC
  The qat_sym_session struct variable alignment was causing a segfault.
AES expansion keys require 16-byte alignment. Added __rte_aligned to
the expansion keys.

Fixes: ca0ba0e48129 ("crypto/qat: default to IPsec MB for computations")

Signed-off-by: Brian Dooley <brian.dooley@intel.com>
---
 drivers/crypto/qat/qat_sym_session.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
  

Comments

Power, Ciara June 30, 2023, 9:19 p.m. UTC | #1
> -----Original Message-----
> From: Brian Dooley <brian.dooley@intel.com>
> Sent: Friday 30 June 2023 12:31
> To: Ji, Kai <kai.ji@intel.com>
> Cc: dev@dpdk.org; gakhil@marvell.com; Dooley, Brian
> <brian.dooley@intel.com>
> Subject: [PATCH v1] crypto/qat: fix struct alignment
> 
> The qat_sym_session struct variable alignment was causing a segfault.
> AES expansion keys require 16-byte alignment. Added __rte_aligned to the
> expansion keys.
> 
> Fixes: ca0ba0e48129 ("crypto/qat: default to IPsec MB for computations")
> 
> Signed-off-by: Brian Dooley <brian.dooley@intel.com>
> ---

Acked-by: Ciara Power <ciara.power@intel.com>
  
Akhil Goyal July 3, 2023, 2:15 p.m. UTC | #2
> > Subject: [PATCH v1] crypto/qat: fix struct alignment
> >
> > The qat_sym_session struct variable alignment was causing a segfault.
> > AES expansion keys require 16-byte alignment. Added __rte_aligned to the
> > expansion keys.
> >
> > Fixes: ca0ba0e48129 ("crypto/qat: default to IPsec MB for computations")
> >
> > Signed-off-by: Brian Dooley <brian.dooley@intel.com>
> > ---
> 
> Acked-by: Ciara Power <ciara.power@intel.com>
Applied to dpdk-next-crypto
Thanks.
  

Patch

diff --git a/drivers/crypto/qat/qat_sym_session.h b/drivers/crypto/qat/qat_sym_session.h
index 68cf3eaaf4..674a62ee12 100644
--- a/drivers/crypto/qat/qat_sym_session.h
+++ b/drivers/crypto/qat/qat_sym_session.h
@@ -142,10 +142,10 @@  struct qat_sym_session {
 	qat_sym_build_request_t build_request[2];
 #ifndef RTE_QAT_OPENSSL
 	IMB_MGR *mb_mgr;
-#endif
-	uint64_t expkey[4*15];
-	uint32_t dust[4*15];
+	uint64_t expkey[4*15] __rte_aligned(16);
+	uint32_t dust[4*15] __rte_aligned(16);
 	uint8_t docsis_key_len;
+#endif
 };
 
 int