[58/83] crypto/ipsec_mb: move alignment attribute on types

Message ID 1710949096-5786-59-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/ipsec_mb/pmd_aesni_mb.c         |  4 ++--
 drivers/crypto/ipsec_mb/pmd_aesni_mb_priv.h    | 24 ++++++++++++------------
 drivers/crypto/ipsec_mb/pmd_chacha_poly_priv.h |  4 ++--
 drivers/crypto/ipsec_mb/pmd_kasumi_priv.h      |  4 ++--
 drivers/crypto/ipsec_mb/pmd_snow3g_priv.h      |  4 ++--
 drivers/crypto/ipsec_mb/pmd_zuc_priv.h         |  4 ++--
 6 files changed, 22 insertions(+), 22 deletions(-)
  

Patch

diff --git a/drivers/crypto/ipsec_mb/pmd_aesni_mb.c b/drivers/crypto/ipsec_mb/pmd_aesni_mb.c
index 4de4866..69a5466 100644
--- a/drivers/crypto/ipsec_mb/pmd_aesni_mb.c
+++ b/drivers/crypto/ipsec_mb/pmd_aesni_mb.c
@@ -32,8 +32,8 @@  struct aesni_mb_op_buf_data {
 {
 	uint32_t i, length;
 
-	uint8_t ipad_buf[blocksize] __rte_aligned(16);
-	uint8_t opad_buf[blocksize] __rte_aligned(16);
+	alignas(16) uint8_t ipad_buf[blocksize];
+	alignas(16) uint8_t opad_buf[blocksize];
 
 	/* Setup inner and outer pads */
 	memset(ipad_buf, HMAC_IPAD_VALUE, blocksize);
diff --git a/drivers/crypto/ipsec_mb/pmd_aesni_mb_priv.h b/drivers/crypto/ipsec_mb/pmd_aesni_mb_priv.h
index 85994fe..eec8931 100644
--- a/drivers/crypto/ipsec_mb/pmd_aesni_mb_priv.h
+++ b/drivers/crypto/ipsec_mb/pmd_aesni_mb_priv.h
@@ -848,7 +848,7 @@  struct aesni_mb_qp_data {
 }
 
 /** AES-NI multi-buffer private session structure */
-struct aesni_mb_session {
+struct __rte_cache_aligned aesni_mb_session {
 	IMB_JOB template_job;
 	/*< Template job structure */
 	uint32_t session_id;
@@ -869,9 +869,9 @@  struct aesni_mb_session {
 	struct {
 		union {
 			struct {
-				uint32_t encode[60] __rte_aligned(16);
+				alignas(16) uint32_t encode[60];
 				/* *< encode key */
-				uint32_t decode[60] __rte_aligned(16);
+				alignas(16) uint32_t decode[60];
 				/* *< decode key */
 			} expanded_aes_keys;
 			/* *< Expanded AES keys - Allocating space to
@@ -903,9 +903,9 @@  struct aesni_mb_session {
 		/* *< auth operation generate or verify */
 		union {
 			struct {
-				uint8_t inner[128] __rte_aligned(16);
+				alignas(16) uint8_t inner[128];
 				/* *< inner pad */
-				uint8_t outer[128] __rte_aligned(16);
+				alignas(16) uint8_t outer[128];
 				/* *< outer pad */
 			} pads;
 			/* *< HMAC Authentication pads -
@@ -915,20 +915,20 @@  struct aesni_mb_session {
 			 */
 
 			struct {
-				uint32_t k1_expanded[44] __rte_aligned(16);
+				alignas(16) uint32_t k1_expanded[44];
 				/* *< k1 (expanded key). */
-				uint8_t k2[16] __rte_aligned(16);
+				alignas(16) uint8_t k2[16];
 				/* *< k2. */
-				uint8_t k3[16] __rte_aligned(16);
+				alignas(16) uint8_t k3[16];
 				/* *< k3. */
 			} xcbc;
 
 			struct {
-				uint32_t expkey[60] __rte_aligned(16);
+				alignas(16) uint32_t expkey[60];
 				/* *< k1 (expanded key). */
-				uint32_t skey1[4] __rte_aligned(16);
+				alignas(16) uint32_t skey1[4];
 				/* *< k2. */
-				uint32_t skey2[4] __rte_aligned(16);
+				alignas(16) uint32_t skey2[4];
 				/* *< k3. */
 			} cmac;
 			/* *< Expanded XCBC authentication keys */
@@ -943,7 +943,7 @@  struct aesni_mb_session {
 		uint16_t req_digest_len;
 
 	} auth;
-} __rte_cache_aligned;
+};
 
 typedef void (*hash_one_block_t)(const void *data, void *digest);
 typedef void (*aes_keyexp_t)(const void *key, void *enc_exp_keys,
diff --git a/drivers/crypto/ipsec_mb/pmd_chacha_poly_priv.h b/drivers/crypto/ipsec_mb/pmd_chacha_poly_priv.h
index 842f62f..0eca63c 100644
--- a/drivers/crypto/ipsec_mb/pmd_chacha_poly_priv.h
+++ b/drivers/crypto/ipsec_mb/pmd_chacha_poly_priv.h
@@ -46,7 +46,7 @@  struct rte_cryptodev_capabilities chacha20_poly1305_capabilities[] = {
 uint8_t pmd_driver_id_chacha20_poly1305;
 
 /** CHACHA20 POLY1305 private session structure */
-struct chacha20_poly1305_session {
+struct __rte_cache_aligned chacha20_poly1305_session {
 	struct {
 		uint16_t length;
 		uint16_t offset;
@@ -60,7 +60,7 @@  struct chacha20_poly1305_session {
 	/**< Generated digest length */
 	uint8_t key[CHACHA20_POLY1305_KEY_SIZE];
 	enum ipsec_mb_operation op;
-} __rte_cache_aligned;
+};
 
 struct chacha20_poly1305_qp_data {
 	struct chacha20_poly1305_context_data chacha20_poly1305_ctx_data;
diff --git a/drivers/crypto/ipsec_mb/pmd_kasumi_priv.h b/drivers/crypto/ipsec_mb/pmd_kasumi_priv.h
index 8db1d1c..c2e28ea 100644
--- a/drivers/crypto/ipsec_mb/pmd_kasumi_priv.h
+++ b/drivers/crypto/ipsec_mb/pmd_kasumi_priv.h
@@ -61,14 +61,14 @@ 
 };
 
 /** KASUMI private session structure */
-struct kasumi_session {
+struct __rte_cache_aligned kasumi_session {
 	/* Keys have to be 16-byte aligned */
 	kasumi_key_sched_t pKeySched_cipher;
 	kasumi_key_sched_t pKeySched_hash;
 	enum ipsec_mb_operation op;
 	enum rte_crypto_auth_operation auth_op;
 	uint16_t cipher_iv_offset;
-} __rte_cache_aligned;
+};
 
 struct kasumi_qp_data {
 	uint8_t temp_digest[KASUMI_DIGEST_LENGTH];
diff --git a/drivers/crypto/ipsec_mb/pmd_snow3g_priv.h b/drivers/crypto/ipsec_mb/pmd_snow3g_priv.h
index ca1ce7f..9492a0b 100644
--- a/drivers/crypto/ipsec_mb/pmd_snow3g_priv.h
+++ b/drivers/crypto/ipsec_mb/pmd_snow3g_priv.h
@@ -65,14 +65,14 @@ 
 };
 
 /** SNOW 3G private session structure */
-struct snow3g_session {
+struct __rte_cache_aligned snow3g_session {
 	enum ipsec_mb_operation op;
 	enum rte_crypto_auth_operation auth_op;
 	snow3g_key_schedule_t pKeySched_cipher;
 	snow3g_key_schedule_t pKeySched_hash;
 	uint16_t cipher_iv_offset;
 	uint16_t auth_iv_offset;
-} __rte_cache_aligned;
+};
 
 struct snow3g_qp_data {
 	uint8_t temp_digest[SNOW3G_DIGEST_LENGTH];
diff --git a/drivers/crypto/ipsec_mb/pmd_zuc_priv.h b/drivers/crypto/ipsec_mb/pmd_zuc_priv.h
index 76fd675..a17a65a 100644
--- a/drivers/crypto/ipsec_mb/pmd_zuc_priv.h
+++ b/drivers/crypto/ipsec_mb/pmd_zuc_priv.h
@@ -64,14 +64,14 @@ 
 };
 
 /** ZUC private session structure */
-struct zuc_session {
+struct __rte_cache_aligned zuc_session {
 	enum ipsec_mb_operation op;
 	enum rte_crypto_auth_operation auth_op;
 	uint8_t pKey_cipher[ZUC_IV_KEY_LENGTH];
 	uint8_t pKey_hash[ZUC_IV_KEY_LENGTH];
 	uint16_t cipher_iv_offset;
 	uint16_t auth_iv_offset;
-} __rte_cache_aligned;
+};
 
 struct zuc_qp_data {