[v2,16/21] net/iavf: use C11 alignof
Checks
Commit Message
Replace use of __alignof__(T) with C11 alignof(T) to improve portability
between toolchains.
Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
---
drivers/net/iavf/iavf_ethdev.c | 3 ++-
drivers/net/iavf/iavf_ipsec_crypto.c | 4 +++-
drivers/net/iavf/iavf_testpmd.c | 3 ++-
3 files changed, 7 insertions(+), 3 deletions(-)
@@ -4,6 +4,7 @@
#include <ctype.h>
#include <sys/queue.h>
+#include <stdalign.h>
#include <stdio.h>
#include <errno.h>
#include <stdint.h>
@@ -55,7 +56,7 @@
static const struct rte_mbuf_dynfield iavf_proto_xtr_metadata_param = {
.name = "intel_pmd_dynfield_proto_xtr_metadata",
.size = sizeof(uint32_t),
- .align = __alignof__(uint32_t),
+ .align = alignof(uint32_t),
.flags = 0,
};
@@ -2,6 +2,8 @@
* Copyright(c) 2020 Intel Corporation
*/
+#include <stdalign.h>
+
#include <rte_cryptodev.h>
#include <rte_ethdev.h>
#include <rte_security_driver.h>
@@ -1535,7 +1537,7 @@ enum rte_crypto_aead_algorithm aead_maptbl[] = {
struct rte_mbuf_dynfield pkt_md_dynfield = {
.name = "iavf_ipsec_crypto_pkt_metadata",
.size = sizeof(struct iavf_ipsec_crypto_pkt_metadata),
- .align = __alignof__(struct iavf_ipsec_crypto_pkt_metadata)
+ .align = alignof(struct iavf_ipsec_crypto_pkt_metadata)
};
struct virtchnl_ipsec_cap capabilities;
int rc;
@@ -2,6 +2,7 @@
* Copyright(c) 2010-2016 Intel Corporation.
*/
+#include <stdalign.h>
#include <stdlib.h>
#include <rte_pmd_iavf.h>
@@ -41,7 +42,7 @@ struct cmd_enable_tx_lldp_result {
const struct rte_mbuf_dynfield iavf_tx_lldp_dynfield = {
.name = IAVF_TX_LLDP_DYNFIELD,
.size = sizeof(uint8_t),
- .align = __alignof__(uint8_t),
+ .align = alignof(uint8_t),
.flags = 0
};
int offset;