replace packed attributes

There is a common macro __rte_packed for packing structs,
which is now used where appropriate for consistency.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
This commit is contained in:
Thomas Monjalon 2020-02-09 18:29:23 +01:00
parent f35e5b3e07
commit ef5baf3486
63 changed files with 604 additions and 602 deletions

View File

@ -86,7 +86,7 @@ struct testpmd_offload_info {
struct simple_gre_hdr {
uint16_t flags;
uint16_t proto;
} __attribute__((__packed__));
} __rte_packed;
static uint16_t
get_udptcp_checksum(void *l3_hdr, void *l4_hdr, uint16_t ethertype)

View File

@ -30,7 +30,7 @@ struct flow_key {
uint16_t port_src;
uint16_t port_dst;
uint8_t proto;
} __attribute__((packed));
} __rte_packed;
int efd_logtype_test;

View File

@ -67,7 +67,7 @@ struct flow_key {
uint16_t port_src;
uint16_t port_dst;
uint8_t proto;
} __attribute__((packed));
} __rte_packed;
int hash_logtype_test;

View File

@ -25,7 +25,7 @@ struct flow_key {
uint16_t port_src;
uint16_t port_dst;
uint8_t proto;
} __attribute__((packed));
} __rte_packed;
/* Set ID Macros for multimatch test usage */
#define M_MATCH_S 1 /* Not start with 0 since by default 0 means no match */

View File

@ -161,7 +161,7 @@ To define classification for the IPv6 2-tuple: <protocol, IPv6 source address> o
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). */
} __attribute__((__packed__));
} __rte_packed;
The following array of field definitions can be used:

View File

@ -114,7 +114,7 @@ enum {
};
/* FPGA LTE FEC DMA Encoding Request Descriptor */
struct __attribute__((__packed__)) fpga_dma_enc_desc {
struct __rte_packed fpga_dma_enc_desc {
uint32_t done:1,
rsrvd0:11,
error:4,
@ -151,7 +151,7 @@ struct __attribute__((__packed__)) fpga_dma_enc_desc {
};
/* FPGA LTE FEC DMA Decoding Request Descriptor */
struct __attribute__((__packed__)) fpga_dma_dec_desc {
struct __rte_packed fpga_dma_dec_desc {
uint32_t done:1,
iter:5,
rsrvd0:2,
@ -197,7 +197,7 @@ union fpga_dma_desc {
};
/* FPGA LTE FEC Ring Control Register */
struct __attribute__((__packed__)) fpga_ring_ctrl_reg {
struct __rte_packed fpga_ring_ctrl_reg {
uint64_t ring_base_addr;
uint64_t ring_head_addr;
uint16_t ring_size:11;

View File

@ -40,7 +40,7 @@ struct fm_status_t {
unsigned int phe:1; /* Header Error during parsing */
unsigned int frdr:1; /* Frame Dropped by disabled port */
unsigned int reserved5:4;
} __attribute__ ((__packed__));
} __rte_packed;
/* Set MAC address for a particular interface */
int fman_if_add_mac_addr(struct fman_if *p, uint8_t *eth, uint8_t addr_num);

View File

@ -37,7 +37,7 @@ TAILQ_HEAD(ifpga_afu_drv_list, rte_afu_driver);
struct rte_afu_uuid {
uint64_t uuid_low;
uint64_t uuid_high;
} __attribute__ ((packed));
} __rte_packed;
#define IFPGA_BUS_DEV_PORT_MAX 4
@ -48,7 +48,7 @@ struct rte_afu_uuid {
struct rte_afu_id {
struct rte_afu_uuid uuid;
int port; /**< port number */
} __attribute__ ((packed));
} __rte_packed;
/**
* A structure PR (Partial Reconfiguration) configuration AFU driver.
@ -82,7 +82,7 @@ struct rte_afu_device {
struct rte_intr_handle intr_handle; /**< Interrupt handle */
struct rte_afu_driver *driver; /**< Associated driver */
char path[IFPGA_BUS_BITSTREAM_PATH_MAX_LEN];
} __attribute__ ((packed));
} __rte_packed;
/**
* @internal

View File

@ -149,12 +149,12 @@ struct iavf_dma_mem {
u64 pa;
u32 size;
const void *zone;
} __attribute__((packed));
} __rte_packed;
struct iavf_virt_mem {
void *va;
u32 size;
} __attribute__((packed));
} __rte_packed;
/* SW spinlock */
struct iavf_spinlock {

View File

@ -263,7 +263,7 @@ struct load_command_s {
*/
struct sec_sd_t {
uint32_t rsvd[MAX_DESC_SIZE_WORDS];
} __attribute__((packed) __rte_aligned(64);
} __rte_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) __rte_aligned(64);
} __rte_packed __rte_aligned(64);
#endif

View File

@ -46,20 +46,20 @@ struct octeontx_mbox_fpa_cfg {
uint64_t aura_cfg;
};
struct __attribute__((__packed__)) gen_req {
struct __rte_packed gen_req {
uint32_t value;
};
struct __attribute__((__packed__)) idn_req {
struct __rte_packed idn_req {
uint8_t domain_id;
};
struct __attribute__((__packed__)) gen_resp {
struct __rte_packed gen_resp {
uint16_t domain_id;
uint16_t vfid;
};
struct __attribute__((__packed__)) dcfg_resp {
struct __rte_packed dcfg_resp {
uint8_t sso_count;
uint8_t ssow_count;
uint8_t fpa_count;

View File

@ -37,7 +37,7 @@ struct ark_pkt_chkr_stat_regs {
uint32_t pkts_missing;
uint32_t min_latency;
uint32_t max_latency;
} __attribute__ ((packed));
} __rte_packed;
struct ark_pkt_chkr_ctl_regs {
uint32_t pkt_ctrl;
@ -53,7 +53,7 @@ struct ark_pkt_chkr_ctl_regs {
uint32_t dst_mac_addr_h;
uint32_t eth_type;
uint32_t hdr_dw[7];
} __attribute__ ((packed));
} __rte_packed;
struct ark_pkt_chkr_inst {
struct rte_eth_dev_info *dev_info;

View File

@ -26,7 +26,7 @@ struct ark_pkt_dir_regs {
uint32_t ctrl;
uint32_t status;
uint32_t stall_cnt;
} __attribute__ ((packed));
} __rte_packed;
struct ark_pkt_dir_inst {
volatile struct ark_pkt_dir_regs *regs;

View File

@ -41,7 +41,7 @@ struct ark_pkt_gen_regs {
uint32_t hdr_dw[7];
uint32_t start_offset;
uint32_t bytes_per_cycle;
} __attribute__ ((packed));
} __rte_packed;
struct ark_pkt_gen_inst {
struct rte_eth_dev_info *dev_info;

View File

@ -12,6 +12,8 @@
#include <netinet/in.h>
#include <pthread.h>
#include <rte_common.h>
typedef uint8_t u8;
typedef int8_t s8;
typedef uint16_t u16;

View File

@ -27,10 +27,10 @@ struct hw_atl_txd_s {
u32 ct_idx:1;
u32 ct_en:1;
u32 pay_len:18;
} __attribute__((__packed__));
} __rte_packed;
u64 flags;
};
} __attribute__((__packed__));
} __rte_packed;
/* Hardware tx context descriptor */
union hw_atl_txc_s {
@ -51,8 +51,8 @@ union hw_atl_txc_s {
u32 l3_len:9;
u32 l4_len:8;
u32 mss_len:16;
} __attribute__((__packed__));
} __attribute__((__packed__));
} __rte_packed;
} __rte_packed;
enum aq_tx_desc_type {
tx_desc_type_desc = 1,
@ -73,7 +73,7 @@ enum aq_tx_desc_cmd {
struct hw_atl_rxd_s {
u64 buf_addr;
u64 hdr_addr;
} __attribute__((__packed__));
} __rte_packed;
/* Hardware rx descriptor writeback */
struct hw_atl_rxd_wb_s {
@ -89,7 +89,7 @@ struct hw_atl_rxd_wb_s {
u16 pkt_len;
u16 next_desc_ptr;
u16 vlan;
} __attribute__((__packed__));
} __rte_packed;
struct hw_atl_stats_s {
u32 uprc;
@ -107,7 +107,7 @@ struct hw_atl_stats_s {
u32 ubrc;
u32 ubtc;
u32 dpc;
} __attribute__((__packed__));
} __rte_packed;
union ip_addr {
struct {
@ -117,7 +117,7 @@ union ip_addr {
u8 padding[12];
u8 addr[4];
} v4;
} __attribute__((__packed__));
} __rte_packed;
struct hw_aq_atl_utils_fw_rpc {
u32 msg_id;
@ -226,13 +226,13 @@ struct hw_aq_atl_utils_fw_rpc {
} msg_del_id;
};
} __attribute__((__packed__));
} __rte_packed;
struct hw_aq_atl_utils_mbox_header {
u32 version;
u32 transaction_id;
u32 error;
} __attribute__((__packed__));
} __rte_packed;
struct hw_aq_info {
u8 reserved[6];
@ -244,13 +244,13 @@ struct hw_aq_info {
u8 reserved2[32];
u32 caps_lo;
u32 caps_hi;
} __attribute__((__packed__));
} __rte_packed;
struct hw_aq_atl_utils_mbox {
struct hw_aq_atl_utils_mbox_header header;
struct hw_atl_stats_s stats;
struct hw_aq_info info;
} __attribute__((__packed__));
} __rte_packed;
/* fw2x */
typedef u16 in_port_t;
@ -261,7 +261,7 @@ typedef u32 fw_offset_t;
struct ip6_addr {
u32 addr[4];
} __attribute__((__packed__));
} __rte_packed;
struct offload_ka_v4 {
u32 timeout;
@ -273,7 +273,7 @@ struct offload_ka_v4 {
u32 ack_num;
ip4_addr_t local_ip;
ip4_addr_t remote_ip;
} __attribute__((__packed__));
} __rte_packed;
struct offload_ka_v6 {
u32 timeout;
@ -285,7 +285,7 @@ struct offload_ka_v6 {
u32 ack_num;
struct ip6_addr local_ip;
struct ip6_addr remote_ip;
} __attribute__((__packed__));
} __rte_packed;
struct offload_ip_info {
u8 v4_local_addr_count;
@ -296,14 +296,14 @@ struct offload_ip_info {
fw_offset_t v4_prefix;
fw_offset_t v6_addr;
fw_offset_t v6_prefix;
} __attribute__((__packed__));
} __rte_packed;
struct offload_port_info {
u16 udp_port_count;
u16 tcp_port_count;
fw_offset_t udp_port;
fw_offset_t tcp_port;
} __attribute__((__packed__));
} __rte_packed;
struct offload_ka_info {
u16 v4_ka_count;
@ -312,14 +312,14 @@ struct offload_ka_info {
u32 retry_interval;
fw_offset_t v4_ka;
fw_offset_t v6_ka;
} __attribute__((__packed__));
} __rte_packed;
struct offload_rr_info {
u32 rr_count;
u32 rr_buf_len;
fw_offset_t rr_id_x;
fw_offset_t rr_buf;
} __attribute__((__packed__));
} __rte_packed;
struct offload_info {
u32 version; // current version is 0x00000000
@ -335,14 +335,14 @@ struct offload_info {
struct offload_ka_info kas;
struct offload_rr_info rrs;
u8 buf[0];
} __attribute__((__packed__));
} __rte_packed;
struct smbus_request {
u32 msg_id; /* not used */
u32 device_id;
u32 address;
u32 length;
} __attribute__((__packed__));
} __rte_packed;
enum macsec_msg_type {
macsec_cfg_msg = 0,
@ -358,7 +358,7 @@ struct macsec_cfg {
uint32_t egress_threshold;
uint32_t ingress_threshold;
uint32_t interrupts_enabled;
} __attribute__((__packed__));
} __rte_packed;
struct add_rx_sc {
uint32_t index;
@ -376,7 +376,7 @@ struct add_rx_sc {
uint32_t anti_replay_window; /* default 0 */
/* 1: auto_rollover enabled (when SA next_pn is saturated */
uint32_t an_rol;
} __attribute__((__packed__));
} __rte_packed;
struct add_tx_sc {
uint32_t index;
@ -391,26 +391,26 @@ struct add_tx_sc {
uint32_t da_mask; /* 0: ignore mac_da */
uint32_t protect;
uint32_t curr_an; /* SA index which currently used */
} __attribute__((__packed__));
} __rte_packed;
struct add_rx_sa {
uint32_t index;
uint32_t next_pn;
uint32_t key[4]; /* 128 bit key */
} __attribute__((__packed__));
} __rte_packed;
struct add_tx_sa {
uint32_t index;
uint32_t next_pn;
uint32_t key[4]; /* 128 bit key */
} __attribute__((__packed__));
} __rte_packed;
struct get_stats {
uint32_t version_only;
uint32_t ingress_sa_index;
uint32_t egress_sa_index;
uint32_t egress_sc_index;
} __attribute__((__packed__));
} __rte_packed;
struct macsec_stats {
uint32_t api_version;
@ -471,7 +471,7 @@ struct macsec_stats {
uint32_t ingress_threshold_expired;
uint32_t egress_expired;
uint32_t ingress_expired;
} __attribute__((__packed__));
} __rte_packed;
struct macsec_msg_fw_request {
uint32_t offset; /* not used */
@ -485,12 +485,12 @@ struct macsec_msg_fw_request {
struct add_tx_sa txsa;
struct get_stats stats;
};
} __attribute__((__packed__));
} __rte_packed;
struct macsec_msg_fw_response {
uint32_t result;
struct macsec_stats stats;
} __attribute__((__packed__));
} __rte_packed;
#define HAL_ATLANTIC_UTILS_CHIP_MIPS 0x00000001U
#define HAL_ATLANTIC_UTILS_CHIP_TPO2 0x00000002U

View File

@ -40,7 +40,7 @@
struct fw2x_msg_wol_pattern {
u8 mask[16];
u32 crc;
} __attribute__((__packed__));
} __rte_packed;
struct fw2x_msg_wol {
u32 msg_id;
@ -53,7 +53,7 @@ struct fw2x_msg_wol {
u16 reserved;
u32 link_up_timeout;
u32 link_down_timeout;
} __attribute__((__packed__));
} __rte_packed;
static int aq_fw2x_set_link_speed(struct aq_hw_s *self, u32 speed);
static int aq_fw2x_set_state(struct aq_hw_s *self,

View File

@ -69,7 +69,7 @@ struct rte_avp_device_config {
uint16_t num_tx_queues; /**< Number of active transmit queues */
uint16_t num_rx_queues; /**< Number of active receive queues */
uint8_t if_up; /**< 1: interface up, 0: interface down */
} __attribute__ ((__packed__));
} __rte_packed;
/*
* Structure for AVP request.
@ -83,7 +83,7 @@ struct rte_avp_request {
struct rte_avp_device_config config; /**< Queue configuration */
};
int32_t result; /**< Result for processing request */
} __attribute__ ((__packed__));
} __rte_packed;
/*
* FIFO struct mapped in a shared memory. It describes a circular buffer FIFO
@ -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__ ((__packed__)) __rte_cache_aligned;
} __rte_packed __rte_cache_aligned;
/**{ AVP device features */

View File

@ -188,13 +188,13 @@ enum bnxt_hw_context {
struct bnxt_vlan_table_entry {
uint16_t tpid;
uint16_t vid;
} __attribute__((packed));
} __rte_packed;
struct bnxt_vlan_antispoof_table_entry {
uint16_t tpid;
uint16_t vid;
uint16_t mask;
} __attribute__((packed));
} __rte_packed;
struct bnxt_child_vf_info {
void *req_buf;

File diff suppressed because it is too large Load Diff

View File

@ -54,13 +54,13 @@ enum rte_bond_8023ad_agg_selection {
struct slow_protocol {
uint8_t subtype;
uint8_t reserved_119[119];
} __attribute__((__packed__));
} __rte_packed;
/** Generic slow protocol frame type structure */
struct slow_protocol_frame {
struct rte_ether_hdr eth_hdr;
struct slow_protocol slow_protocol;
} __attribute__((__packed__)) __rte_aligned(2);
} __rte_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__)) __rte_aligned(2);
} __rte_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__)) __rte_aligned(2);
} __rte_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__)) __rte_aligned(2);
} __rte_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__)) __rte_aligned(2);
} __rte_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__)) __rte_aligned(2);
} __rte_packed __rte_aligned(2);
struct marker_header {
struct rte_ether_hdr eth_hdr;
struct marker marker;
} __attribute__((__packed__)) __rte_aligned(2);
} __rte_packed __rte_aligned(2);
struct rte_eth_bond_8023ad_conf {
uint32_t fast_periodic_ms;

View File

@ -170,8 +170,8 @@ struct dpaa_eth_parse_results_t {
uint16_t vlan:1;
uint16_t ethernet:1;
#endif
} __attribute__((__packed__));
} __attribute__((__packed__));
} __rte_packed;
} __rte_packed;
union {
uint16_t l3r; /**< Layer 3 result */
struct {
@ -198,8 +198,8 @@ struct dpaa_eth_parse_results_t {
uint16_t first_ipv6:1;
uint16_t first_ipv4:1;
#endif
} __attribute__((__packed__));
} __attribute__((__packed__));
} __rte_packed;
} __rte_packed;
union {
uint8_t l4r; /**< Layer 4 result */
struct{
@ -214,8 +214,8 @@ struct dpaa_eth_parse_results_t {
uint8_t l4_info_err:1;
uint8_t l4_type:3;
#endif
} __attribute__((__packed__));
} __attribute__((__packed__));
} __rte_packed;
} __rte_packed;
uint8_t cplan; /**< Classification plan id */
uint16_t nxthdr; /**< Next Header */
uint16_t cksum; /**< Checksum */
@ -231,7 +231,7 @@ struct dpaa_eth_parse_results_t {
uint8_t gre_off; /**< GRE offset */
uint8_t l4_off; /**< Layer 4 offset */
uint8_t nxthdr_off; /**< Parser end point */
} __attribute__ ((__packed__));
} __rte_packed;
/* The structure is the Prepended Data to the Frame which is used by FMAN */
struct annotations_t {

View File

@ -37,7 +37,7 @@ struct dpaa2_fas {
uint8_t ppid;
__le16 ifpid;
__le32 status;
} __attribute__((__packed__));
} __rte_packed;
/**
* HW Packet Annotation Register structures

View File

@ -772,7 +772,7 @@ struct filter_usnic_id {
uint16_t ethtype;
uint8_t proto_version;
uint32_t usnic_id;
} __attribute__((packed));
} __rte_packed;
#define FILTER_FIELD_5TUP_PROTO FILTER_FIELD_VALID(1)
#define FILTER_FIELD_5TUP_SRC_AD FILTER_FIELD_VALID(2)
@ -801,7 +801,7 @@ struct filter_ipv4_5tuple {
uint32_t dst_addr;
uint16_t src_port;
uint16_t dst_port;
} __attribute__((packed));
} __rte_packed;
#define FILTER_FIELD_VMQ_VLAN FILTER_FIELD_VALID(1)
#define FILTER_FIELD_VMQ_MAC FILTER_FIELD_VALID(2)
@ -815,7 +815,7 @@ struct filter_mac_vlan {
uint32_t flags;
uint16_t vlan;
uint8_t mac_addr[6];
} __attribute__((packed));
} __rte_packed;
#define FILTER_FIELD_VLAN_IP_3TUP_VLAN FILTER_FIELD_VALID(1)
#define FILTER_FIELD_VLAN_IP_3TUP_L3_PROTO FILTER_FIELD_VALID(2)
@ -839,7 +839,7 @@ struct filter_vlan_ip_3tuple {
} u;
uint32_t l4_protocol;
uint16_t dst_port;
} __attribute__((packed));
} __rte_packed;
#define FILTER_GENERIC_1_BYTES 64
@ -877,8 +877,8 @@ struct filter_generic_1 {
* " don't care"
*/
uint8_t val[FILTER_GENERIC_1_KEY_LEN];
} __attribute__((packed)) layer[FILTER_GENERIC_1_NUM_LAYERS];
} __attribute__((packed));
} __rte_packed layer[FILTER_GENERIC_1_NUM_LAYERS];
} __rte_packed;
/* Specifies the filter_action type. */
enum {
@ -892,7 +892,7 @@ struct filter_action {
union {
uint32_t rq_idx;
} u;
} __attribute__((packed));
} __rte_packed;
#define FILTER_ACTION_RQ_STEERING_FLAG (1 << 0)
#define FILTER_ACTION_FILTER_ID_FLAG (1 << 1)
@ -911,7 +911,7 @@ struct filter_action_v2 {
uint32_t flags; /* use FILTER_ACTION_XXX_FLAG defines */
uint16_t filter_id;
uint8_t reserved[32]; /* for future expansion */
} __attribute__((packed));
} __rte_packed;
/* Specifies the filter type. */
enum filter_type {
@ -949,7 +949,7 @@ struct filter {
struct filter_mac_vlan mac_vlan;
struct filter_vlan_ip_3tuple vlan_3tuple;
} u;
} __attribute__((packed));
} __rte_packed;
/*
* This is a strict superset of "struct filter" and exists only
@ -969,7 +969,7 @@ struct filter_v2 {
struct filter_vlan_ip_3tuple vlan_3tuple;
struct filter_generic_1 generic_1;
} u;
} __attribute__((packed));
} __rte_packed;
enum {
CLSF_TLV_FILTER = 0,

View File

@ -158,7 +158,7 @@ struct i40e_dma_mem {
u64 pa;
u32 size;
const void *zone;
} __attribute__((packed));
} __rte_packed;
#define i40e_allocate_dma_mem(h, m, unused, s, a) \
i40e_allocate_dma_mem_d(h, m, s, a)
@ -167,7 +167,7 @@ struct i40e_dma_mem {
struct i40e_virt_mem {
void *va;
u32 size;
} __attribute__((packed));
} __rte_packed;
#define i40e_allocate_virt_mem(h, m, s) i40e_allocate_virt_mem_d(h, m, s)
#define i40e_free_virt_mem(h, m) i40e_free_virt_mem_d(h, m)

View File

@ -126,7 +126,7 @@ writeq(uint64_t value, volatile void *addr)
#define __maybe_unused __attribute__((unused))
#endif
#ifndef __packed
#define __packed __attribute__((packed))
#define __packed __rte_packed
#endif
#ifndef BIT_ULL
@ -180,12 +180,12 @@ struct ice_dma_mem {
u64 pa;
u32 size;
const void *zone;
} __attribute__((packed));
} __rte_packed;
struct ice_virt_mem {
void *va;
u32 size;
} __attribute__((packed));
} __rte_packed;
#define ice_malloc(h, s) rte_zmalloc(NULL, s, 0)
#define ice_calloc(h, c, s) rte_zmalloc(NULL, (c) * (s), 0)

View File

@ -182,7 +182,7 @@ struct nfp_net_tx_desc {
__le16 vlan; /* VLAN tag to add if indicated */
};
__le16 data_len; /* Length of frame + meta data */
} __attribute__((__packed__));
} __rte_packed;
__le32 vals[4];
};
};
@ -278,7 +278,7 @@ struct nfp_net_rx_desc {
uint8_t dd;
__le32 dma_addr_lo;
} __attribute__((__packed__)) fld;
} __rte_packed fld;
/* RX descriptor */
struct {
@ -288,7 +288,7 @@ struct nfp_net_rx_desc {
__le16 flags;
__le16 vlan;
} __attribute__((__packed__)) rxd;
} __rte_packed rxd;
__le32 vals[2];
};

View File

@ -3358,7 +3358,7 @@ struct pkt_key_qinq {
uint16_t svlan;
uint16_t ethertype_cvlan;
uint16_t cvlan;
} __attribute__((__packed__));
} __rte_packed;
struct pkt_key_ipv4_5tuple {
uint8_t time_to_live;
@ -3368,7 +3368,7 @@ struct pkt_key_ipv4_5tuple {
uint32_t da;
uint16_t sp;
uint16_t dp;
} __attribute__((__packed__));
} __rte_packed;
struct pkt_key_ipv6_5tuple {
uint16_t payload_length;
@ -3378,15 +3378,15 @@ struct pkt_key_ipv6_5tuple {
uint8_t da[16];
uint16_t sp;
uint16_t dp;
} __attribute__((__packed__));
} __rte_packed;
struct pkt_key_ipv4_addr {
uint32_t addr;
} __attribute__((__packed__));
} __rte_packed;
struct pkt_key_ipv6_addr {
uint8_t addr[16];
} __attribute__((__packed__));
} __rte_packed;
static uint32_t
parse_match(char **tokens,

View File

@ -75,14 +75,14 @@ struct ipv4_l3_l4_tuple {
__u32 dst_addr;
__u16 dport;
__u16 sport;
} __attribute__((packed));
} __rte_packed;
struct ipv6_l3_l4_tuple {
__u8 src_addr[16];
__u8 dst_addr[16];
__u16 dport;
__u16 sport;
} __attribute__((packed));
} __rte_packed;
static const __u8 def_rss_key[TAP_RSS_HASH_KEY_SIZE] = {
0xd1, 0x81, 0xc6, 0x2c,

View File

@ -35,6 +35,6 @@ struct rss_key {
__u32 key_size;
__u32 queues[TAP_MAX_QUEUES];
__u32 nb_queues;
} __attribute__((packed));
} __rte_packed;
#endif /* _TAP_RSS_H_ */

View File

@ -305,7 +305,7 @@ struct virtio_net_config {
uint16_t status;
uint16_t max_virtqueue_pairs;
uint16_t mtu;
} __attribute__((packed));
} __rte_packed;
/*
* How many bits to shift physical queue address written to QUEUE_PFN.

View File

@ -43,7 +43,7 @@ struct vhost_user_msg {
struct vhost_memory memory;
} payload;
int fds[VHOST_MEMORY_MAX_NREGIONS];
} __attribute((packed));
} __rte_packed;
#define VHOST_USER_HDR_SIZE offsetof(struct vhost_user_msg, payload.u64)
#define VHOST_USER_PAYLOAD_SIZE \

View File

@ -182,7 +182,7 @@ enum { VTNET_RQ = 0, VTNET_TQ = 1, VTNET_CQ = 2 };
struct virtio_net_ctrl_mac {
uint32_t entries;
uint8_t macs[][RTE_ETHER_ADDR_LEN];
} __attribute__((__packed__));
} __rte_packed;
#define VIRTIO_NET_CTRL_MAC 1
#define VIRTIO_NET_CTRL_MAC_TABLE_SET 0
@ -215,7 +215,7 @@ struct virtio_net_ctrl_mac {
struct virtio_net_ctrl_hdr {
uint8_t class;
uint8_t cmd;
} __attribute__((packed));
} __rte_packed;
typedef uint8_t virtio_net_ctrl_ack;

View File

@ -155,7 +155,7 @@ struct qdma_sdd {
uint32_t wrttype:4;
} write_cmd;
};
} __attribute__ ((__packed__));
} __rte_packed;
/** Represents a DPDMAI raw device */
struct dpaa2_dpdmai_dev {

View File

@ -309,7 +309,7 @@ static inline void opae_adapter_remove_acc(struct opae_adapter *adapter,
struct opae_ether_addr {
unsigned char addr_bytes[OPAE_ETHER_ADDR_LEN];
} __attribute__((__packed__));
} __rte_packed;
/* OPAE vBNG network API*/
int opae_manager_read_mac_rom(struct opae_manager *mgr, int port,

View File

@ -67,7 +67,7 @@ struct rte_ioat_registers {
uint8_t reserved2[0x8]; /* 0xA0 */
uint32_t chanerr; /* 0xA8 */
uint32_t chanerrmask; /* 0xAC */
} __attribute__((packed));
} __rte_packed;
#define RTE_IOAT_CHANCMD_RESET 0x20
#define RTE_IOAT_CHANCMD_SUSPEND 0x04

View File

@ -100,7 +100,7 @@ struct ifcvf_net_config {
u8 mac[6];
u16 status;
u16 max_virtqueue_pairs;
} __attribute__((packed));
} __rte_packed;
struct ifcvf_pci_mem_resource {
u64 phys_addr; /**< Physical address, 0 if not resource. */

View File

@ -2671,7 +2671,7 @@ struct pkt_key_qinq {
uint16_t svlan;
uint16_t ethertype_cvlan;
uint16_t cvlan;
} __attribute__((__packed__));
} __rte_packed;
struct pkt_key_ipv4_5tuple {
uint8_t time_to_live;
@ -2681,7 +2681,7 @@ struct pkt_key_ipv4_5tuple {
uint32_t da;
uint16_t sp;
uint16_t dp;
} __attribute__((__packed__));
} __rte_packed;
struct pkt_key_ipv6_5tuple {
uint16_t payload_length;
@ -2691,15 +2691,15 @@ struct pkt_key_ipv6_5tuple {
uint8_t da[16];
uint16_t sp;
uint16_t dp;
} __attribute__((__packed__));
} __rte_packed;
struct pkt_key_ipv4_addr {
uint32_t addr;
} __attribute__((__packed__));
} __rte_packed;
struct pkt_key_ipv6_addr {
uint8_t addr[16];
} __attribute__((__packed__));
} __rte_packed;
static uint32_t
parse_match(char **tokens,

View File

@ -255,7 +255,7 @@ struct cnt_blk {
uint32_t salt;
uint64_t iv;
uint32_t cnt;
} __attribute__((packed));
} __rte_packed;
/* Socket ctx */
extern struct socket_ctx socket_ctx[NB_SOCKETS];

View File

@ -280,7 +280,7 @@ struct ipv4_5tuple {
uint16_t port_dst;
uint16_t port_src;
uint8_t proto;
} __attribute__((__packed__));
} __rte_packed;
struct ipv6_5tuple {
uint8_t ip_dst[IPV6_ADDR_LEN];
@ -288,7 +288,7 @@ struct ipv6_5tuple {
uint16_t port_dst;
uint16_t port_src;
uint8_t proto;
} __attribute__((__packed__));
} __rte_packed;
struct ipv4_l3fwd_route {
struct ipv4_5tuple key;

View File

@ -48,7 +48,7 @@ struct ipv4_5tuple {
uint16_t port_dst;
uint16_t port_src;
uint8_t proto;
} __attribute__((__packed__));
} __rte_packed;
union ipv4_5tuple_host {
struct {
@ -71,7 +71,7 @@ struct ipv6_5tuple {
uint16_t port_dst;
uint16_t port_src;
uint8_t proto;
} __attribute__((__packed__));
} __rte_packed;
union ipv6_5tuple_host {
struct {

View File

@ -331,7 +331,7 @@ struct ipv4_5tuple {
uint16_t port_dst;
uint16_t port_src;
uint8_t proto;
} __attribute__((__packed__));
} __rte_packed;
union ipv4_5tuple_host {
struct {
@ -354,7 +354,7 @@ struct ipv6_5tuple {
uint16_t port_dst;
uint16_t port_src;
uint8_t proto;
} __attribute__((__packed__));
} __rte_packed;
union ipv6_5tuple_host {
struct {

View File

@ -62,7 +62,7 @@ struct tstamp {
uint16_t sec_msb;
uint32_t sec_lsb;
uint32_t ns;
} __attribute__((packed));
} __rte_packed;
struct clock_id {
uint8_t id[8];
@ -71,7 +71,7 @@ struct clock_id {
struct port_id {
struct clock_id clock_id;
uint16_t port_number;
} __attribute__((packed));
} __rte_packed;
struct ptp_header {
uint8_t msg_type;
@ -86,30 +86,30 @@ struct ptp_header {
uint16_t seq_id;
uint8_t control;
int8_t log_message_interval;
} __attribute__((packed));
} __rte_packed;
struct sync_msg {
struct ptp_header hdr;
struct tstamp origin_tstamp;
} __attribute__((packed));
} __rte_packed;
struct follow_up_msg {
struct ptp_header hdr;
struct tstamp precise_origin_tstamp;
uint8_t suffix[0];
} __attribute__((packed));
} __rte_packed;
struct delay_req_msg {
struct ptp_header hdr;
struct tstamp origin_tstamp;
} __attribute__((packed));
} __rte_packed;
struct delay_resp_msg {
struct ptp_header hdr;
struct tstamp rx_tstamp;
struct port_id req_port_id;
uint8_t suffix[0];
} __attribute__((packed));
} __rte_packed;
struct ptp_message {
union {
@ -118,7 +118,7 @@ struct ptp_message {
struct delay_req_msg delay_req;
struct follow_up_msg follow_up;
struct delay_resp_msg delay_resp;
} __attribute__((packed));
} __rte_packed;
};
struct ptpv2_data_slave_ordinary {

View File

@ -90,6 +90,6 @@ struct vhost_user_msg {
struct vhost_memory_padded memory;
struct vhost_user_config cfg;
} payload;
} __attribute((packed));
} __rte_packed;
#endif

View File

@ -57,7 +57,7 @@ struct rte_config {
* DPDK instances
*/
struct rte_mem_config *mem_config;
} __attribute__((__packed__));
} __rte_packed;
/**
* Get the global configuration structure.

View File

@ -68,7 +68,7 @@ struct rte_memzone {
int32_t socket_id; /**< NUMA socket ID. */
uint32_t flags; /**< Characteristics of this memzone. */
} __attribute__((__packed__));
} __rte_packed;
/**
* Reserve a portion of physical memory.

View File

@ -207,7 +207,7 @@ struct efd_offline_chunk_rules {
struct efd_online_group_entry {
efd_hashfunc_t hash_idx[RTE_EFD_VALUE_NUM_BITS];
efd_lookuptbl_t lookup_table[RTE_EFD_VALUE_NUM_BITS];
} __attribute__((__packed__));
} __rte_packed;
/**
* A single chunk record, containing EFD_TARGET_CHUNK_NUM_RULES rules.
@ -223,7 +223,7 @@ struct efd_online_chunk {
struct efd_online_group_entry groups[EFD_CHUNK_NUM_GROUPS];
/**< Array of all the groups in the chunk. */
} __attribute__((__packed__));
} __rte_packed;
/**
* EFD table structure

View File

@ -131,7 +131,7 @@ struct ipv6_extension_fragment {
uint8_t reserved; /**< Reserved */
uint16_t frag_data; /**< All fragmentation data */
uint32_t id; /**< Packet ID */
} __attribute__((__packed__));
} __rte_packed;

View File

@ -19,7 +19,7 @@ struct aesctr_cnt_blk {
uint32_t nonce;
uint64_t iv;
uint32_t cnt;
} __attribute__((packed));
} __rte_packed;
/*
* AES-GCM devices have some specific requirements for IV and AAD formats.
@ -30,7 +30,7 @@ struct aead_gcm_iv {
uint32_t salt;
uint64_t iv;
uint32_t cnt;
} __attribute__((packed));
} __rte_packed;
struct aead_gcm_aad {
uint32_t spi;
@ -44,12 +44,12 @@ struct aead_gcm_aad {
uint64_t u64;
} sqn;
uint32_t align0; /* align to 16B boundary */
} __attribute__((packed));
} __rte_packed;
struct gcm_esph_iv {
struct rte_esp_hdr esph;
uint64_t iv;
} __attribute__((packed));
} __rte_packed;
static inline void
aes_ctr_cnt_blk_fill(struct aesctr_cnt_blk *ctr, uint64_t iv, uint32_t nonce)

View File

@ -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__)) __rte_aligned(2);
} __rte_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__)) __rte_aligned(2);
} __rte_packed __rte_aligned(2);
/**
* @warning

View File

@ -23,7 +23,7 @@ extern "C" {
struct rte_esp_hdr {
rte_be32_t spi; /**< Security Parameters Index */
rte_be32_t seq; /**< packet sequence number */
} __attribute__((__packed__));
} __rte_packed;
/**
* ESP Trailer
@ -31,7 +31,7 @@ struct rte_esp_hdr {
struct rte_esp_tail {
uint8_t pad_len; /**< number of pad bytes (0-255) */
uint8_t next_proto; /**< IPv4 or IPv6 or next layer header */
} __attribute__((__packed__));
} __rte_packed;
#ifdef __cplusplus
}

View File

@ -283,7 +283,7 @@ struct rte_ether_hdr {
struct rte_vlan_hdr {
uint16_t vlan_tci; /**< Priority (3) + CFI (1) + Identifier Code (12) */
uint16_t eth_proto;/**< Ethernet type of encapsulated frame. */
} __attribute__((__packed__));
} __rte_packed;

View File

@ -35,7 +35,7 @@ struct rte_gre_hdr {
uint16_t ver:3; /**< Version Number */
#endif
uint16_t proto; /**< Protocol Type */
} __attribute__((__packed__));
} __rte_packed;
#ifdef __cplusplus
}

View File

@ -32,7 +32,7 @@ struct rte_gtp_hdr {
uint8_t msg_type; /**< GTP message type */
uint16_t plen; /**< Total payload length */
uint32_t teid; /**< Tunnel endpoint ID */
} __attribute__((__packed__));
} __rte_packed;
/** GTP header length */
#define RTE_ETHER_GTP_HLEN \

View File

@ -31,7 +31,7 @@ struct rte_icmp_hdr {
rte_be16_t icmp_cksum; /* ICMP packet checksum. */
rte_be16_t icmp_ident; /* ICMP packet identifier. */
rte_be16_t icmp_seq_nb; /* ICMP packet sequence number. */
} __attribute__((__packed__));
} __rte_packed;
/* ICMP packet types */
#define RTE_IP_ICMP_ECHO_REPLY 0

View File

@ -41,7 +41,7 @@ struct rte_ipv4_hdr {
rte_be16_t hdr_checksum; /**< header checksum */
rte_be32_t src_addr; /**< source address */
rte_be32_t dst_addr; /**< destination address */
} __attribute__((__packed__));
} __rte_packed;
/** Create IPv4 address */
#define RTE_IPV4(a, b, c, d) ((uint32_t)(((a) & 0xff) << 24) | \
@ -360,7 +360,7 @@ struct rte_ipv6_hdr {
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). */
} __attribute__((__packed__));
} __rte_packed;
/* IPv6 vtc_flow: IPv / TC / flow_label */
#define RTE_IPV6_HDR_FL_SHIFT 0

View File

@ -33,7 +33,7 @@ struct rte_mpls_hdr {
uint8_t tag_lsb:4; /**< label(lsb) */
#endif
uint8_t ttl; /**< Time to live. */
} __attribute__((__packed__));
} __rte_packed;
#ifdef __cplusplus
}

View File

@ -30,7 +30,7 @@ struct rte_sctp_hdr {
rte_be16_t dst_port; /**< Destin port. */
rte_be32_t tag; /**< Validation tag. */
rte_be32_t cksum; /**< Checksum. */
} __attribute__((__packed__));
} __rte_packed;
#ifdef __cplusplus
}

View File

@ -35,7 +35,7 @@ struct rte_tcp_hdr {
rte_be16_t rx_win; /**< RX flow control window. */
rte_be16_t cksum; /**< TCP checksum. */
rte_be16_t tcp_urp; /**< TCP urgent pointer, if any. */
} __attribute__((__packed__));
} __rte_packed;
/**
* TCP Flags

View File

@ -30,7 +30,7 @@ struct rte_udp_hdr {
rte_be16_t dst_port; /**< UDP destination port. */
rte_be16_t dgram_len; /**< UDP datagram length */
rte_be16_t dgram_cksum; /**< UDP datagram checksum */
} __attribute__((__packed__));
} __rte_packed;
#ifdef __cplusplus
}

View File

@ -31,7 +31,7 @@ extern "C" {
struct rte_vxlan_hdr {
uint32_t vx_flags; /**< flag (8) + Reserved (24). */
uint32_t vx_vni; /**< VNI (24) + Reserved (8). */
} __attribute__((__packed__));
} __rte_packed;
/** VXLAN tunnel header length. */
#define RTE_ETHER_VXLAN_HLEN \
@ -48,7 +48,7 @@ struct rte_vxlan_gpe_hdr {
uint8_t reserved[2]; /**< Reserved (16). */
uint8_t proto; /**< next-protocol (8). */
uint32_t vx_vni; /**< VNI (24) + Reserved (8). */
} __attribute__((__packed__));
} __rte_packed;
/** VXLAN-GPE tunnel header length. */
#define RTE_ETHER_VXLAN_GPE_HLEN (sizeof(struct rte_udp_hdr) + \

View File

@ -64,7 +64,7 @@ lb_cfg_check(struct rte_table_action_lb_config *cfg)
struct lb_data {
uint32_t out[RTE_TABLE_ACTION_LB_TABLE_SIZE];
} __attribute__((__packed__));
} __rte_packed;
static int
lb_apply(struct lb_data *data,
@ -111,7 +111,7 @@ mtr_cfg_check(struct rte_table_action_mtr_config *mtr)
struct mtr_trtcm_data {
struct rte_meter_trtcm trtcm;
uint64_t stats[RTE_COLORS];
} __attribute__((__packed__));
} __rte_packed;
#define MTR_TRTCM_DATA_METER_PROFILE_ID_GET(data) \
(((data)->stats[RTE_COLOR_GREEN] & 0xF8LLU) >> 3)
@ -361,7 +361,7 @@ tm_cfg_check(struct rte_table_action_tm_config *tm)
struct tm_data {
uint32_t queue_id;
uint32_t reserved;
} __attribute__((__packed__));
} __rte_packed;
static int
tm_apply_check(struct rte_table_action_tm_params *p,
@ -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__)) __rte_aligned(2);
} __rte_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__)) __rte_aligned(2);
} __rte_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__)) __rte_aligned(2);
} __rte_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__)) __rte_aligned(2);
} __rte_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__)) __rte_aligned(2);
} __rte_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__)) __rte_aligned(2);
} __rte_packed __rte_aligned(2);
static size_t
encap_data_size(struct rte_table_action_encap_config *encap)
@ -1209,12 +1209,12 @@ nat_cfg_check(struct rte_table_action_nat_config *nat)
struct nat_ipv4_data {
uint32_t addr;
uint16_t port;
} __attribute__((__packed__));
} __rte_packed;
struct nat_ipv6_data {
uint8_t addr[16];
uint16_t port;
} __attribute__((__packed__));
} __rte_packed;
static size_t
nat_data_size(struct rte_table_action_nat_config *nat __rte_unused,
@ -1505,7 +1505,7 @@ ttl_cfg_check(struct rte_table_action_ttl_config *ttl)
struct ttl_data {
uint32_t n_packets;
} __attribute__((__packed__));
} __rte_packed;
#define TTL_INIT(data, decrement) \
((data)->n_packets = (decrement) ? 1 : 0)
@ -1589,7 +1589,7 @@ stats_cfg_check(struct rte_table_action_stats_config *stats)
struct stats_data {
uint64_t n_packets;
uint64_t n_bytes;
} __attribute__((__packed__));
} __rte_packed;
static int
stats_apply(struct stats_data *data,
@ -1614,7 +1614,7 @@ pkt_work_stats(struct stats_data *data,
*/
struct time_data {
uint64_t time;
} __attribute__((__packed__));
} __rte_packed;
static int
time_apply(struct time_data *data,
@ -1727,7 +1727,7 @@ struct sym_crypto_data {
/** Private data size to store cipher iv / aad. */
uint8_t iv_aad_data[32];
} __attribute__((__packed__));
} __rte_packed;
static int
sym_crypto_cfg_check(struct rte_table_action_sym_crypto_config *cfg)
@ -2070,7 +2070,7 @@ pkt_work_sym_crypto(struct rte_mbuf *mbuf, struct sym_crypto_data *data,
*/
struct tag_data {
uint32_t tag;
} __attribute__((__packed__));
} __rte_packed;
static int
tag_apply(struct tag_data *data,
@ -2114,7 +2114,7 @@ pkt4_work_tag(struct rte_mbuf *mbuf0,
*/
struct decap_data {
uint16_t n;
} __attribute__((__packed__));
} __rte_packed;
static int
decap_apply(struct decap_data *data,

View File

@ -148,7 +148,7 @@ typedef struct VhostUserMsg {
} payload;
int fds[VHOST_MEMORY_MAX_NREGIONS];
int fd_num;
} __attribute((packed)) VhostUserMsg;
} __rte_packed VhostUserMsg;
#define VHOST_USER_HDR_SIZE offsetof(VhostUserMsg, payload.u64)