[PATCH v2 03/83] net/avp: move alignment attribute on types
Tyler Retzlaff
roretzla at linux.microsoft.com
Mon Apr 15 22:03:25 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/net/avp/avp_ethdev.c | 8 ++++----
drivers/net/avp/rte_avp_common.h | 4 ++--
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/net/avp/avp_ethdev.c b/drivers/net/avp/avp_ethdev.c
index 53d9e38..6733462 100644
--- a/drivers/net/avp/avp_ethdev.c
+++ b/drivers/net/avp/avp_ethdev.c
@@ -154,7 +154,7 @@ static int avp_dev_stats_get(struct rte_eth_dev *dev,
* Defines the AVP device attributes which are attached to an RTE ethernet
* device
*/
-struct avp_dev {
+struct __rte_cache_aligned avp_dev {
uint32_t magic; /**< Memory validation marker */
uint64_t device_id; /**< Unique system identifier */
struct rte_ether_addr ethaddr; /**< Host specified MAC address */
@@ -190,12 +190,12 @@ struct avp_dev {
void *sync_addr; /**< Req/Resp Mem address */
void *host_mbuf_addr; /**< (host) MBUF pool start address */
void *mbuf_addr; /**< MBUF pool start address */
-} __rte_cache_aligned;
+};
/* RTE ethernet private data */
-struct avp_adapter {
+struct __rte_cache_aligned avp_adapter {
struct avp_dev avp;
-} __rte_cache_aligned;
+};
/* 32-bit MMIO register write */
diff --git a/drivers/net/avp/rte_avp_common.h b/drivers/net/avp/rte_avp_common.h
index 908b31b..5ad71ac 100644
--- a/drivers/net/avp/rte_avp_common.h
+++ b/drivers/net/avp/rte_avp_common.h
@@ -100,7 +100,7 @@ struct rte_avp_fifo {
/*
* AVP packet buffer header used to define the exchange of packet data.
*/
-struct rte_avp_desc {
+struct __rte_cache_aligned rte_avp_desc {
uint64_t pad0;
void *pkt_mbuf; /**< Reference to packet mbuf */
uint8_t pad1[14];
@@ -114,7 +114,7 @@ struct rte_avp_desc {
uint32_t pad3;
uint16_t vlan_tci; /**< VLAN Tag Control Identifier (CPU order). */
uint32_t pad4;
-} __rte_packed __rte_cache_aligned;
+} __rte_packed;
/**{ AVP device features */
--
1.8.3.1
More information about the dev
mailing list