DPDK patches and discussions
 help / color / mirror / Atom feed
From: Thomas Monjalon <thomas@monjalon.net>
To: dev@dpdk.org
Cc: Hemant Agrawal <hemant.agrawal@nxp.com>,
	Sachin Saxena <sachin.saxena@nxp.com>,
	Gagandeep Singh <g.singh@nxp.com>,
	John Griffin <john.griffin@intel.com>,
	Fiona Trahe <fiona.trahe@intel.com>,
	Deepak Kumar Jain <deepak.k.jain@intel.com>,
	Steven Webster <steven.webster@windriver.com>,
	Matt Peters <matt.peters@windriver.com>,
	Chas Williams <chas3@att.com>,
	"Wei Hu (Xavier)" <xavier.huwei@huawei.com>,
	"Min Hu (Connor)" <humin29@huawei.com>,
	Yisen Zhuang <yisen.zhuang@huawei.com>,
	Matan Azrad <matan@mellanox.com>,
	Shahaf Shuler <shahafs@mellanox.com>,
	Viacheslav Ovsiienko <viacheslavo@mellanox.com>,
	Heinrich Kuhn <heinrich.kuhn@netronome.com>,
	Jan Gutter <jan.gutter@netronome.com>,
	Keith Wiles <keith.wiles@intel.com>,
	Maxime Coquelin <maxime.coquelin@redhat.com>,
	Tiwei Bie <tiwei.bie@intel.com>,
	Zhihong Wang <zhihong.wang@intel.com>,
	Anatoly Burakov <anatoly.burakov@intel.com>,
	Konstantin Ananyev <konstantin.ananyev@intel.com>,
	Jerin Jacob <jerinj@marvell.com>,	Gavin Hu <gavin.hu@arm.com>,
	Jan Viktorin <viktorin@rehivetech.com>,
	David Christensen <drc@linux.vnet.ibm.com>,
	Ferruh Yigit <ferruh.yigit@intel.com>,
	Andrew Rybchenko <arybchenko@solarflare.com>,
	Yipeng Wang <yipeng1.wang@intel.com>,
	Sameh Gobriel <sameh.gobriel@intel.com>,
	Bruce Richardson <bruce.richardson@intel.com>,
	Olivier Matz <olivier.matz@6wind.com>,
	Cristian Dumitrescu <cristian.dumitrescu@intel.com>,
	Jasvinder Singh <jasvinder.singh@intel.com>
Subject: [dpdk-dev] [PATCH 20.05 05/15] replace alignment attributes
Date: Mon, 10 Feb 2020 17:20:22 +0100	[thread overview]
Message-ID: <20200210162032.1177478-6-thomas@monjalon.net> (raw)
In-Reply-To: <20200210162032.1177478-1-thomas@monjalon.net>

There is a common macro __rte_aligned for alignment,
which is now used where appropriate for consistency.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
 drivers/bus/dpaa/base/qbman/qman.c               |  2 +-
 drivers/bus/dpaa/include/fsl_bman.h              |  2 +-
 drivers/bus/dpaa/include/fsl_qman.h              |  2 +-
 drivers/common/dpaax/compat.h                    |  2 +-
 drivers/crypto/caam_jr/caam_jr_desc.h            |  4 ++--
 drivers/crypto/qat/qat_asym.h                    |  2 +-
 drivers/net/avp/rte_avp_common.h                 |  2 +-
 drivers/net/bonding/rte_eth_bond_8023ad.h        | 14 +++++++-------
 drivers/net/hns3/hns3_fdir.c                     |  4 ++--
 drivers/net/mlx5/mlx5_rxtx_vec_altivec.h         | 16 ++++++++--------
 drivers/net/nfp/nfp_net_pmd.h                    |  4 ++--
 drivers/net/tap/tap_bpf.h                        |  2 +-
 drivers/net/virtio/virtqueue.h                   |  2 +-
 examples/multi_process/symmetric_mp/main.c       |  2 +-
 lib/librte_acl/acl_run.h                         |  2 +-
 lib/librte_acl/acl_run_altivec.h                 |  2 +-
 lib/librte_acl/acl_run_neon.h                    |  2 +-
 .../common/include/arch/arm/rte_vect.h           |  2 +-
 .../common/include/arch/ppc_64/rte_vect.h        |  2 +-
 lib/librte_eal/common/include/rte_common.h       |  6 +++---
 lib/librte_ethdev/rte_ethdev.h                   |  2 +-
 lib/librte_hash/rte_thash.h                      |  2 +-
 lib/librte_net/rte_arp.h                         |  4 ++--
 lib/librte_net/rte_ether.h                       |  4 ++--
 lib/librte_pipeline/rte_table_action.c           | 12 ++++++------
 lib/librte_sched/rte_sched_common.h              |  2 +-
 26 files changed, 51 insertions(+), 51 deletions(-)

diff --git a/drivers/bus/dpaa/base/qbman/qman.c b/drivers/bus/dpaa/base/qbman/qman.c
index b53eb9e5ee..b596e79c2f 100644
--- a/drivers/bus/dpaa/base/qbman/qman.c
+++ b/drivers/bus/dpaa/base/qbman/qman.c
@@ -94,7 +94,7 @@ struct qman_portal {
 	 * address (6 bits for address shift + 4 bits for the DQRR size).
 	 */
 	struct qm_dqrr_entry shadow_dqrr[QM_DQRR_SIZE]
-		    __attribute__((aligned(1024)));
+		    __rte_aligned(1024);
 #endif
 };
 
diff --git a/drivers/bus/dpaa/include/fsl_bman.h b/drivers/bus/dpaa/include/fsl_bman.h
index 0c74aba449..f9cd972153 100644
--- a/drivers/bus/dpaa/include/fsl_bman.h
+++ b/drivers/bus/dpaa/include/fsl_bman.h
@@ -65,7 +65,7 @@ struct bm_buffer {
 		};
 		u64 opaque;
 	};
-} __attribute__((aligned(8)));
+} __rte_aligned(8);
 static inline u64 bm_buffer_get64(const struct bm_buffer *buf)
 {
 	return buf->addr;
diff --git a/drivers/bus/dpaa/include/fsl_qman.h b/drivers/bus/dpaa/include/fsl_qman.h
index 4deea5e75e..1b3342e7e6 100644
--- a/drivers/bus/dpaa/include/fsl_qman.h
+++ b/drivers/bus/dpaa/include/fsl_qman.h
@@ -193,7 +193,7 @@ struct qm_fd {
 		u32 cmd;
 		u32 status;
 	};
-} __attribute__((aligned(8)));
+} __rte_aligned(8);
 #define QM_FD_DD_NULL		0x00
 #define QM_FD_PID_MASK		0x3f
 static inline u64 qm_fd_addr_get64(const struct qm_fd *fd)
diff --git a/drivers/common/dpaax/compat.h b/drivers/common/dpaax/compat.h
index 12c9d99179..5b11c2d927 100644
--- a/drivers/common/dpaax/compat.h
+++ b/drivers/common/dpaax/compat.h
@@ -63,7 +63,7 @@
 #define noinline	__attribute__((noinline))
 #endif
 #define L1_CACHE_BYTES 64
-#define ____cacheline_aligned __attribute__((aligned(L1_CACHE_BYTES)))
+#define ____cacheline_aligned __rte_aligned(L1_CACHE_BYTES)
 #define __stringify_1(x) #x
 #define __stringify(x)	__stringify_1(x)
 
diff --git a/drivers/crypto/caam_jr/caam_jr_desc.h b/drivers/crypto/caam_jr/caam_jr_desc.h
index 6683ea8350..64e0c00bc8 100644
--- a/drivers/crypto/caam_jr/caam_jr_desc.h
+++ b/drivers/crypto/caam_jr/caam_jr_desc.h
@@ -263,7 +263,7 @@ struct load_command_s {
  */
 struct sec_sd_t {
 	uint32_t rsvd[MAX_DESC_SIZE_WORDS];
-} __attribute__((packed, aligned(64)));
+} __attribute__((packed) __rte_aligned(64);
 
 /* Structure encompassing a job descriptor which processes
  * a single packet from a context. The job descriptor references
@@ -280,6 +280,6 @@ struct sec_job_descriptor_t {
 	uint32_t in_ext_length;
 	struct load_command_s load_dpovrd;
 	uint32_t dpovrd;
-} __attribute__((packed, aligned(64)));
+} __attribute__((packed) __rte_aligned(64);
 
 #endif
diff --git a/drivers/crypto/qat/qat_asym.h b/drivers/crypto/qat/qat_asym.h
index 551edc3034..2838aee76f 100644
--- a/drivers/crypto/qat/qat_asym.h
+++ b/drivers/crypto/qat/qat_asym.h
@@ -15,7 +15,7 @@
 typedef uint64_t large_int_ptr;
 #define MAX_PKE_PARAMS	8
 #define QAT_PKE_MAX_LN_SIZE 512
-#define _PKE_ALIGN_ __attribute__((__aligned__(8)))
+#define _PKE_ALIGN_ __rte_aligned(8)
 
 #define QAT_ASYM_MAX_PARAMS			8
 #define QAT_ASYM_MODINV_NUM_IN_PARAMS		2
diff --git a/drivers/net/avp/rte_avp_common.h b/drivers/net/avp/rte_avp_common.h
index 478c01a169..ab7d175083 100644
--- a/drivers/net/avp/rte_avp_common.h
+++ b/drivers/net/avp/rte_avp_common.h
@@ -116,7 +116,7 @@ struct rte_avp_desc {
 	uint32_t pad3;
 	uint16_t vlan_tci; /**< VLAN Tag Control Identifier (CPU order). */
 	uint32_t pad4;
-} __attribute__ ((__aligned__(RTE_CACHE_LINE_SIZE), __packed__));
+} __attribute__ ((__packed__)) __rte_cache_aligned;
 
 
 /**{ AVP device features */
diff --git a/drivers/net/bonding/rte_eth_bond_8023ad.h b/drivers/net/bonding/rte_eth_bond_8023ad.h
index 62265f449f..0b5d0a4351 100644
--- a/drivers/net/bonding/rte_eth_bond_8023ad.h
+++ b/drivers/net/bonding/rte_eth_bond_8023ad.h
@@ -60,7 +60,7 @@ struct slow_protocol {
 struct slow_protocol_frame {
 	struct rte_ether_hdr eth_hdr;
 	struct slow_protocol slow_protocol;
-} __attribute__((__packed__)) __attribute__((aligned(2)));
+} __attribute__((__packed__)) __rte_aligned(2);
 
 struct port_params {
 	uint16_t system_priority;
@@ -73,7 +73,7 @@ struct port_params {
 	/**< Priority of this (unused in current implementation) */
 	uint16_t port_number;
 	/**< Port number. It corresponds to slave port id. */
-} __attribute__((__packed__)) __attribute__((aligned(2)));
+} __attribute__((__packed__)) __rte_aligned(2);
 
 struct lacpdu_actor_partner_params {
 	uint8_t tlv_type_info;
@@ -81,7 +81,7 @@ struct lacpdu_actor_partner_params {
 	struct port_params port_params;
 	uint8_t state;
 	uint8_t reserved_3[3];
-} __attribute__((__packed__)) __attribute__((aligned(2)));
+} __attribute__((__packed__)) __rte_aligned(2);
 
 /** LACPDU structure (5.4.2 in 802.1AX documentation). */
 struct lacpdu {
@@ -99,13 +99,13 @@ struct lacpdu {
 	uint8_t tlv_type_terminator;
 	uint8_t terminator_length;
 	uint8_t reserved_50[50];
-} __attribute__((__packed__)) __attribute__((aligned(2)));
+} __attribute__((__packed__)) __rte_aligned(2);
 
 /** LACPDU frame: Contains ethernet header and LACPDU. */
 struct lacpdu_header {
 	struct rte_ether_hdr eth_hdr;
 	struct lacpdu lacpdu;
-} __attribute__((__packed__)) __attribute__((aligned(2)));
+} __attribute__((__packed__)) __rte_aligned(2);
 
 struct marker {
 	uint8_t subtype;
@@ -121,12 +121,12 @@ struct marker {
 	uint8_t tlv_type_terminator;
 	uint8_t terminator_length;
 	uint8_t reserved_90[90];
-} __attribute__((__packed__)) __attribute__((aligned(2)));
+} __attribute__((__packed__)) __rte_aligned(2);
 
 struct marker_header {
 	struct rte_ether_hdr eth_hdr;
 	struct marker marker;
-} __attribute__((__packed__)) __attribute__((aligned(2)));
+} __attribute__((__packed__)) __rte_aligned(2);
 
 struct rte_eth_bond_8023ad_conf {
 	uint32_t fast_periodic_ms;
diff --git a/drivers/net/hns3/hns3_fdir.c b/drivers/net/hns3/hns3_fdir.c
index ca3c78e1ce..a395eb1f83 100644
--- a/drivers/net/hns3/hns3_fdir.c
+++ b/drivers/net/hns3/hns3_fdir.c
@@ -686,8 +686,8 @@ static int hns3_config_key(struct hns3_adapter *hns,
 	struct hns3_fd_key_cfg *key_cfg;
 	uint8_t *cur_key_x;
 	uint8_t *cur_key_y;
-	uint8_t key_x[MAX_KEY_BYTES] __attribute__((aligned(4)));
-	uint8_t key_y[MAX_KEY_BYTES] __attribute__((aligned(4)));
+	uint8_t key_x[MAX_KEY_BYTES] __rte_aligned(4);
+	uint8_t key_y[MAX_KEY_BYTES] __rte_aligned(4);
 	uint8_t vf_id = rule->vf_id;
 	uint8_t meta_data_region;
 	uint8_t tuple_size;
diff --git a/drivers/net/mlx5/mlx5_rxtx_vec_altivec.h b/drivers/net/mlx5/mlx5_rxtx_vec_altivec.h
index aa43cab084..8e8d59ae83 100644
--- a/drivers/net/mlx5/mlx5_rxtx_vec_altivec.h
+++ b/drivers/net/mlx5/mlx5_rxtx_vec_altivec.h
@@ -732,13 +732,13 @@ rxq_burst_v(struct mlx5_rxq_data *rxq, struct rte_mbuf **pkts, uint16_t pkts_n,
 		/* A.1 load cqes. */
 		p3 = (unsigned int)((vector unsigned short)p)[3];
 		cqes[3] = (vector unsigned char)(vector unsigned long){
-			*(__attribute__((__aligned__(8))) unsigned long *)
+			*(__rte_aligned(8) unsigned long *)
 			&cq[pos + p3].sop_drop_qpn, 0LL};
 		rte_compiler_barrier();
 
 		p2 = (unsigned int)((vector unsigned short)p)[2];
 		cqes[2] = (vector unsigned char)(vector unsigned long){
-			*(__attribute__((__aligned__(8))) unsigned long *)
+			*(__rte_aligned(8) unsigned long *)
 			&cq[pos + p2].sop_drop_qpn, 0LL};
 		rte_compiler_barrier();
 
@@ -751,12 +751,12 @@ rxq_burst_v(struct mlx5_rxq_data *rxq, struct rte_mbuf **pkts, uint16_t pkts_n,
 		/* A.1 load a block having op_own. */
 		p1 = (unsigned int)((vector unsigned short)p)[1];
 		cqes[1] = (vector unsigned char)(vector unsigned long){
-			*(__attribute__((__aligned__(8))) unsigned long *)
+			*(__rte_aligned(8) unsigned long *)
 			&cq[pos + p1].sop_drop_qpn, 0LL};
 		rte_compiler_barrier();
 
 		cqes[0] = (vector unsigned char)(vector unsigned long){
-			*(__attribute__((__aligned__(8))) unsigned long *)
+			*(__rte_aligned(8) unsigned long *)
 			&cq[pos].sop_drop_qpn, 0LL};
 		rte_compiler_barrier();
 
@@ -783,10 +783,10 @@ rxq_burst_v(struct mlx5_rxq_data *rxq, struct rte_mbuf **pkts, uint16_t pkts_n,
 			vec_sel((vector unsigned short)cqes[2],
 			(vector unsigned short)cqe_tmp1, cqe_sel_mask1);
 		cqe_tmp2 = (vector unsigned char)(vector unsigned long){
-			*(__attribute__((__aligned__(8))) unsigned long *)
+			*(__rte_aligned(8) unsigned long *)
 			&cq[pos + p3].rsvd3[9], 0LL};
 		cqe_tmp1 = (vector unsigned char)(vector unsigned long){
-			*(__attribute__((__aligned__(8))) unsigned long *)
+			*(__rte_aligned(8) unsigned long *)
 			&cq[pos + p2].rsvd3[9], 0LL};
 		cqes[3] = (vector unsigned char)
 			vec_sel((vector unsigned short)cqes[3],
@@ -846,10 +846,10 @@ rxq_burst_v(struct mlx5_rxq_data *rxq, struct rte_mbuf **pkts, uint16_t pkts_n,
 			vec_sel((vector unsigned short)cqes[0],
 			(vector unsigned short)cqe_tmp1, cqe_sel_mask1);
 		cqe_tmp2 = (vector unsigned char)(vector unsigned long){
-			*(__attribute__((__aligned__(8))) unsigned long *)
+			*(__rte_aligned(8) unsigned long *)
 			&cq[pos + p1].rsvd3[9], 0LL};
 		cqe_tmp1 = (vector unsigned char)(vector unsigned long){
-			*(__attribute__((__aligned__(8))) unsigned long *)
+			*(__rte_aligned(8) unsigned long *)
 			&cq[pos].rsvd3[9], 0LL};
 		cqes[1] = (vector unsigned char)
 			vec_sel((vector unsigned short)cqes[1],
diff --git a/drivers/net/nfp/nfp_net_pmd.h b/drivers/net/nfp/nfp_net_pmd.h
index cc1055c49a..f0142e1ff7 100644
--- a/drivers/net/nfp/nfp_net_pmd.h
+++ b/drivers/net/nfp/nfp_net_pmd.h
@@ -243,7 +243,7 @@ struct nfp_net_txq {
 	int qidx;
 	int tx_qcidx;
 	__le64 dma;
-} __attribute__ ((__aligned__(64)));
+} __rte_aligned(64);
 
 /* RX and freelist descriptor format */
 #define PCIE_DESC_RX_DD                 (1 << 7)
@@ -374,7 +374,7 @@ struct nfp_net_rxq {
 	int qidx;
 	int fl_qcidx;
 	int rx_qcidx;
-} __attribute__ ((__aligned__(64)));
+} __rte_aligned(64);
 
 struct nfp_net_hw {
 	/* Info from the firmware */
diff --git a/drivers/net/tap/tap_bpf.h b/drivers/net/tap/tap_bpf.h
index 9192686a6a..f0b9fc7a2c 100644
--- a/drivers/net/tap/tap_bpf.h
+++ b/drivers/net/tap/tap_bpf.h
@@ -84,7 +84,7 @@ union bpf_attr {
 		__u32		kern_version;
 		__u32		prog_flags;
 	};
-} __attribute__((aligned(8)));
+} __rte_aligned(8);
 
 #ifndef __NR_bpf
 # if defined(__i386__)
diff --git a/drivers/net/virtio/virtqueue.h b/drivers/net/virtio/virtqueue.h
index 58ad7309ae..d8cf5d4e2f 100644
--- a/drivers/net/virtio/virtqueue.h
+++ b/drivers/net/virtio/virtqueue.h
@@ -325,7 +325,7 @@ struct virtio_net_hdr_mrg_rxbuf {
 struct virtio_tx_region {
 	struct virtio_net_hdr_mrg_rxbuf tx_hdr;
 	struct vring_desc tx_indir[VIRTIO_MAX_TX_INDIRECT]
-		__attribute__((__aligned__(16)));
+		__rte_aligned(16);
 };
 
 static inline int
diff --git a/examples/multi_process/symmetric_mp/main.c b/examples/multi_process/symmetric_mp/main.c
index 7f491452a7..522f211c0f 100644
--- a/examples/multi_process/symmetric_mp/main.c
+++ b/examples/multi_process/symmetric_mp/main.c
@@ -66,7 +66,7 @@ struct port_stats{
 	unsigned rx;
 	unsigned tx;
 	unsigned drop;
-} __attribute__((aligned(RTE_CACHE_LINE_SIZE / 2)));
+} __rte_aligned(RTE_CACHE_LINE_SIZE / 2);
 
 static int proc_id = -1;
 static unsigned num_procs = 0;
diff --git a/lib/librte_acl/acl_run.h b/lib/librte_acl/acl_run.h
index bf7842d879..7d215de9d6 100644
--- a/lib/librte_acl/acl_run.h
+++ b/lib/librte_acl/acl_run.h
@@ -60,7 +60,7 @@ struct completion {
 	int32_t   priority[RTE_ACL_MAX_CATEGORIES]; /* running priorities. */
 	uint32_t  count;                            /* num of remaining tries */
 	/* true for allocated struct */
-} __attribute__((aligned(XMM_SIZE)));
+} __rte_aligned(XMM_SIZE);
 
 /*
  * One parms structure for each slot in the search engine.
diff --git a/lib/librte_acl/acl_run_altivec.h b/lib/librte_acl/acl_run_altivec.h
index b57f08ac92..2de6f27b1f 100644
--- a/lib/librte_acl/acl_run_altivec.h
+++ b/lib/librte_acl/acl_run_altivec.h
@@ -11,7 +11,7 @@ struct _altivec_acl_const {
 	rte_xmm_t xmm_index_mask;
 	rte_xmm_t xmm_ones_16;
 	rte_xmm_t range_base;
-} altivec_acl_const  __attribute__((aligned(RTE_CACHE_LINE_SIZE))) = {
+} altivec_acl_const __rte_cache_aligned = {
 	{
 		.u32 = {0x00000000, 0x04040404, 0x08080808, 0x0c0c0c0c}
 	},
diff --git a/lib/librte_acl/acl_run_neon.h b/lib/librte_acl/acl_run_neon.h
index b3196cd120..69d1b6d9e1 100644
--- a/lib/librte_acl/acl_run_neon.h
+++ b/lib/librte_acl/acl_run_neon.h
@@ -9,7 +9,7 @@ struct _neon_acl_const {
 	rte_xmm_t xmm_shuffle_input;
 	rte_xmm_t xmm_index_mask;
 	rte_xmm_t range_base;
-} neon_acl_const  __attribute__((aligned(RTE_CACHE_LINE_SIZE))) = {
+} neon_acl_const __rte_cache_aligned = {
 	{
 		.u32 = {0x00000000, 0x04040404, 0x08080808, 0x0c0c0c0c}
 	},
diff --git a/lib/librte_eal/common/include/arch/arm/rte_vect.h b/lib/librte_eal/common/include/arch/arm/rte_vect.h
index 2a18a68546..2696caaf6d 100644
--- a/lib/librte_eal/common/include/arch/arm/rte_vect.h
+++ b/lib/librte_eal/common/include/arch/arm/rte_vect.h
@@ -26,7 +26,7 @@ typedef union rte_xmm {
 	uint32_t u32[XMM_SIZE / sizeof(uint32_t)];
 	uint64_t u64[XMM_SIZE / sizeof(uint64_t)];
 	double   pd[XMM_SIZE / sizeof(double)];
-} __attribute__((aligned(16))) rte_xmm_t;
+} __rte_aligned(16) rte_xmm_t;
 
 #ifdef RTE_ARCH_ARM
 /* NEON intrinsic vqtbl1q_u8() is not supported in ARMv7-A(AArch32) */
diff --git a/lib/librte_eal/common/include/arch/ppc_64/rte_vect.h b/lib/librte_eal/common/include/arch/ppc_64/rte_vect.h
index 068c805b22..a0dabf02eb 100644
--- a/lib/librte_eal/common/include/arch/ppc_64/rte_vect.h
+++ b/lib/librte_eal/common/include/arch/ppc_64/rte_vect.h
@@ -25,7 +25,7 @@ typedef union rte_xmm {
 	uint32_t u32[XMM_SIZE / sizeof(uint32_t)];
 	uint64_t u64[XMM_SIZE / sizeof(uint64_t)];
 	double   pd[XMM_SIZE / sizeof(double)];
-} __attribute__((aligned(16))) rte_xmm_t;
+} __rte_aligned(16) rte_xmm_t;
 
 #ifdef __cplusplus
 }
diff --git a/lib/librte_eal/common/include/rte_common.h b/lib/librte_eal/common/include/rte_common.h
index 4b5f3a31f0..1677a0147a 100644
--- a/lib/librte_eal/common/include/rte_common.h
+++ b/lib/librte_eal/common/include/rte_common.h
@@ -49,9 +49,9 @@ extern "C" {
 #endif
 
 #ifdef RTE_ARCH_STRICT_ALIGN
-typedef uint64_t unaligned_uint64_t __attribute__ ((aligned(1)));
-typedef uint32_t unaligned_uint32_t __attribute__ ((aligned(1)));
-typedef uint16_t unaligned_uint16_t __attribute__ ((aligned(1)));
+typedef uint64_t unaligned_uint64_t __rte_aligned(1);
+typedef uint32_t unaligned_uint32_t __rte_aligned(1);
+typedef uint16_t unaligned_uint16_t __rte_aligned(1);
 #else
 typedef uint64_t unaligned_uint64_t;
 typedef uint32_t unaligned_uint32_t;
diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index d1a593ad11..e9e3a16995 100644
--- a/lib/librte_ethdev/rte_ethdev.h
+++ b/lib/librte_ethdev/rte_ethdev.h
@@ -310,7 +310,7 @@ struct rte_eth_link {
 	uint16_t link_duplex  : 1;  /**< ETH_LINK_[HALF/FULL]_DUPLEX */
 	uint16_t link_autoneg : 1;  /**< ETH_LINK_[AUTONEG/FIXED] */
 	uint16_t link_status  : 1;  /**< ETH_LINK_[DOWN/UP] */
-} __attribute__((aligned(8)));      /**< aligned for atomic64 read/write */
+} __rte_aligned(8);      /**< aligned for atomic64 read/write */
 
 /* Utility constants */
 #define ETH_LINK_HALF_DUPLEX 0 /**< Half-duplex connection (see link_duplex). */
diff --git a/lib/librte_hash/rte_thash.h b/lib/librte_hash/rte_thash.h
index b4aaabe3d8..51b5129468 100644
--- a/lib/librte_hash/rte_thash.h
+++ b/lib/librte_hash/rte_thash.h
@@ -107,7 +107,7 @@ union rte_thash_tuple {
 	struct rte_ipv4_tuple	v4;
 	struct rte_ipv6_tuple	v6;
 #ifdef RTE_ARCH_X86
-} __attribute__((aligned(XMM_SIZE)));
+} __rte_aligned(XMM_SIZE);
 #else
 };
 #endif
diff --git a/lib/librte_net/rte_arp.h b/lib/librte_net/rte_arp.h
index fabd686243..79a764fc85 100644
--- a/lib/librte_net/rte_arp.h
+++ b/lib/librte_net/rte_arp.h
@@ -26,7 +26,7 @@ struct rte_arp_ipv4 {
 	uint32_t          arp_sip;  /**< sender IP address */
 	struct rte_ether_addr arp_tha;  /**< target hardware address */
 	uint32_t          arp_tip;  /**< target IP address */
-} __attribute__((__packed__)) __attribute__((aligned(2)));
+} __attribute__((__packed__)) __rte_aligned(2);
 
 /**
  * ARP header.
@@ -47,7 +47,7 @@ struct rte_arp_hdr {
 #define	RTE_ARP_OP_INVREPLY   9 /* response identifying peer */
 
 	struct rte_arp_ipv4 arp_data;
-} __attribute__((__packed__)) __attribute__((aligned(2)));
+} __attribute__((__packed__)) __rte_aligned(2);
 
 /**
  * @warning
diff --git a/lib/librte_net/rte_ether.h b/lib/librte_net/rte_ether.h
index e069dc7fe0..850c0fa387 100644
--- a/lib/librte_net/rte_ether.h
+++ b/lib/librte_net/rte_ether.h
@@ -59,7 +59,7 @@ extern "C" {
  */
 struct rte_ether_addr {
 	uint8_t addr_bytes[RTE_ETHER_ADDR_LEN]; /**< Addr bytes in tx order */
-} __attribute__((aligned(2)));
+} __rte_aligned(2);
 
 #define RTE_ETHER_LOCAL_ADMIN_ADDR 0x02 /**< Locally assigned Eth. address. */
 #define RTE_ETHER_GROUP_ADDR  0x01 /**< Multicast or broadcast Eth. address. */
@@ -273,7 +273,7 @@ struct rte_ether_hdr {
 	struct rte_ether_addr d_addr; /**< Destination address. */
 	struct rte_ether_addr s_addr; /**< Source address. */
 	uint16_t ether_type;      /**< Frame type. */
-} __attribute__((aligned(2)));
+} __rte_aligned(2);
 
 /**
  * Ethernet VLAN Header.
diff --git a/lib/librte_pipeline/rte_table_action.c b/lib/librte_pipeline/rte_table_action.c
index 9ce98f2ceb..e6af23b688 100644
--- a/lib/librte_pipeline/rte_table_action.c
+++ b/lib/librte_pipeline/rte_table_action.c
@@ -471,7 +471,7 @@ struct encap_mpls_data {
 	struct rte_ether_hdr ether;
 	uint32_t mpls[RTE_TABLE_ACTION_MPLS_LABELS_MAX];
 	uint32_t mpls_count;
-} __attribute__((__packed__)) __attribute__((aligned(2)));
+} __attribute__((__packed__)) __rte_aligned(2);
 
 #define PPP_PROTOCOL_IP                                    0x0021
 
@@ -494,7 +494,7 @@ struct encap_vxlan_ipv4_data {
 	struct rte_ipv4_hdr ipv4;
 	struct rte_udp_hdr udp;
 	struct rte_vxlan_hdr vxlan;
-} __attribute__((__packed__)) __attribute__((aligned(2)));
+} __attribute__((__packed__)) __rte_aligned(2);
 
 struct encap_vxlan_ipv4_vlan_data {
 	struct rte_ether_hdr ether;
@@ -502,14 +502,14 @@ struct encap_vxlan_ipv4_vlan_data {
 	struct rte_ipv4_hdr ipv4;
 	struct rte_udp_hdr udp;
 	struct rte_vxlan_hdr vxlan;
-} __attribute__((__packed__)) __attribute__((aligned(2)));
+} __attribute__((__packed__)) __rte_aligned(2);
 
 struct encap_vxlan_ipv6_data {
 	struct rte_ether_hdr ether;
 	struct rte_ipv6_hdr ipv6;
 	struct rte_udp_hdr udp;
 	struct rte_vxlan_hdr vxlan;
-} __attribute__((__packed__)) __attribute__((aligned(2)));
+} __attribute__((__packed__)) __rte_aligned(2);
 
 struct encap_vxlan_ipv6_vlan_data {
 	struct rte_ether_hdr ether;
@@ -517,14 +517,14 @@ struct encap_vxlan_ipv6_vlan_data {
 	struct rte_ipv6_hdr ipv6;
 	struct rte_udp_hdr udp;
 	struct rte_vxlan_hdr vxlan;
-} __attribute__((__packed__)) __attribute__((aligned(2)));
+} __attribute__((__packed__)) __rte_aligned(2);
 
 struct encap_qinq_pppoe_data {
 	struct rte_ether_hdr ether;
 	struct rte_vlan_hdr svlan;
 	struct rte_vlan_hdr cvlan;
 	struct pppoe_ppp_hdr pppoe_ppp;
-} __attribute__((__packed__)) __attribute__((aligned(2)));
+} __attribute__((__packed__)) __rte_aligned(2);
 
 static size_t
 encap_data_size(struct rte_table_action_encap_config *encap)
diff --git a/lib/librte_sched/rte_sched_common.h b/lib/librte_sched/rte_sched_common.h
index b58282de88..96706df7bd 100644
--- a/lib/librte_sched/rte_sched_common.h
+++ b/lib/librte_sched/rte_sched_common.h
@@ -12,7 +12,7 @@ extern "C" {
 #include <stdint.h>
 #include <sys/types.h>
 
-#define __rte_aligned_16 __attribute__((__aligned__(16)))
+#define __rte_aligned_16 __rte_aligned(16)
 
 #if 0
 static inline uint32_t
-- 
2.25.0


  parent reply	other threads:[~2020-02-10 16:21 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-10 16:20 [dpdk-dev] [PATCH 20.05 00/15] clean-up use of __attribute__ Thomas Monjalon
2020-02-10 16:20 ` [dpdk-dev] [PATCH 20.05 01/15] app/bbdev: replace constructor syntax with common macro Thomas Monjalon
2020-02-10 21:06   ` Chautru, Nicolas
2020-02-10 16:20 ` [dpdk-dev] [PATCH 20.05 02/15] net/mlx5: replace destructor " Thomas Monjalon
2020-02-10 16:20 ` [dpdk-dev] [PATCH 20.05 03/15] net/memif: use common macros for cache line marker Thomas Monjalon
2020-02-10 16:20 ` [dpdk-dev] [PATCH 20.05 04/15] common/mlx5: replace alignas keyword Thomas Monjalon
2020-02-10 16:20 ` Thomas Monjalon [this message]
2020-02-10 19:11   ` [dpdk-dev] [PATCH 20.05 05/15] replace alignment attributes David Christensen
2020-02-10 16:20 ` [dpdk-dev] [PATCH 20.05 06/15] replace packed attributes Thomas Monjalon
2020-02-10 16:20 ` [dpdk-dev] [PATCH 20.05 07/15] replace always-inline attributes Thomas Monjalon
2020-02-10 16:20 ` [dpdk-dev] [PATCH 20.05 08/15] replace no-inline attributes Thomas Monjalon
2020-02-10 16:20 ` [dpdk-dev] [PATCH 20.05 09/15] replace unused attributes Thomas Monjalon
2020-02-10 16:20 ` [dpdk-dev] [PATCH 20.05 10/15] replace used attributes Thomas Monjalon
2020-02-10 16:20 ` [dpdk-dev] [PATCH 20.05 11/15] replace hot attributes Thomas Monjalon
2020-02-10 16:20 ` [dpdk-dev] [PATCH 20.05 12/15] replace cold attributes Thomas Monjalon
2020-02-10 19:14   ` David Christensen
2020-02-10 16:20 ` [dpdk-dev] [PATCH 20.05 13/15] replace no-return attributes Thomas Monjalon
2020-02-10 16:20 ` [dpdk-dev] [PATCH 20.05 14/15] replace printf format attributes Thomas Monjalon
2020-02-10 16:20 ` [dpdk-dev] [PATCH 20.05 15/15] devtools: check use of compiler attributes Thomas Monjalon
2020-04-16 16:34 ` [dpdk-dev] [PATCH 20.05 00/15] clean-up use of __attribute__ Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200210162032.1177478-6-thomas@monjalon.net \
    --to=thomas@monjalon.net \
    --cc=anatoly.burakov@intel.com \
    --cc=arybchenko@solarflare.com \
    --cc=bruce.richardson@intel.com \
    --cc=chas3@att.com \
    --cc=cristian.dumitrescu@intel.com \
    --cc=deepak.k.jain@intel.com \
    --cc=dev@dpdk.org \
    --cc=drc@linux.vnet.ibm.com \
    --cc=ferruh.yigit@intel.com \
    --cc=fiona.trahe@intel.com \
    --cc=g.singh@nxp.com \
    --cc=gavin.hu@arm.com \
    --cc=heinrich.kuhn@netronome.com \
    --cc=hemant.agrawal@nxp.com \
    --cc=humin29@huawei.com \
    --cc=jan.gutter@netronome.com \
    --cc=jasvinder.singh@intel.com \
    --cc=jerinj@marvell.com \
    --cc=john.griffin@intel.com \
    --cc=keith.wiles@intel.com \
    --cc=konstantin.ananyev@intel.com \
    --cc=matan@mellanox.com \
    --cc=matt.peters@windriver.com \
    --cc=maxime.coquelin@redhat.com \
    --cc=olivier.matz@6wind.com \
    --cc=sachin.saxena@nxp.com \
    --cc=sameh.gobriel@intel.com \
    --cc=shahafs@mellanox.com \
    --cc=steven.webster@windriver.com \
    --cc=tiwei.bie@intel.com \
    --cc=viacheslavo@mellanox.com \
    --cc=viktorin@rehivetech.com \
    --cc=xavier.huwei@huawei.com \
    --cc=yipeng1.wang@intel.com \
    --cc=yisen.zhuang@huawei.com \
    --cc=zhihong.wang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).