[27/83] net/octeontx: move alignment attribute on types

Message ID 1710949096-5786-28-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/net/octeontx/octeontx_ethdev.c |  4 ++--
 drivers/net/octeontx/octeontx_ethdev.h | 12 ++++++------
 drivers/net/octeontx/octeontx_rxtx.h   |  2 +-
 3 files changed, 9 insertions(+), 9 deletions(-)
  

Patch

diff --git a/drivers/net/octeontx/octeontx_ethdev.c b/drivers/net/octeontx/octeontx_ethdev.c
index bec54fd..e397136 100644
--- a/drivers/net/octeontx/octeontx_ethdev.c
+++ b/drivers/net/octeontx/octeontx_ethdev.c
@@ -36,9 +36,9 @@ 
 #define OCTEONTX_QLM_MODE_SGMII  7
 #define OCTEONTX_QLM_MODE_XFI   12
 
-struct evdev_priv_data {
+struct __rte_cache_aligned evdev_priv_data {
 	OFFLOAD_FLAGS; /*Sequence should not be changed */
-} __rte_cache_aligned;
+};
 
 struct octeontx_vdev_init_params {
 	uint8_t	nr_port;
diff --git a/drivers/net/octeontx/octeontx_ethdev.h b/drivers/net/octeontx/octeontx_ethdev.h
index 7e04fad..efd6cf5 100644
--- a/drivers/net/octeontx/octeontx_ethdev.h
+++ b/drivers/net/octeontx/octeontx_ethdev.h
@@ -105,7 +105,7 @@  struct octeontx_fc_info {
 };
 
 /* Octeontx ethdev nic */
-struct octeontx_nic {
+struct __rte_cache_aligned octeontx_nic {
 	struct rte_eth_dev *dev;
 	int node;
 	int port_id;
@@ -145,15 +145,15 @@  struct octeontx_nic {
 	int print_flag;
 	struct octeontx_fc_info fc;
 	bool reconfigure;
-} __rte_cache_aligned;
+};
 
-struct octeontx_txq {
+struct __rte_cache_aligned octeontx_txq {
 	uint16_t queue_id;
 	octeontx_dq_t dq;
 	struct rte_eth_dev *eth_dev;
-} __rte_cache_aligned;
+};
 
-struct octeontx_rxq {
+struct __rte_cache_aligned octeontx_rxq {
 	uint16_t queue_id;
 	uint16_t port_id;
 	uint8_t evdev;
@@ -161,7 +161,7 @@  struct octeontx_rxq {
 	uint16_t ev_queues;
 	uint16_t ev_ports;
 	struct rte_mempool *pool;
-} __rte_cache_aligned;
+};
 
 void
 octeontx_set_tx_function(struct rte_eth_dev *dev);
diff --git a/drivers/net/octeontx/octeontx_rxtx.h b/drivers/net/octeontx/octeontx_rxtx.h
index b6e3515..cd581f5 100644
--- a/drivers/net/octeontx/octeontx_rxtx.h
+++ b/drivers/net/octeontx/octeontx_rxtx.h
@@ -71,7 +71,7 @@  struct octeontx_send_hdr_s {
 	union octeontx_send_hdr_w1_u w1;
 };
 
-static const uint32_t __rte_cache_aligned
+static const alignas(RTE_CACHE_LINE_SIZE) uint32_t
 ptype_table[PTYPE_SIZE][PTYPE_SIZE][PTYPE_SIZE] = {
 	[LC_NONE][LE_NONE][LF_NONE] = RTE_PTYPE_UNKNOWN,
 	[LC_NONE][LE_NONE][LF_IPSEC_ESP] = RTE_PTYPE_UNKNOWN,