From: Andre Muezerie <andremue@linux.microsoft.com>
To: roretzla@linux.microsoft.com
Cc: aman.deep.singh@intel.com, anatoly.burakov@intel.com,
bruce.richardson@intel.com, byron.marohn@intel.com,
conor.walsh@intel.com, cristian.dumitrescu@intel.com,
david.hunt@intel.com, dev@dpdk.org, dsosnowski@nvidia.com,
gakhil@marvell.com, jerinj@marvell.com, jingjing.wu@intel.com,
kirill.rybalchenko@intel.com, konstantin.v.ananyev@yandex.ru,
matan@nvidia.com, orika@nvidia.com, radu.nicolau@intel.com,
ruifeng.wang@arm.com, sameh.gobriel@intel.com,
sivaprasad.tummala@amd.com, skori@marvell.com,
stephen@networkplumber.org, suanmingm@nvidia.com,
vattunuru@marvell.com, viacheslavo@nvidia.com,
vladimir.medvedkin@intel.com, yipeng1.wang@intel.com,
Andre Muezerie <andremue@linux.microsoft.com>
Subject: [PATCH v6 08/30] drivers/common: replace packed attributes
Date: Tue, 26 Nov 2024 16:52:19 -0800 [thread overview]
Message-ID: <1732668761-5556-9-git-send-email-andremue@linux.microsoft.com> (raw)
In-Reply-To: <1732668761-5556-1-git-send-email-andremue@linux.microsoft.com>
MSVC struct packing is not compatible with GCC. Replace macro
__rte_packed with __rte_packed_begin to push existing pack value
and set packing to 1-byte and macro __rte_packed_end to restore
the pack value prior to the push.
Macro __rte_packed_end is deliberately utilized to trigger a
MSVC compiler warning if no existing packing has been pushed allowing
easy identification of locations where the __rte_packed_begin is
missing.
Signed-off-by: Andre Muezerie <andremue@linux.microsoft.com>
---
drivers/common/cnxk/hw/sdp.h | 4 +-
drivers/common/cnxk/roc_npc.h | 16 ++--
drivers/common/cnxk/roc_npc_mcam_dump.c | 4 +-
drivers/common/cnxk/roc_platform.h | 3 +-
drivers/common/dpaax/compat.h | 3 -
drivers/common/iavf/iavf_osdep.h | 8 +-
drivers/common/iavf/virtchnl_inline_ipsec.h | 44 +++++-----
drivers/common/idpf/base/idpf_osdep.h | 8 +-
drivers/common/mlx5/mlx5_common_mr.h | 12 ++-
drivers/common/mlx5/mlx5_common_utils.h | 3 +-
drivers/common/mlx5/mlx5_prm.h | 90 ++++++++++++++-------
drivers/common/qat/qat_adf/icp_qat_fw_la.h | 8 +-
drivers/common/qat/qat_common.h | 8 +-
13 files changed, 122 insertions(+), 89 deletions(-)
diff --git a/drivers/common/cnxk/hw/sdp.h b/drivers/common/cnxk/hw/sdp.h
index 686f516097..c5b42c08f6 100644
--- a/drivers/common/cnxk/hw/sdp.h
+++ b/drivers/common/cnxk/hw/sdp.h
@@ -156,7 +156,7 @@
#define SDP_VF_R_OUT_INT_LEVELS_TIMET (32)
/* SDP Instruction Header */
-struct sdp_instr_ih {
+__plt_packed_begin struct sdp_instr_ih {
/* Data Len */
uint64_t tlen : 16;
@@ -177,6 +177,6 @@ struct sdp_instr_ih {
/* Reserved2 */
uint64_t rsvd2 : 1;
-} __plt_packed;
+} __plt_packed_end;
#endif /* __SDP_HW_H_ */
diff --git a/drivers/common/cnxk/roc_npc.h b/drivers/common/cnxk/roc_npc.h
index bf8c65aa9c..4f7247f867 100644
--- a/drivers/common/cnxk/roc_npc.h
+++ b/drivers/common/cnxk/roc_npc.h
@@ -97,10 +97,10 @@ struct roc_npc_flow_item_eth {
uint32_t reserved : 31; /**< Reserved, must be zero. */
};
-struct roc_vlan_hdr {
+__plt_packed_begin struct roc_vlan_hdr {
uint16_t vlan_tci; /**< Priority (3) + CFI (1) + Identifier Code (12) */
uint16_t eth_proto; /**< Ethernet type of encapsulated frame. */
-} __plt_packed;
+} __plt_packed_end;
struct roc_npc_flow_item_vlan {
union {
@@ -115,23 +115,23 @@ struct roc_npc_flow_item_vlan {
uint32_t reserved : 31; /**< Reserved, must be zero. */
};
-struct roc_ipv6_hdr {
+__plt_packed_begin struct roc_ipv6_hdr {
uint32_t vtc_flow; /**< IP version, traffic class & flow label. */
uint16_t payload_len; /**< IP payload size, including ext. headers */
uint8_t proto; /**< Protocol, next header. */
uint8_t hop_limits; /**< Hop limits. */
uint8_t src_addr[16]; /**< IP address of source host. */
uint8_t dst_addr[16]; /**< IP address of destination host(s). */
-} __plt_packed;
+} __plt_packed_end;
-struct roc_ipv6_fragment_ext {
+__plt_packed_begin struct roc_ipv6_fragment_ext {
uint8_t next_header; /**< Next header type */
uint8_t reserved; /**< Reserved */
uint16_t frag_data; /**< All fragmentation data */
uint32_t id; /**< Packet ID */
-} __plt_packed;
+} __plt_packed_end;
-struct roc_ipv6_routing_ext {
+__plt_packed_begin struct roc_ipv6_routing_ext {
uint8_t next_hdr; /**< Protocol, next header. */
uint8_t hdr_len; /**< Header length. */
uint8_t type; /**< Extension header type. */
@@ -145,7 +145,7 @@ struct roc_ipv6_routing_ext {
};
};
/* Next are 128-bit IPv6 address fields to describe segments. */
-} __plt_packed;
+} __plt_packed_end;
struct roc_flow_item_ipv6_ext {
uint8_t next_hdr; /**< Next header. */
diff --git a/drivers/common/cnxk/roc_npc_mcam_dump.c b/drivers/common/cnxk/roc_npc_mcam_dump.c
index ebd2dd69c2..ca566d2b44 100644
--- a/drivers/common/cnxk/roc_npc_mcam_dump.c
+++ b/drivers/common/cnxk/roc_npc_mcam_dump.c
@@ -35,7 +35,7 @@
#define NIX_TX_VTAGACT_VTAG1_OP_MASK GENMASK(45, 44)
#define NIX_TX_VTAGACT_VTAG1_DEF_MASK GENMASK(57, 48)
-struct npc_rx_parse_nibble_s {
+__plt_packed_begin struct npc_rx_parse_nibble_s {
uint16_t chan : 3;
uint16_t errlev : 1;
uint16_t errcode : 2;
@@ -56,7 +56,7 @@ struct npc_rx_parse_nibble_s {
uint16_t lgtype : 1;
uint16_t lhflags : 2;
uint16_t lhtype : 1;
-} __plt_packed;
+} __plt_packed_end;
static const char *const intf_str[] = {
"NIX-RX",
diff --git a/drivers/common/cnxk/roc_platform.h b/drivers/common/cnxk/roc_platform.h
index df4f88f288..d6f3ea9acc 100644
--- a/drivers/common/cnxk/roc_platform.h
+++ b/drivers/common/cnxk/roc_platform.h
@@ -97,7 +97,8 @@
#define __plt_cache_aligned __rte_cache_aligned
#define __plt_always_inline __rte_always_inline
-#define __plt_packed __rte_packed
+#define __plt_packed_begin __rte_packed_begin
+#define __plt_packed_end __rte_packed_end
#define __plt_unused __rte_unused
#define __roc_api __rte_internal
#define plt_iova_t rte_iova_t
diff --git a/drivers/common/dpaax/compat.h b/drivers/common/dpaax/compat.h
index 7c8d82c2b2..28bffde2a7 100644
--- a/drivers/common/dpaax/compat.h
+++ b/drivers/common/dpaax/compat.h
@@ -53,9 +53,6 @@
#ifndef __always_unused
#define __always_unused __rte_unused
#endif
-#ifndef __packed
-#define __packed __rte_packed
-#endif
#ifndef noinline
#define noinline __rte_noinline
#endif
diff --git a/drivers/common/iavf/iavf_osdep.h b/drivers/common/iavf/iavf_osdep.h
index 1f2b7889cb..91f77948bb 100644
--- a/drivers/common/iavf/iavf_osdep.h
+++ b/drivers/common/iavf/iavf_osdep.h
@@ -158,17 +158,17 @@ do { \
} while (0)
/* memory allocation tracking */
-struct iavf_dma_mem {
+__rte_packed_begin struct iavf_dma_mem {
void *va;
u64 pa;
u32 size;
const void *zone;
-} __rte_packed;
+} __rte_packed_end;
-struct iavf_virt_mem {
+__rte_packed_begin struct iavf_virt_mem {
void *va;
u32 size;
-} __rte_packed;
+} __rte_packed_end;
#define iavf_allocate_dma_mem(h, m, unused, s, a) \
iavf_allocate_dma_mem_d(h, m, s, a)
diff --git a/drivers/common/iavf/virtchnl_inline_ipsec.h b/drivers/common/iavf/virtchnl_inline_ipsec.h
index 2f4bf15725..61e1d648ea 100644
--- a/drivers/common/iavf/virtchnl_inline_ipsec.h
+++ b/drivers/common/iavf/virtchnl_inline_ipsec.h
@@ -109,7 +109,7 @@ enum inline_ipsec_ops {
};
/* Not all valid, if certain field is invalid, set 1 for all bits */
-struct virtchnl_algo_cap {
+__rte_packed_begin struct virtchnl_algo_cap {
u32 algo_type;
u16 block_size;
@@ -129,20 +129,20 @@ struct virtchnl_algo_cap {
u16 min_aad_size;
u16 max_aad_size;
u16 inc_aad_size;
-} __rte_packed;
+} __rte_packed_end;
/* vf record the capability of crypto from the virtchnl */
-struct virtchnl_sym_crypto_cap {
+__rte_packed_begin struct virtchnl_sym_crypto_cap {
u8 crypto_type;
u8 algo_cap_num;
struct virtchnl_algo_cap algo_cap_list[VIRTCHNL_IPSEC_MAX_ALGO_CAP_NUM];
-} __rte_packed;
+} __rte_packed_end;
/* VIRTCHNL_OP_GET_IPSEC_CAP
* VF pass virtchnl_ipsec_cap to PF
* and PF return capability of ipsec from virtchnl.
*/
-struct virtchnl_ipsec_cap {
+__rte_packed_begin struct virtchnl_ipsec_cap {
/* max number of SA per VF */
u16 max_sa_num;
@@ -169,10 +169,10 @@ struct virtchnl_ipsec_cap {
/* crypto capabilities */
struct virtchnl_sym_crypto_cap cap[VIRTCHNL_IPSEC_MAX_CRYPTO_CAP_NUM];
-} __rte_packed;
+} __rte_packed_end;
/* configuration of crypto function */
-struct virtchnl_ipsec_crypto_cfg_item {
+__rte_packed_begin struct virtchnl_ipsec_crypto_cfg_item {
u8 crypto_type;
u32 algo_type;
@@ -191,7 +191,7 @@ struct virtchnl_ipsec_crypto_cfg_item {
/* key data buffer */
u8 key_data[VIRTCHNL_IPSEC_MAX_KEY_LEN];
-} __rte_packed;
+} __rte_packed_end;
struct virtchnl_ipsec_sym_crypto_cfg {
struct virtchnl_ipsec_crypto_cfg_item
@@ -203,7 +203,7 @@ struct virtchnl_ipsec_sym_crypto_cfg {
* PF create SA as configuration and PF driver will return
* an unique index (sa_idx) for the created SA.
*/
-struct virtchnl_ipsec_sa_cfg {
+__rte_packed_begin struct virtchnl_ipsec_sa_cfg {
/* IPsec SA Protocol - AH/ESP */
u8 virtchnl_protocol_type;
@@ -292,17 +292,17 @@ struct virtchnl_ipsec_sa_cfg {
/* crypto configuration */
struct virtchnl_ipsec_sym_crypto_cfg crypto_cfg;
-} __rte_packed;
+} __rte_packed_end;
/* VIRTCHNL_OP_IPSEC_SA_UPDATE
* VF send configuration of index of SA to PF
* PF will update SA according to configuration
*/
-struct virtchnl_ipsec_sa_update {
+__rte_packed_begin struct virtchnl_ipsec_sa_update {
u32 sa_index; /* SA to update */
u32 esn_hi; /* high 32 bits of esn */
u32 esn_low; /* low 32 bits of esn */
-} __rte_packed;
+} __rte_packed_end;
/* VIRTCHNL_OP_IPSEC_SA_DESTROY
* VF send configuration of index of SA to PF
@@ -310,7 +310,7 @@ struct virtchnl_ipsec_sa_update {
* flag bitmap indicate all SA or just selected SA will
* be destroyed
*/
-struct virtchnl_ipsec_sa_destroy {
+__rte_packed_begin struct virtchnl_ipsec_sa_destroy {
/* All zero bitmap indicates all SA will be destroyed.
* Non-zero bitmap indicates the selected SA in
* array sa_index will be destroyed.
@@ -319,13 +319,13 @@ struct virtchnl_ipsec_sa_destroy {
/* selected SA index */
u32 sa_index[VIRTCHNL_IPSEC_MAX_SA_DESTROY_NUM];
-} __rte_packed;
+} __rte_packed_end;
/* VIRTCHNL_OP_IPSEC_SA_READ
* VF send this SA configuration to PF using virtchnl;
* PF read SA and will return configuration for the created SA.
*/
-struct virtchnl_ipsec_sa_read {
+__rte_packed_begin struct virtchnl_ipsec_sa_read {
/* SA valid - invalid/valid */
u8 valid;
@@ -424,14 +424,14 @@ struct virtchnl_ipsec_sa_read {
/* crypto configuration. Salt and keys are set to 0 */
struct virtchnl_ipsec_sym_crypto_cfg crypto_cfg;
-} __rte_packed;
+} __rte_packed_end;
#define VIRTCHNL_IPSEC_INBOUND_SPD_TBL_IPV4 (0)
#define VIRTCHNL_IPSEC_INBOUND_SPD_TBL_IPV6 (1)
/* Add allowlist entry in IES */
-struct virtchnl_ipsec_sp_cfg {
+__rte_packed_begin struct virtchnl_ipsec_sp_cfg {
u32 spi;
u32 dip[4];
@@ -455,15 +455,15 @@ struct virtchnl_ipsec_sp_cfg {
/* NAT-T UDP port number. Only valid in case NAT-T supported */
u16 udp_port;
-} __rte_packed;
+} __rte_packed_end;
/* Delete allowlist entry in IES */
-struct virtchnl_ipsec_sp_destroy {
+__rte_packed_begin struct virtchnl_ipsec_sp_destroy {
/* 0 for IPv4 table, 1 for IPv6 table. */
u8 table_id;
u32 rule_id;
-} __rte_packed;
+} __rte_packed_end;
/* Response from IES to allowlist operations */
struct virtchnl_ipsec_sp_cfg_resp {
@@ -494,7 +494,7 @@ struct virtchnl_ipsec_resp {
};
/* Internal message descriptor for VF <-> IPsec communication */
-struct inline_ipsec_msg {
+__rte_packed_begin struct inline_ipsec_msg {
u16 ipsec_opcode;
u16 req_id;
@@ -520,7 +520,7 @@ struct inline_ipsec_msg {
/* Reserved */
struct virtchnl_ipsec_sa_read sa_read[0];
} ipsec_data;
-} __rte_packed;
+} __rte_packed_end;
static inline u16 virtchnl_inline_ipsec_val_msg_len(u16 opcode)
{
diff --git a/drivers/common/idpf/base/idpf_osdep.h b/drivers/common/idpf/base/idpf_osdep.h
index cf9e553906..a3a232ac7f 100644
--- a/drivers/common/idpf/base/idpf_osdep.h
+++ b/drivers/common/idpf/base/idpf_osdep.h
@@ -180,17 +180,17 @@ static inline uint64_t idpf_read_addr64(volatile void *addr)
#define BITS_PER_BYTE 8
/* memory allocation tracking */
-struct idpf_dma_mem {
+__rte_packed_begin struct idpf_dma_mem {
void *va;
u64 pa;
u32 size;
const void *zone;
-} __rte_packed;
+} __rte_packed_end;
-struct idpf_virt_mem {
+__rte_packed_begin struct idpf_virt_mem {
void *va;
u32 size;
-} __rte_packed;
+} __rte_packed_end;
#define idpf_malloc(h, s) rte_zmalloc(NULL, s, 0)
#define idpf_calloc(h, c, s) rte_zmalloc(NULL, (c) * (s), 0)
diff --git a/drivers/common/mlx5/mlx5_common_mr.h b/drivers/common/mlx5/mlx5_common_mr.h
index a7f1042037..299d38b78b 100644
--- a/drivers/common/mlx5/mlx5_common_mr.h
+++ b/drivers/common/mlx5/mlx5_common_mr.h
@@ -49,22 +49,25 @@ struct mlx5_mr {
};
/* Cache entry for Memory Region. */
+__rte_packed_begin
struct mr_cache_entry {
uintptr_t start; /* Start address of MR. */
uintptr_t end; /* End address of MR. */
uint32_t lkey; /* rte_cpu_to_be_32(lkey). */
-} __rte_packed;
+} __rte_packed_end;
/* MR Cache table for Binary search. */
+__rte_packed_begin
struct mlx5_mr_btree {
uint32_t len; /* Number of entries. */
uint32_t size; /* Total number of entries. */
struct mr_cache_entry (*table)[];
-} __rte_packed;
+} __rte_packed_end;
struct mlx5_common_device;
/* Per-queue MR control descriptor. */
+__rte_packed_begin
struct mlx5_mr_ctrl {
uint32_t *dev_gen_ptr; /* Generation number of device to poll. */
uint32_t cur_gen; /* Generation number saved to flush caches. */
@@ -72,12 +75,13 @@ struct mlx5_mr_ctrl {
uint16_t head; /* Index of the oldest entry in top-half cache. */
struct mr_cache_entry cache[MLX5_MR_CACHE_N]; /* Cache for top-half. */
struct mlx5_mr_btree cache_bh; /* Cache for bottom-half. */
-} __rte_packed;
+} __rte_packed_end;
LIST_HEAD(mlx5_mr_list, mlx5_mr);
LIST_HEAD(mlx5_mempool_reg_list, mlx5_mempool_reg);
/* Global per-device MR cache. */
+__rte_packed_begin
struct mlx5_mr_share_cache {
uint32_t dev_gen; /* Generation number to flush local caches. */
rte_rwlock_t rwlock; /* MR cache Lock. */
@@ -88,7 +92,7 @@ struct mlx5_mr_share_cache {
struct mlx5_mempool_reg_list mempool_reg_list; /* Mempool database. */
mlx5_reg_mr_t reg_mr_cb; /* Callback to reg_mr func */
mlx5_dereg_mr_t dereg_mr_cb; /* Callback to dereg_mr func */
-} __rte_packed;
+} __rte_packed_end;
/* Multi-Packet RQ buffer header. */
struct __rte_cache_aligned mlx5_mprq_buf {
diff --git a/drivers/common/mlx5/mlx5_common_utils.h b/drivers/common/mlx5/mlx5_common_utils.h
index 9139bc6829..70d9c6d69e 100644
--- a/drivers/common/mlx5/mlx5_common_utils.h
+++ b/drivers/common/mlx5/mlx5_common_utils.h
@@ -27,6 +27,7 @@ struct mlx5_list;
* Structure of the entry in the mlx5 list, user should define its own struct
* that contains this in order to store the data.
*/
+__rte_packed_begin
struct mlx5_list_entry {
LIST_ENTRY(mlx5_list_entry) next; /* Entry pointers in the list. */
alignas(8) RTE_ATOMIC(uint32_t) ref_cnt; /* 0 means, entry is invalid. */
@@ -35,7 +36,7 @@ struct mlx5_list_entry {
struct mlx5_list_entry *gentry;
uint32_t bucket_idx;
};
-} __rte_packed;
+} __rte_packed_end;
struct __rte_cache_aligned mlx5_list_cache {
LIST_HEAD(mlx5_list_head, mlx5_list_entry) h;
diff --git a/drivers/common/mlx5/mlx5_prm.h b/drivers/common/mlx5/mlx5_prm.h
index 2d82807bc2..82005a8567 100644
--- a/drivers/common/mlx5/mlx5_prm.h
+++ b/drivers/common/mlx5/mlx5_prm.h
@@ -323,12 +323,13 @@ enum mlx5_mpw_mode {
};
/* WQE Control segment. */
+__rte_packed_begin
struct __rte_aligned(MLX5_WSEG_SIZE) mlx5_wqe_cseg {
uint32_t opcode;
uint32_t sq_ds;
uint32_t flags;
uint32_t misc;
-} __rte_packed;
+} __rte_packed_end;
/*
* WQE CSEG opcode field size is 32 bits, divided:
@@ -340,20 +341,24 @@ struct __rte_aligned(MLX5_WSEG_SIZE) mlx5_wqe_cseg {
#define WQE_CSEG_WQE_INDEX_OFFSET 8
/* Header of data segment. Minimal size Data Segment */
+__rte_packed_begin
struct mlx5_wqe_dseg {
uint32_t bcount;
union {
uint8_t inline_data[MLX5_DSEG_MIN_INLINE_SIZE];
+ __rte_packed_begin
struct {
uint32_t lkey;
uint64_t pbuf;
- } __rte_packed;
+ } __rte_packed_end;
};
-} __rte_packed;
+} __rte_packed_end;
/* Subset of struct WQE Ethernet Segment. */
+__rte_packed_begin
struct mlx5_wqe_eseg {
union {
+ __rte_packed_begin
struct {
uint32_t swp_offs;
uint8_t cs_flags;
@@ -365,23 +370,26 @@ struct mlx5_wqe_eseg {
uint16_t inline_data;
uint16_t vlan_tag;
};
- } __rte_packed;
+ } __rte_packed_end;
+ __rte_packed_begin
struct {
uint32_t offsets;
uint32_t flags;
uint32_t flow_metadata;
uint32_t inline_hdr;
- } __rte_packed;
+ } __rte_packed_end;
};
-} __rte_packed;
+} __rte_packed_end;
+__rte_packed_begin
struct mlx5_wqe_qseg {
uint32_t reserved0;
uint32_t reserved1;
uint32_t max_index;
uint32_t qpn_cqn;
-} __rte_packed;
+} __rte_packed_end;
+__rte_packed_begin
struct mlx5_wqe_wseg {
uint32_t operation;
uint32_t lkey;
@@ -389,9 +397,10 @@ struct mlx5_wqe_wseg {
uint32_t va_low;
uint64_t value;
uint64_t mask;
-} __rte_packed;
+} __rte_packed_end;
/* The title WQEBB, header of WQE. */
+__rte_packed_begin
struct mlx5_wqe {
union {
struct mlx5_wqe_cseg cseg;
@@ -402,7 +411,7 @@ struct mlx5_wqe {
struct mlx5_wqe_dseg dseg[2];
uint8_t data[MLX5_ESEG_EXTRA_DATA_SIZE];
};
-} __rte_packed;
+} __rte_packed_end;
/* WQE for Multi-Packet RQ. */
struct mlx5_wqe_mprq {
@@ -464,10 +473,11 @@ struct mlx5_cqe {
uint8_t lro_num_seg;
union {
uint8_t user_index_bytes[3];
+ __rte_packed_begin
struct {
uint8_t user_index_hi;
uint16_t user_index_low;
- } __rte_packed;
+ } __rte_packed_end;
};
uint32_t flow_table_metadata;
uint8_t rsvd4[4];
@@ -487,11 +497,12 @@ struct mlx5_cqe_ts {
uint8_t op_own;
};
+__rte_packed_begin
struct mlx5_wqe_rseg {
uint64_t raddr;
uint32_t rkey;
uint32_t reserved;
-} __rte_packed;
+} __rte_packed_end;
#define MLX5_UMRC_IF_OFFSET 31u
#define MLX5_UMRC_KO_OFFSET 16u
@@ -506,13 +517,15 @@ struct mlx5_wqe_rseg {
#define MLX5_UMR_KLM_NUM_ALIGN \
(MLX5_UMR_KLM_PTR_ALIGN / sizeof(struct mlx5_klm))
+__rte_packed_begin
struct mlx5_wqe_umr_cseg {
uint32_t if_cf_toe_cq_res;
uint32_t ko_to_bs;
uint64_t mkey_mask;
uint32_t rsvd1[8];
-} __rte_packed;
+} __rte_packed_end;
+__rte_packed_begin
struct mlx5_wqe_mkey_cseg {
uint32_t fr_res_af_sf;
uint32_t qpn_mkey;
@@ -525,7 +538,7 @@ struct mlx5_wqe_mkey_cseg {
uint32_t translations_octword_size;
uint32_t res4_lps;
uint32_t reserved;
-} __rte_packed;
+} __rte_packed_end;
enum {
MLX5_BSF_SIZE_16B = 0x0,
@@ -576,6 +589,7 @@ enum {
#define MLX5_CRYPTO_MMO_TYPE_OFFSET 24
#define MLX5_CRYPTO_MMO_OP_OFFSET 20
+__rte_packed_begin
struct mlx5_wqe_umr_bsf_seg {
/*
* bs_bpt_eo_es contains:
@@ -603,12 +617,13 @@ struct mlx5_wqe_umr_bsf_seg {
uint32_t reserved1;
uint64_t keytag;
uint32_t reserved2[4];
-} __rte_packed;
+} __rte_packed_end;
#ifdef PEDANTIC
#pragma GCC diagnostic ignored "-Wpedantic"
#endif
+__rte_packed_begin
struct mlx5_umr_wqe {
struct mlx5_wqe_cseg ctr;
struct mlx5_wqe_umr_cseg ucseg;
@@ -617,24 +632,27 @@ struct mlx5_umr_wqe {
struct mlx5_wqe_dseg kseg[0];
struct mlx5_wqe_umr_bsf_seg bsf[0];
};
-} __rte_packed;
+} __rte_packed_end;
+__rte_packed_begin
struct mlx5_rdma_write_wqe {
struct mlx5_wqe_cseg ctr;
struct mlx5_wqe_rseg rseg;
struct mlx5_wqe_dseg dseg[];
-} __rte_packed;
+} __rte_packed_end;
+__rte_packed_begin
struct mlx5_wqe_send_en_seg {
uint32_t reserve[2];
uint32_t sqnpc;
uint32_t qpn;
-} __rte_packed;
+} __rte_packed_end;
+__rte_packed_begin
struct mlx5_wqe_send_en_wqe {
struct mlx5_wqe_cseg ctr;
struct mlx5_wqe_send_en_seg sseg;
-} __rte_packed;
+} __rte_packed_end;
#ifdef PEDANTIC
#pragma GCC diagnostic error "-Wpedantic"
@@ -677,6 +695,7 @@ struct mlx5_wqe_metadata_seg {
uint64_t addr;
};
+__rte_packed_begin
struct mlx5_gga_wqe {
uint32_t opcode;
uint32_t sq_ds;
@@ -687,40 +706,45 @@ struct mlx5_gga_wqe {
uint64_t opaque_vaddr;
struct mlx5_wqe_dseg gather;
struct mlx5_wqe_dseg scatter;
-} __rte_packed;
+} __rte_packed_end;
union mlx5_gga_compress_opaque {
+ __rte_packed_begin
struct {
uint32_t syndrome;
uint32_t reserved0;
uint32_t scattered_length;
union {
+ __rte_packed_begin
struct {
uint32_t reserved1[5];
uint32_t crc32;
uint32_t adler32;
- } v1 __rte_packed;
+ } v1 __rte_packed_end;
+ __rte_packed_begin
struct {
uint32_t crc32;
uint32_t adler32;
uint32_t crc32c;
uint32_t xxh32;
- } v2 __rte_packed;
+ } v2 __rte_packed_end;
};
- } __rte_packed;
+ } __rte_packed_end;
uint32_t data[64];
};
union mlx5_gga_crypto_opaque {
+ __rte_packed_begin
struct {
uint32_t syndrome;
uint32_t reserved0[2];
+ __rte_packed_begin
struct {
uint32_t iv[3];
uint32_t tag_size;
uint32_t aad_size;
- } cp __rte_packed;
- } __rte_packed;
+ } cp __rte_packed_end;
+ } __rte_packed_end;
uint8_t data[64];
};
@@ -931,6 +955,7 @@ mlx5_regc_value(uint8_t regc_ix)
/* Modification sub command. */
struct mlx5_modification_cmd {
+ __rte_packed_begin
union {
uint32_t data0;
struct {
@@ -941,7 +966,8 @@ struct mlx5_modification_cmd {
unsigned int field:12;
unsigned int action_type:4;
};
- } __rte_packed;
+ } __rte_packed_end;
+ __rte_packed_begin
union {
uint32_t data1;
uint8_t data[4];
@@ -952,7 +978,7 @@ struct mlx5_modification_cmd {
unsigned int dst_field:12;
unsigned int rsvd4:4;
};
- } __rte_packed;
+ } __rte_packed_end;
};
typedef uint64_t u64;
@@ -4191,6 +4217,7 @@ enum mlx5_aso_op {
#define MLX5_ASO_CSEG_READ_ENABLE 1
/* ASO WQE CTRL segment. */
+__rte_packed_begin
struct mlx5_aso_cseg {
uint32_t va_h;
uint32_t va_l_r;
@@ -4202,11 +4229,12 @@ struct mlx5_aso_cseg {
uint32_t condition_1_mask;
uint64_t bitwise_data;
uint64_t data_mask;
-} __rte_packed;
+} __rte_packed_end;
#define MLX5_MTR_MAX_TOKEN_VALUE INT32_MAX
/* A meter data segment - 2 per ASO WQE. */
+__rte_packed_begin
struct mlx5_aso_mtr_dseg {
uint32_t v_bo_sc_bbog_mm;
/*
@@ -4227,7 +4255,7 @@ struct mlx5_aso_mtr_dseg {
*/
uint32_t e_tokens;
uint64_t timestamp;
-} __rte_packed;
+} __rte_packed_end;
#define ASO_DSEG_VALID_OFFSET 31
#define ASO_DSEG_BO_OFFSET 30
@@ -4248,19 +4276,21 @@ struct mlx5_aso_mtr_dseg {
#define MLX5_ASO_MTRS_PER_POOL 128
/* ASO WQE data segment. */
+__rte_packed_begin
struct mlx5_aso_dseg {
union {
uint8_t data[MLX5_ASO_WQE_DSEG_SIZE];
struct mlx5_aso_mtr_dseg mtrs[MLX5_ASO_METERS_PER_WQE];
};
-} __rte_packed;
+} __rte_packed_end;
/* ASO WQE. */
+__rte_packed_begin
struct mlx5_aso_wqe {
struct mlx5_wqe_cseg general_cseg;
struct mlx5_aso_cseg aso_cseg;
struct mlx5_aso_dseg aso_dseg;
-} __rte_packed;
+} __rte_packed_end;
enum {
MLX5_EVENT_TYPE_OBJECT_CHANGE = 0x27,
diff --git a/drivers/common/qat/qat_adf/icp_qat_fw_la.h b/drivers/common/qat/qat_adf/icp_qat_fw_la.h
index fe32b66c50..30a93549cf 100644
--- a/drivers/common/qat/qat_adf/icp_qat_fw_la.h
+++ b/drivers/common/qat/qat_adf/icp_qat_fw_la.h
@@ -357,7 +357,7 @@ struct icp_qat_fw_cipher_auth_cd_ctrl_hdr {
#define ICP_QAT_FW_HASH_REQUEST_PARAMETERS_OFFSET 24
#define ICP_QAT_FW_CIPHER_REQUEST_PARAMETERS_OFFSET (0)
-struct icp_qat_fw_la_cipher_req_params {
+__rte_packed_begin struct icp_qat_fw_la_cipher_req_params {
uint32_t cipher_offset;
uint32_t cipher_length;
union {
@@ -372,9 +372,9 @@ struct icp_qat_fw_la_cipher_req_params {
uint16_t spc_aad_sz;
uint8_t reserved;
uint8_t spc_auth_res_sz;
-} __rte_packed;
+} __rte_packed_end;
-struct icp_qat_fw_la_auth_req_params {
+__rte_packed_begin struct icp_qat_fw_la_auth_req_params {
uint32_t auth_off;
uint32_t auth_len;
union {
@@ -389,7 +389,7 @@ struct icp_qat_fw_la_auth_req_params {
uint8_t resrvd1;
uint8_t hash_state_sz;
uint8_t auth_res_sz;
-} __rte_packed;
+} __rte_packed_end;
struct icp_qat_fw_la_auth_req_params_resrvd_flds {
uint32_t resrvd[ICP_QAT_FW_NUM_LONGWORDS_6];
diff --git a/drivers/common/qat/qat_common.h b/drivers/common/qat/qat_common.h
index 703534dc15..272a799640 100644
--- a/drivers/common/qat/qat_common.h
+++ b/drivers/common/qat/qat_common.h
@@ -57,11 +57,11 @@ enum qat_svc_list {
};
/**< Common struct for scatter-gather list operations */
-struct qat_flat_buf {
+__rte_packed_begin struct qat_flat_buf {
uint32_t len;
uint32_t resrvd;
uint64_t addr;
-} __rte_packed;
+} __rte_packed_end;
#define qat_sgl_hdr struct { \
uint64_t resrvd; \
@@ -70,11 +70,11 @@ struct qat_flat_buf {
}
__extension__
-struct __rte_cache_aligned qat_sgl {
+__rte_packed_begin struct __rte_cache_aligned qat_sgl {
qat_sgl_hdr;
/* flexible array of flat buffers*/
struct qat_flat_buf buffers[0];
-} __rte_packed;
+} __rte_packed_end;
/** Common, i.e. not service-specific, statistics */
struct qat_common_stats {
--
2.34.1
next prev parent reply other threads:[~2024-11-27 0:53 UTC|newest]
Thread overview: 132+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-20 21:05 [PATCH 00/15] fix packing of structs when building with MSVC Tyler Retzlaff
2024-03-20 21:05 ` [PATCH 01/15] eal: provide pack start macro for MSVC Tyler Retzlaff
2024-03-20 21:05 ` [PATCH 02/15] eal: pack structures when building with MSVC Tyler Retzlaff
2024-03-21 16:02 ` Bruce Richardson
2024-03-20 21:05 ` [PATCH 03/15] net: " Tyler Retzlaff
2024-10-07 1:14 ` Stephen Hemminger
2024-03-20 21:06 ` [PATCH 04/15] common/iavf: " Tyler Retzlaff
2024-03-20 21:06 ` [PATCH 05/15] common/idpf: " Tyler Retzlaff
2024-03-20 21:06 ` [PATCH 06/15] common/mlx5: " Tyler Retzlaff
2024-03-20 21:06 ` [PATCH 07/15] dma/ioat: " Tyler Retzlaff
2024-03-21 16:13 ` Bruce Richardson
2024-03-27 22:51 ` Tyler Retzlaff
2024-03-20 21:06 ` [PATCH 08/15] net/i40e: " Tyler Retzlaff
2024-03-20 21:06 ` [PATCH 09/15] net/iavf: " Tyler Retzlaff
2024-03-21 16:26 ` Bruce Richardson
2024-03-20 21:06 ` [PATCH 10/15] net/ice: " Tyler Retzlaff
2024-03-20 21:06 ` [PATCH 11/15] net/mlx5: " Tyler Retzlaff
2024-03-20 21:06 ` [PATCH 12/15] net/octeon_ep: " Tyler Retzlaff
2024-03-20 21:06 ` [PATCH 13/15] app/testpmd: " Tyler Retzlaff
2024-03-21 16:28 ` Bruce Richardson
2024-03-20 21:06 ` [PATCH 14/15] app/test: " Tyler Retzlaff
2024-03-20 21:06 ` [PATCH 15/15] examples: " Tyler Retzlaff
2024-03-21 16:31 ` Bruce Richardson
2024-03-21 15:32 ` [PATCH 00/15] fix packing of structs " Stephen Hemminger
2024-03-21 15:46 ` Tyler Retzlaff
2024-03-27 23:09 ` [PATCH v2 " Tyler Retzlaff
2024-03-27 23:09 ` [PATCH v2 01/15] eal: provide pack start macro for MSVC Tyler Retzlaff
2024-03-27 23:09 ` [PATCH v2 02/15] eal: pack structures when building with MSVC Tyler Retzlaff
2024-03-27 23:09 ` [PATCH v2 03/15] net: " Tyler Retzlaff
2024-03-27 23:09 ` [PATCH v2 04/15] common/iavf: " Tyler Retzlaff
2024-03-27 23:09 ` [PATCH v2 05/15] common/idpf: " Tyler Retzlaff
2024-03-27 23:09 ` [PATCH v2 06/15] common/mlx5: " Tyler Retzlaff
2024-03-27 23:09 ` [PATCH v2 07/15] dma/ioat: " Tyler Retzlaff
2024-03-27 23:09 ` [PATCH v2 08/15] net/i40e: " Tyler Retzlaff
2024-03-27 23:09 ` [PATCH v2 09/15] net/iavf: " Tyler Retzlaff
2024-03-27 23:09 ` [PATCH v2 10/15] net/ice: " Tyler Retzlaff
2024-03-27 23:09 ` [PATCH v2 11/15] net/mlx5: " Tyler Retzlaff
2024-03-27 23:09 ` [PATCH v2 12/15] net/octeon_ep: " Tyler Retzlaff
2024-03-27 23:09 ` [PATCH v2 13/15] app/testpmd: " Tyler Retzlaff
2024-03-27 23:09 ` [PATCH v2 14/15] app/test: " Tyler Retzlaff
2024-03-27 23:09 ` [PATCH v2 15/15] examples: " Tyler Retzlaff
2024-04-15 23:51 ` [PATCH v3 00/16] fix packing of structs " Tyler Retzlaff
2024-04-15 23:51 ` [PATCH v3 01/16] eal: provide pack start macro for MSVC Tyler Retzlaff
2024-04-15 23:51 ` [PATCH v3 02/16] eal: pack structures when building with MSVC Tyler Retzlaff
2024-04-15 23:51 ` [PATCH v3 03/16] net: " Tyler Retzlaff
2024-04-15 23:51 ` [PATCH v3 04/16] common/iavf: " Tyler Retzlaff
2024-04-15 23:51 ` [PATCH v3 05/16] common/idpf: " Tyler Retzlaff
2024-04-15 23:51 ` [PATCH v3 06/16] common/mlx5: " Tyler Retzlaff
2024-04-15 23:51 ` [PATCH v3 07/16] dma/ioat: " Tyler Retzlaff
2024-04-15 23:51 ` [PATCH v3 08/16] net/i40e: " Tyler Retzlaff
2024-04-15 23:51 ` [PATCH v3 09/16] net/iavf: " Tyler Retzlaff
2024-04-15 23:51 ` [PATCH v3 10/16] net/ice: " Tyler Retzlaff
2024-04-15 23:51 ` [PATCH v3 11/16] net/mlx5: " Tyler Retzlaff
2024-04-15 23:51 ` [PATCH v3 12/16] net/octeon_ep: " Tyler Retzlaff
2024-04-15 23:51 ` [PATCH v3 13/16] app/testpmd: " Tyler Retzlaff
2024-04-15 23:51 ` [PATCH v3 14/16] app/test: " Tyler Retzlaff
2024-04-15 23:51 ` [PATCH v3 15/16] examples: " Tyler Retzlaff
2024-04-15 23:51 ` [PATCH v3 16/16] crypto/mlx5: " Tyler Retzlaff
2024-04-16 0:04 ` [PATCH v4 00/16] fix packing of structs " Tyler Retzlaff
2024-04-16 0:04 ` [PATCH v4 01/16] eal: provide pack start macro for MSVC Tyler Retzlaff
2024-04-16 0:04 ` [PATCH v4 02/16] eal: pack structures when building with MSVC Tyler Retzlaff
2024-04-16 0:05 ` [PATCH v4 03/16] net: " Tyler Retzlaff
2024-04-16 0:05 ` [PATCH v4 04/16] common/iavf: " Tyler Retzlaff
2024-04-16 0:05 ` [PATCH v4 05/16] common/idpf: " Tyler Retzlaff
2024-04-16 0:05 ` [PATCH v4 06/16] common/mlx5: " Tyler Retzlaff
2024-04-16 0:05 ` [PATCH v4 07/16] dma/ioat: " Tyler Retzlaff
2024-04-16 0:05 ` [PATCH v4 08/16] net/i40e: " Tyler Retzlaff
2024-04-16 0:05 ` [PATCH v4 09/16] net/iavf: " Tyler Retzlaff
2024-04-16 0:05 ` [PATCH v4 10/16] net/ice: " Tyler Retzlaff
2024-04-16 0:05 ` [PATCH v4 11/16] net/mlx5: " Tyler Retzlaff
2024-04-16 0:05 ` [PATCH v4 12/16] net/octeon_ep: " Tyler Retzlaff
2024-04-16 0:05 ` [PATCH v4 13/16] app/testpmd: " Tyler Retzlaff
2024-04-16 0:05 ` [PATCH v4 14/16] app/test: " Tyler Retzlaff
2024-04-16 0:05 ` [PATCH v4 15/16] examples: " Tyler Retzlaff
2024-04-16 0:05 ` [PATCH v4 16/16] crypto/mlx5: " Tyler Retzlaff
2024-11-19 4:35 ` [PATCH v5 00/16] fix packing of structs " Andre Muezerie
2024-11-19 4:35 ` [PATCH v5 01/16] eal: provide pack start macro for MSVC Andre Muezerie
2024-11-19 8:32 ` Morten Brørup
2024-11-19 11:00 ` Konstantin Ananyev
2024-11-19 16:23 ` Andre Muezerie
2024-11-21 19:39 ` Andre Muezerie
2024-11-21 20:51 ` Thomas Monjalon
2024-11-22 0:11 ` Andre Muezerie
2024-11-22 8:13 ` Morten Brørup
2024-11-25 22:15 ` Andre Muezerie
2024-11-19 4:35 ` [PATCH v5 02/16] eal: pack structures when building with MSVC Andre Muezerie
2024-11-19 4:35 ` [PATCH v5 03/16] net: " Andre Muezerie
2024-11-19 4:35 ` [PATCH v5 04/16] common/iavf: " Andre Muezerie
2024-11-19 4:35 ` [PATCH v5 05/16] common/idpf: " Andre Muezerie
2024-11-19 4:35 ` [PATCH v5 06/16] common/mlx5: " Andre Muezerie
2024-11-19 4:35 ` [PATCH v5 07/16] dma/ioat: " Andre Muezerie
2024-11-19 4:35 ` [PATCH v5 08/16] net/i40e: " Andre Muezerie
2024-11-19 4:35 ` [PATCH v5 09/16] net/iavf: " Andre Muezerie
2024-11-19 4:35 ` [PATCH v5 10/16] net/ice: " Andre Muezerie
2024-11-19 4:35 ` [PATCH v5 11/16] net/mlx5: " Andre Muezerie
2024-11-19 4:35 ` [PATCH v5 12/16] net/octeon_ep: " Andre Muezerie
2024-11-19 4:35 ` [PATCH v5 13/16] app/testpmd: " Andre Muezerie
2024-11-19 4:35 ` [PATCH v5 14/16] app/test: " Andre Muezerie
2024-11-19 4:35 ` [PATCH v5 15/16] examples: " Andre Muezerie
2024-11-19 4:35 ` [PATCH v5 16/16] crypto/mlx5: " Andre Muezerie
2024-11-20 21:13 ` [PATCH v5 00/16] fix packing of structs " Patrick Robb
2024-11-27 0:52 ` [PATCH v6 00/30] " Andre Muezerie
2024-11-27 0:52 ` [PATCH v6 01/30] devtools: check packed attributes Andre Muezerie
2024-11-27 0:52 ` [PATCH v6 02/30] eal/include: add new packing macros Andre Muezerie
2024-11-27 0:52 ` [PATCH v6 03/30] app/test-pmd: remove unnecessary packed attributes Andre Muezerie
2024-11-27 0:52 ` [PATCH v6 04/30] app/test: replace " Andre Muezerie
2024-11-27 0:52 ` [PATCH v6 05/30] doc/guides: " Andre Muezerie
2024-11-27 0:52 ` [PATCH v6 06/30] drivers/baseband: " Andre Muezerie
2024-11-27 0:52 ` [PATCH v6 07/30] drivers/bus: " Andre Muezerie
2024-11-27 0:52 ` Andre Muezerie [this message]
2024-11-27 0:52 ` [PATCH v6 09/30] drivers/compress: " Andre Muezerie
2024-11-27 0:52 ` [PATCH v6 10/30] drivers/crypto: " Andre Muezerie
2024-11-27 0:52 ` [PATCH v6 11/30] drivers/dma: " Andre Muezerie
2024-11-27 0:52 ` [PATCH v6 12/30] drivers/event: " Andre Muezerie
2024-11-27 0:52 ` [PATCH v6 13/30] drivers/mempool: " Andre Muezerie
2024-11-27 0:52 ` [PATCH v6 14/30] drivers/net: " Andre Muezerie
2024-11-27 0:52 ` [PATCH v6 15/30] drivers/raw: " Andre Muezerie
2024-11-27 0:52 ` [PATCH v6 16/30] drivers/regex: " Andre Muezerie
2024-11-27 0:52 ` [PATCH v6 17/30] drivers/vdpa: " Andre Muezerie
2024-11-27 0:52 ` [PATCH v6 18/30] examples/common: " Andre Muezerie
2024-11-27 0:52 ` [PATCH v6 19/30] examples/ip-pipeline: remove " Andre Muezerie
2024-11-27 0:52 ` [PATCH v6 20/30] examples/ipsec_secgw: replace " Andre Muezerie
2024-11-27 0:52 ` [PATCH v6 21/30] examples/l3fwd-power: " Andre Muezerie
2024-11-27 0:52 ` [PATCH v6 22/30] examples/l3fwd: " Andre Muezerie
2024-11-27 0:52 ` [PATCH v6 23/30] examples/ptpclient: " Andre Muezerie
2024-11-27 0:52 ` [PATCH v6 24/30] examples/vhost_blk: " Andre Muezerie
2024-11-27 0:52 ` [PATCH v6 25/30] lib/eal: " Andre Muezerie
2024-11-27 0:52 ` [PATCH v6 26/30] lib/ipsec: " Andre Muezerie
2024-11-27 0:52 ` [PATCH v6 27/30] lib/net: " Andre Muezerie
2024-11-27 0:52 ` [PATCH v6 28/30] lib/pipeline: " Andre Muezerie
2024-11-27 0:52 ` [PATCH v6 29/30] lib/vhost: " Andre Muezerie
2024-11-27 0:52 ` [PATCH v6 30/30] lib/eal: remove __rte_packed Andre Muezerie
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=1732668761-5556-9-git-send-email-andremue@linux.microsoft.com \
--to=andremue@linux.microsoft.com \
--cc=aman.deep.singh@intel.com \
--cc=anatoly.burakov@intel.com \
--cc=bruce.richardson@intel.com \
--cc=byron.marohn@intel.com \
--cc=conor.walsh@intel.com \
--cc=cristian.dumitrescu@intel.com \
--cc=david.hunt@intel.com \
--cc=dev@dpdk.org \
--cc=dsosnowski@nvidia.com \
--cc=gakhil@marvell.com \
--cc=jerinj@marvell.com \
--cc=jingjing.wu@intel.com \
--cc=kirill.rybalchenko@intel.com \
--cc=konstantin.v.ananyev@yandex.ru \
--cc=matan@nvidia.com \
--cc=orika@nvidia.com \
--cc=radu.nicolau@intel.com \
--cc=roretzla@linux.microsoft.com \
--cc=ruifeng.wang@arm.com \
--cc=sameh.gobriel@intel.com \
--cc=sivaprasad.tummala@amd.com \
--cc=skori@marvell.com \
--cc=stephen@networkplumber.org \
--cc=suanmingm@nvidia.com \
--cc=vattunuru@marvell.com \
--cc=viacheslavo@nvidia.com \
--cc=vladimir.medvedkin@intel.com \
--cc=yipeng1.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).