[02/83] net/ark: move alignment attribute on types

Message ID 1710949096-5786-3-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:36 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/net/ark/ark_ethdev_rx.c | 6 +++---
 drivers/net/ark/ark_ethdev_tx.c | 6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)
  

Patch

diff --git a/drivers/net/ark/ark_ethdev_rx.c b/drivers/net/ark/ark_ethdev_rx.c
index 24f1c65..80e431f 100644
--- a/drivers/net/ark/ark_ethdev_rx.c
+++ b/drivers/net/ark/ark_ethdev_rx.c
@@ -28,7 +28,7 @@  static uint32_t eth_ark_rx_jumbo(struct ark_rx_queue *queue,
 static inline int eth_ark_rx_seed_mbufs(struct ark_rx_queue *queue);
 
 /* ************************************************************************* */
-struct ark_rx_queue {
+struct __rte_cache_aligned ark_rx_queue {
 	/* array of mbufs to populate */
 	struct rte_mbuf **reserve_q;
 	/* array of physical addresses of the mbuf data pointer */
@@ -60,10 +60,10 @@  struct ark_rx_queue {
 	uint32_t unused;
 
 	/* next cache line - fields written by device */
-	RTE_MARKER cacheline1 __rte_cache_min_aligned;
+	alignas(RTE_CACHE_LINE_MIN_SIZE) RTE_MARKER cacheline1;
 
 	volatile uint32_t prod_index;	/* step 2 filled by FPGA */
-} __rte_cache_aligned;
+};
 
 /* ************************************************************************* */
 static int
diff --git a/drivers/net/ark/ark_ethdev_tx.c b/drivers/net/ark/ark_ethdev_tx.c
index 4792754..9c89c85 100644
--- a/drivers/net/ark/ark_ethdev_tx.c
+++ b/drivers/net/ark/ark_ethdev_tx.c
@@ -21,7 +21,7 @@ 
 #endif
 
 /* ************************************************************************* */
-struct ark_tx_queue {
+struct __rte_cache_aligned ark_tx_queue {
 	union ark_tx_meta *meta_q;
 	struct rte_mbuf **bufs;
 
@@ -48,9 +48,9 @@  struct ark_tx_queue {
 	uint16_t queue_index;
 
 	/* next cache line - fields written by device */
-	RTE_MARKER cacheline1 __rte_cache_min_aligned;
+	alignas(RTE_CACHE_LINE_MIN_SIZE) RTE_MARKER cacheline1;
 	volatile int32_t cons_index;		/* hw is done, can be freed */
-} __rte_cache_aligned;
+};
 
 /* Forward declarations */
 static int eth_ark_tx_jumbo(struct ark_tx_queue *queue,