From patchwork Mon Feb 10 16:20:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Monjalon X-Patchwork-Id: 65700 X-Patchwork-Delegate: david.marchand@redhat.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 21DD0A04B3; Mon, 10 Feb 2020 17:21:43 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 02F631BDAE; Mon, 10 Feb 2020 17:21:03 +0100 (CET) Received: from new4-smtp.messagingengine.com (new4-smtp.messagingengine.com [66.111.4.230]) by dpdk.org (Postfix) with ESMTP id A8E3E4C7B for ; Mon, 10 Feb 2020 17:21:01 +0100 (CET) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailnew.nyi.internal (Postfix) with ESMTP id CFD4912312; Mon, 10 Feb 2020 11:21:00 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Mon, 10 Feb 2020 11:21:00 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=mesmtp; bh=tdHibZa0vH TvfjzGp+Pb546ZSBaAHjjf4AzWXnbqs0s=; b=NyxEowsUk6Kx9lTISb3j3TOLAy OdXa/MCkHABITP76tao+NnR+ptD8h/XgoOCI2dgYBnQdm0qSTxW/5DiUqytKLjxY 0Rp4Uw9Bg1FPHV72Vom3uELbUnJJQ4+JH6QX0ndb3EO6accZyxAtLLcQvyL9spNG 8wjNqMbdSFEQdxDcw= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=tdHibZa0vHTvfjzGp+Pb546ZSBaAHjjf4AzWXnbqs0s=; b=bsjORjzG fBnxLog9fiC59sXP1Hq4fO4xal2TxGZhlcEJ0qn281xnk7vMAY9k9iTZ4uXCG93q 1UiUhaP50oYrD631BVfuwmViXLKEj1WUmcuCggjO8Ltc9WSmXMLhheEnMbIMv1M5 2mpCB4FZpQC54S5D24Uz9fBT9ppz5As0AHkpdM9+GivPjHOW8aNgJG9nrhbTf1eZ g8A7HHpYzNlGa4ZDY9g6nnaoP40a0SN9wLIn2CbVAJCElHm2WEQ0izoya+9nzPKt abGvlQODcaBxOoi4i4oYB5Ry8vPqQlWQi4joFV44q9ZYQMLQNAodSsId/yFnwKhh P10jS/DNAlVm9Q== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedriedugdektdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepvfhhohhmrghs ucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenucfkph epjeejrddufeegrddvtdefrddukeegnecuvehluhhsthgvrhfuihiivgepgeenucfrrghr rghmpehmrghilhhfrhhomhepthhhohhmrghssehmohhnjhgrlhhonhdrnhgvth X-ME-Proxy: Received: from xps.monjalon.net (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 18A3E328005D; Mon, 10 Feb 2020 11:20:56 -0500 (EST) From: Thomas Monjalon To: dev@dpdk.org Cc: Hemant Agrawal , Sachin Saxena , Gagandeep Singh , John Griffin , Fiona Trahe , Deepak Kumar Jain , Steven Webster , Matt Peters , Chas Williams , "Wei Hu (Xavier)" , "Min Hu (Connor)" , Yisen Zhuang , Matan Azrad , Shahaf Shuler , Viacheslav Ovsiienko , Heinrich Kuhn , Jan Gutter , Keith Wiles , Maxime Coquelin , Tiwei Bie , Zhihong Wang , Anatoly Burakov , Konstantin Ananyev , Jerin Jacob , Gavin Hu , Jan Viktorin , David Christensen , Ferruh Yigit , Andrew Rybchenko , Yipeng Wang , Sameh Gobriel , Bruce Richardson , Olivier Matz , Cristian Dumitrescu , Jasvinder Singh Date: Mon, 10 Feb 2020 17:20:22 +0100 Message-Id: <20200210162032.1177478-6-thomas@monjalon.net> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200210162032.1177478-1-thomas@monjalon.net> References: <20200210162032.1177478-1-thomas@monjalon.net> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH 20.05 05/15] replace alignment attributes X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" There is a common macro __rte_aligned for alignment, which is now used where appropriate for consistency. Signed-off-by: Thomas Monjalon Reviewed-by: David Christensen --- 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 #include -#define __rte_aligned_16 __attribute__((__aligned__(16))) +#define __rte_aligned_16 __rte_aligned(16) #if 0 static inline uint32_t