[63/83] crypto/armv8: move alignment attribute on types

Message ID 1710949096-5786-64-git-send-email-roretzla@linux.microsoft.com (mailing list archive)
State Superseded
Delegated to: David Marchand
Headers
Series move alignment attribute on types |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Tyler Retzlaff March 20, 2024, 3:37 p.m. UTC
  Move location of __rte_aligned(a) to new conventional location. The new
placement between {struct,union} and the tag allows the desired
alignment to be imparted on the type regardless of the toolchain being
used for both C and C++. Additionally, it avoids confusion by Doxygen
when generating documentation.

Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
---
 drivers/crypto/armv8/armv8_pmd_private.h | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)
  

Patch

diff --git a/drivers/crypto/armv8/armv8_pmd_private.h b/drivers/crypto/armv8/armv8_pmd_private.h
index 41292d8..c9bbcc2 100644
--- a/drivers/crypto/armv8/armv8_pmd_private.h
+++ b/drivers/crypto/armv8/armv8_pmd_private.h
@@ -99,7 +99,7 @@  struct armv8_crypto_private {
 };
 
 /** ARMv8 crypto queue pair */
-struct armv8_crypto_qp {
+struct __rte_cache_aligned armv8_crypto_qp {
 	uint16_t id;
 	/**< Queue Pair Identifier */
 	struct rte_ring *processed_ops;
@@ -115,10 +115,10 @@  struct armv8_crypto_qp {
 	 * by the driver when verifying a digest provided
 	 * by the user (using authentication verify operation)
 	 */
-} __rte_cache_aligned;
+};
 
 /** ARMv8 crypto private session structure */
-struct armv8_crypto_session {
+struct __rte_cache_aligned armv8_crypto_session {
 	enum armv8_crypto_chain_order chain_order;
 	/**< chain order mode */
 	crypto_func_t crypto_func;
@@ -160,11 +160,9 @@  struct armv8_crypto_session {
 			} auth;
 
 			struct {
-				uint8_t i_key_pad[SHA_BLOCK_MAX]
-							__rte_cache_aligned;
+				alignas(RTE_CACHE_LINE_SIZE) uint8_t i_key_pad[SHA_BLOCK_MAX];
 				/**< inner pad (max supported block length) */
-				uint8_t o_key_pad[SHA_BLOCK_MAX]
-							__rte_cache_aligned;
+				alignas(RTE_CACHE_LINE_SIZE) uint8_t o_key_pad[SHA_BLOCK_MAX];
 				/**< outer pad (max supported block length) */
 				uint8_t key[SHA_BLOCK_MAX];
 				/**< HMAC key (max supported block length)*/
@@ -174,7 +172,7 @@  struct armv8_crypto_session {
 		/* Digest length */
 	} auth;
 
-} __rte_cache_aligned;
+};
 
 /** Set and validate ARMv8 crypto session parameters */
 extern int armv8_crypto_set_session_parameters(