[56/83] crypto/mvsam: move alignment attribute on types

Message ID 1710949096-5786-57-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/mvsam/mrvl_pmd_private.h | 12 ++++++------
 drivers/crypto/mvsam/rte_mrvl_pmd.c     | 12 +++++-------
 2 files changed, 11 insertions(+), 13 deletions(-)
  

Patch

diff --git a/drivers/crypto/mvsam/mrvl_pmd_private.h b/drivers/crypto/mvsam/mrvl_pmd_private.h
index 719d73d..80ff229 100644
--- a/drivers/crypto/mvsam/mrvl_pmd_private.h
+++ b/drivers/crypto/mvsam/mrvl_pmd_private.h
@@ -44,7 +44,7 @@  struct mrvl_crypto_private {
 };
 
 /** MRVL crypto queue pair structure. */
-struct mrvl_crypto_qp {
+struct __rte_cache_aligned mrvl_crypto_qp {
 	/** SAM CIO (MUSDK Queue Pair equivalent).*/
 	struct sam_cio *cio;
 
@@ -59,10 +59,10 @@  struct mrvl_crypto_qp {
 
 	/** CIO initialization parameters.*/
 	struct sam_cio_params cio_params;
-} __rte_cache_aligned;
+};
 
 /** MRVL crypto private session structure. */
-struct mrvl_crypto_session {
+struct __rte_cache_aligned mrvl_crypto_session {
 	/** Crypto operations chain order. */
 	enum mrvl_crypto_chain_order chain_order;
 
@@ -74,12 +74,12 @@  struct mrvl_crypto_session {
 
 	/** Cipher IV offset. */
 	uint16_t cipher_iv_offset;
-} __rte_cache_aligned;
+};
 
-struct mrvl_crypto_src_table {
+struct __rte_cache_aligned mrvl_crypto_src_table {
 	uint16_t iter_ops;
 	struct sam_buf_info src_bd[MRVL_MAX_SEGMENTS];
-} __rte_cache_aligned;
+};
 
 /** Set and validate MRVL crypto session parameters */
 int
diff --git a/drivers/crypto/mvsam/rte_mrvl_pmd.c b/drivers/crypto/mvsam/rte_mrvl_pmd.c
index 1641da9..193b7fb 100644
--- a/drivers/crypto/mvsam/rte_mrvl_pmd.c
+++ b/drivers/crypto/mvsam/rte_mrvl_pmd.c
@@ -47,22 +47,20 @@  enum algo_supported {
 };
 
 /** Map elements for cipher mapping.*/
-struct cipher_params_mapping {
+/* We want to squeeze in multiple maps into the cache line. */
+struct __rte_aligned(32) cipher_params_mapping {
 	enum algo_supported  supported;   /**< On/Off switch */
 	enum sam_cipher_alg  cipher_alg;  /**< Cipher algorithm */
 	enum sam_cipher_mode cipher_mode; /**< Cipher mode */
 	unsigned int max_key_len;         /**< Maximum key length (in bytes)*/
-}
-/* We want to squeeze in multiple maps into the cache line. */
-__rte_aligned(32);
+};
 
 /** Map elements for auth mapping.*/
-struct auth_params_mapping {
+/* We want to squeeze in multiple maps into the cache line. */
+struct __rte_aligned(32) auth_params_mapping {
 	enum algo_supported supported;  /**< On/off switch */
 	enum sam_auth_alg   auth_alg;   /**< Auth algorithm */
 }
-/* We want to squeeze in multiple maps into the cache line. */
-__rte_aligned(32);
 
 /**
  * Map of supported cipher algorithms.