[PATCH v2 39/83] mempool/cnxk: move alignment attribute on types

Tyler Retzlaff roretzla at linux.microsoft.com
Mon Apr 15 22:04:01 CEST 2024


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 at linux.microsoft.com>
Acked-by: Morten Brørup <mb at smartsharesystems.com>
---
 drivers/mempool/cnxk/cn10k_mempool_ops.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mempool/cnxk/cn10k_mempool_ops.c b/drivers/mempool/cnxk/cn10k_mempool_ops.c
index 2a5aad0..a5be0cc 100644
--- a/drivers/mempool/cnxk/cn10k_mempool_ops.c
+++ b/drivers/mempool/cnxk/cn10k_mempool_ops.c
@@ -21,13 +21,13 @@ enum batch_op_status {
 struct batch_op_mem {
 	unsigned int sz;
 	enum batch_op_status status;
-	uint64_t objs[BATCH_ALLOC_SZ] __rte_aligned(ROC_ALIGN);
+	alignas(ROC_ALIGN) uint64_t objs[BATCH_ALLOC_SZ];
 };
 
 struct batch_op_data {
 	uint64_t lmt_addr;
 	uint32_t max_async_batch;
-	struct batch_op_mem mem[RTE_MAX_LCORE] __rte_aligned(ROC_ALIGN);
+	alignas(ROC_ALIGN) struct batch_op_mem mem[RTE_MAX_LCORE];
 };
 
 static struct batch_op_data **batch_op_data_tbl;
-- 
1.8.3.1



More information about the dev mailing list