Fixes compilation issues seen on gcc 9.3.0 on dpdk 20.05.
Signed-off-by: Xavier Simonart <simonartxavier@gmail.com>
Change-Id: Ib7989c1bac66e82551165ab49e06941ebc772347
prox_rte_ether_hdr ether_hdr;
prox_rte_ipv4_hdr ipv4_hdr;
prox_rte_udp_hdr udp_hdr;
-} __attribute__((packed));
+} __attribute__((packed)) __attribute__((__aligned__(2)));
static struct rte_acl_field_def pkt_eth_ipv4_udp_defs[] = {
/* first input field - always one byte long. */
uint32_t spa; /* Sender protocol address */
prox_rte_ether_addr tha; /* Target hardware address */
uint32_t tpa; /* Target protocol address */
-} __attribute__((__packed__));
+} __attribute__((__packed__)) __attribute__((__aligned__(2)));
typedef struct _arp_ipv4 arp_ipv4_t;
struct my_arp_t {
uint8_t plen;
uint16_t oper;
arp_ipv4_t data;
-} __attribute__((__packed__));
+} __attribute__((__packed__)) __attribute__((__aligned__(2)));
struct ether_hdr_arp {
prox_rte_ether_hdr ether_hdr;
#endif
prox_rte_ipv4_hdr ipv4_hdr;
prox_rte_udp_hdr udp_hdr;
-} __attribute__((packed));
+} __attribute__((packed)) __attribute__((__aligned__(2)));
struct cpe_packet_arp {
struct qinq_hdr qinq_hdr;
struct my_arp_t arp;
-} __attribute__((packed));
+} __attribute__((packed)) __attribute__((__aligned__(2)));
/* Struct used for setting all the values a packet
going to the core netwerk. Payload may follow
struct gre_hdr gre_hdr;
prox_rte_ipv4_hdr ip_hdr;
prox_rte_udp_hdr udp_hdr;
-} __attribute__((packed));
+} __attribute__((packed)) __attribute__((__aligned__(2)));
struct core_net_pkt {
prox_rte_ether_hdr ether_hdr;
struct gre_hdr gre_hdr;
prox_rte_ipv4_hdr ip_hdr;
prox_rte_udp_hdr udp_hdr;
-} __attribute__((packed));
+} __attribute__((packed)) __attribute__((__aligned__(2)));
#define UPSTREAM_DELTA ((uint32_t)(sizeof(struct core_net_pkt) - sizeof(struct cpe_pkt)))
#define DOWNSTREAM_DELTA ((uint32_t)(sizeof(struct core_net_pkt_m) - sizeof(struct cpe_pkt)))
struct cpe_pkt_delta {
uint8_t encap[DOWNSTREAM_DELTA];
struct cpe_pkt pkt;
-} __attribute__((packed));
+} __attribute__((packed)) __attribute__((__aligned__(2)));
static inline void extract_key_cpe(struct rte_mbuf *mbuf, uint64_t* key)
{
prox_rte_ether_hdr ether_hdr;
prox_rte_ipv4_hdr ipv4_hdr;
prox_rte_udp_hdr udp_hdr;
-} __attribute__((packed));
+} __attribute__((packed)) __attribute__((__aligned__(2)));
void task_cgnat_dump_public_hash(struct task_nat *task)
{
prox_rte_udp_hdr udp;
prox_rte_tcp_hdr tcp;
} l4;
-} __attribute__((packed));
+} __attribute__((packed)) __attribute__((__aligned__(2)));
union pkt_type {
struct {
prox_rte_ipv4_hdr ipv4_hdr;
prox_rte_ipv6_hdr ipv6_hdr;
};
-} __attribute__((packed));
+} __attribute__((packed)) __attribute__((__aligned__(2)));
struct qinq_packet_data {
prox_rte_ether_addr d_addr;
prox_rte_ether_addr s_addr;
uint64_t qinq;
-} __attribute__((packed));
+} __attribute__((packed)) __attribute__((__aligned__(2)));
struct ether_packet {
prox_rte_ether_hdr ether_hdr;
prox_rte_ipv4_hdr ipv4_hdr;
prox_rte_ipv6_hdr ipv6_hdr;
};
-} __attribute__((packed));
+} __attribute__((packed)) __attribute__((__aligned__(2)));
struct cpe_packet {
union {
struct pkt_eth_ipv4 {
prox_rte_ether_hdr ether_hdr;
prox_rte_ipv4_hdr ipv4_hdr;
-} __attribute__((packed));
+} __attribute__((packed)) __attribute__((__aligned__(2)));
static int handle_nat(struct task_nat *task, struct rte_mbuf *mbuf)
{
prox_rte_ether_addr next_hop_mac; // mac addr of next hop towards lwB4
uint32_t public_ipv4; // Public IPv4 address
uint16_t public_port; // Public base port (together with port mask, defines the Port Set)
-} __attribute__((__packed__));
+} __attribute__((__packed__)) __attribute__((__aligned__(2)));
struct ipv6_tun_binding_table {
uint32_t num_binding_entries;
in_addr.sin_family = AF_INET;
in_addr.sin_addr = *(struct in_addr *)&ip_cpu;
- strncpy(ifreq.ifr_name, devname, IFNAMSIZ);
+ prox_strncpy(ifreq.ifr_name, devname, IFNAMSIZ);
ifreq.ifr_addr = *(struct sockaddr *)&in_addr;
rc = ioctl(fd, SIOCSIFADDR, &ifreq);
PROX_PANIC(rc < 0, "Failed to set IP address %x on device %s: error = %d (%s)\n", ip_cpu, devname, errno, strerror(errno));
struct my_vlan_hdr svlan;
struct my_vlan_hdr cvlan;
uint16_t ether_type;
-} __attribute__((packed));
+} __attribute__((packed)) __attribute__((__aligned__(2)));
#endif /* _QINQ_H_ */