[25/83] net/nfp: move alignment attribute on types

Message ID 1710949096-5786-26-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/nfp/flower/nfp_flower_flow.c | 4 ++--
 drivers/net/nfp/nfp_ipsec.h              | 4 ++--
 drivers/net/nfp/nfp_rxtx.h               | 8 ++++----
 3 files changed, 8 insertions(+), 8 deletions(-)
  

Patch

diff --git a/drivers/net/nfp/flower/nfp_flower_flow.c b/drivers/net/nfp/flower/nfp_flower_flow.c
index 086cc80..26ee920 100644
--- a/drivers/net/nfp/flower/nfp_flower_flow.c
+++ b/drivers/net/nfp/flower/nfp_flower_flow.c
@@ -141,11 +141,11 @@  struct nfp_mask_id_entry {
 	uint8_t mask_id;
 };
 
-struct nfp_pre_tun_entry {
+struct __rte_aligned(32) nfp_pre_tun_entry {
 	uint16_t mac_index;
 	uint16_t ref_cnt;
 	struct rte_ether_addr mac_addr;
-} __rte_aligned(32);
+};
 
 static inline struct nfp_flow_priv *
 nfp_flow_dev_to_priv(struct rte_eth_dev *dev)
diff --git a/drivers/net/nfp/nfp_ipsec.h b/drivers/net/nfp/nfp_ipsec.h
index 8fdb7fd..29ca27d 100644
--- a/drivers/net/nfp/nfp_ipsec.h
+++ b/drivers/net/nfp/nfp_ipsec.h
@@ -142,7 +142,7 @@  struct nfp_ipsec_msg {
 	};
 };
 
-struct nfp_ipsec_session {
+struct __rte_cache_aligned nfp_ipsec_session {
 	/** Opaque user defined data */
 	void *user_data;
 	/** NFP sa_entries database parameter index */
@@ -155,7 +155,7 @@  struct nfp_ipsec_session {
 	struct rte_security_ipsec_xform ipsec;
 	/** Security session action type */
 	enum rte_security_session_action_type action;
-} __rte_cache_aligned;
+};
 
 struct nfp_net_ipsec_data {
 	int pkt_dynfield_offset;
diff --git a/drivers/net/nfp/nfp_rxtx.h b/drivers/net/nfp/nfp_rxtx.h
index 6ecabc2..344005e 100644
--- a/drivers/net/nfp/nfp_rxtx.h
+++ b/drivers/net/nfp/nfp_rxtx.h
@@ -27,7 +27,7 @@  struct nfp_tx_ipsec_desc_msg {
 	} esn;                  /**< Extended Sequence Number */
 };
 
-struct nfp_net_txq {
+struct __rte_aligned(64) nfp_net_txq {
 	/** Backpointer to nfp_net structure */
 	struct nfp_net_hw *hw;
 
@@ -77,7 +77,7 @@  struct nfp_net_txq {
 	 * in a cache line.
 	 */
 	uint64_t dma;
-} __rte_aligned(64);
+};
 
 /* RX and freelist descriptor format */
 #define PCIE_DESC_RX_DD                 (1 << 7)
@@ -129,7 +129,7 @@  struct nfp_net_rx_desc {
 	};
 };
 
-struct nfp_net_rxq {
+struct __rte_aligned(64) nfp_net_rxq {
 	/** Backpointer to nfp_net structure */
 	struct nfp_net_hw *hw;
 
@@ -197,7 +197,7 @@  struct nfp_net_rxq {
 
 	/** DMA address of the queue */
 	uint64_t dma;
-} __rte_aligned(64);
+};
 
 static inline void
 nfp_net_mbuf_alloc_failed(struct nfp_net_rxq *rxq)