[PATCH v2 37/83] raw/ntb: move alignment attribute on types

Tyler Retzlaff roretzla at linux.microsoft.com
Mon Apr 15 22:03:59 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/raw/ntb/ntb.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/raw/ntb/ntb.h b/drivers/raw/ntb/ntb.h
index a30a6b6..563cedd 100644
--- a/drivers/raw/ntb/ntb.h
+++ b/drivers/raw/ntb/ntb.h
@@ -186,9 +186,9 @@ struct ntb_tx_queue {
 };
 
 struct ntb_header {
-	uint16_t avail_cnt __rte_cache_aligned;
-	uint16_t used_cnt __rte_cache_aligned;
-	struct ntb_desc desc_ring[] __rte_cache_aligned;
+	alignas(RTE_CACHE_LINE_SIZE) uint16_t avail_cnt;
+	alignas(RTE_CACHE_LINE_SIZE) uint16_t used_cnt;
+	alignas(RTE_CACHE_LINE_SIZE) struct ntb_desc desc_ring[];
 };
 
 /* ntb private data. */
-- 
1.8.3.1



More information about the dev mailing list