[v2,10/14] ethdev: use C11 alignas
Checks
Commit Message
* Move __rte_aligned from the end of {struct,union} definitions to
be between {struct,union} and tag.
The placement between {struct,union} and the tag allows the desired
alignment to be imparted on the type regardless of the toolchain being
used for all of GCC, LLVM, MSVC compilers building both C and C++.
* Replace use of __rte_aligned(a) on variables/fields with alignas(a).
Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
---
lib/ethdev/rte_ethdev.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
@@ -333,12 +333,12 @@ struct rte_eth_stats {
* A structure used to retrieve link-level information of an Ethernet port.
*/
__extension__
-struct rte_eth_link {
+struct __rte_aligned(8) rte_eth_link {
uint32_t link_speed; /**< RTE_ETH_SPEED_NUM_ */
uint16_t link_duplex : 1; /**< RTE_ETH_LINK_[HALF/FULL]_DUPLEX */
uint16_t link_autoneg : 1; /**< RTE_ETH_LINK_[AUTONEG/FIXED] */
uint16_t link_status : 1; /**< RTE_ETH_LINK_[DOWN/UP] */
-} __rte_aligned(8); /**< aligned for atomic64 read/write */
+}; /**< aligned for atomic64 read/write */
/**@{@name Link negotiation
* Constants used in link management.