From 6d82c12cc7876aef8f1a6f98e5897d96a1e991c8 Mon Sep 17 00:00:00 2001 From: Xavier Simonart Date: Mon, 29 Mar 2021 11:45:47 +0200 Subject: Minor update to fix compilation issues on recent gcc and dpdk Fixes compilation issues seen on gcc 9.3.0 on dpdk 20.05. Signed-off-by: Xavier Simonart Change-Id: Ib7989c1bac66e82551165ab49e06941ebc772347 --- VNFs/DPPD-PROX/acl_field_def.h | 2 +- VNFs/DPPD-PROX/arp.h | 4 ++-- VNFs/DPPD-PROX/bng_pkts.h | 10 +++++----- VNFs/DPPD-PROX/handle_cgnat.c | 2 +- VNFs/DPPD-PROX/handle_fm.c | 2 +- VNFs/DPPD-PROX/handle_lb_qinq.c | 6 +++--- VNFs/DPPD-PROX/handle_nat.c | 2 +- VNFs/DPPD-PROX/prox_lua_types.h | 2 +- VNFs/DPPD-PROX/prox_port_cfg.c | 2 +- VNFs/DPPD-PROX/qinq.h | 2 +- 10 files changed, 17 insertions(+), 17 deletions(-) (limited to 'VNFs/DPPD-PROX') diff --git a/VNFs/DPPD-PROX/acl_field_def.h b/VNFs/DPPD-PROX/acl_field_def.h index 4f05ae80..da60e1c0 100644 --- a/VNFs/DPPD-PROX/acl_field_def.h +++ b/VNFs/DPPD-PROX/acl_field_def.h @@ -27,7 +27,7 @@ struct pkt_eth_ipv4_udp { 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. */ diff --git a/VNFs/DPPD-PROX/arp.h b/VNFs/DPPD-PROX/arp.h index 3e8e0d90..ebf8a89e 100644 --- a/VNFs/DPPD-PROX/arp.h +++ b/VNFs/DPPD-PROX/arp.h @@ -30,7 +30,7 @@ struct _arp_ipv4 { 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 { @@ -40,7 +40,7 @@ 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; diff --git a/VNFs/DPPD-PROX/bng_pkts.h b/VNFs/DPPD-PROX/bng_pkts.h index 50780e3b..85114a0c 100644 --- a/VNFs/DPPD-PROX/bng_pkts.h +++ b/VNFs/DPPD-PROX/bng_pkts.h @@ -37,12 +37,12 @@ struct cpe_pkt { #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 @@ -59,7 +59,7 @@ struct core_net_pkt_m { 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; @@ -67,7 +67,7 @@ struct core_net_pkt { 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))) @@ -75,7 +75,7 @@ struct core_net_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) { diff --git a/VNFs/DPPD-PROX/handle_cgnat.c b/VNFs/DPPD-PROX/handle_cgnat.c index f516921c..55a35c20 100644 --- a/VNFs/DPPD-PROX/handle_cgnat.c +++ b/VNFs/DPPD-PROX/handle_cgnat.c @@ -114,7 +114,7 @@ struct pkt_eth_ipv4 { 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) { diff --git a/VNFs/DPPD-PROX/handle_fm.c b/VNFs/DPPD-PROX/handle_fm.c index 470082b0..75d0cee1 100644 --- a/VNFs/DPPD-PROX/handle_fm.c +++ b/VNFs/DPPD-PROX/handle_fm.c @@ -57,7 +57,7 @@ struct eth_ip4_udp { prox_rte_udp_hdr udp; prox_rte_tcp_hdr tcp; } l4; -} __attribute__((packed)); +} __attribute__((packed)) __attribute__((__aligned__(2))); union pkt_type { struct { diff --git a/VNFs/DPPD-PROX/handle_lb_qinq.c b/VNFs/DPPD-PROX/handle_lb_qinq.c index 49ed1b79..a2f1b1fa 100644 --- a/VNFs/DPPD-PROX/handle_lb_qinq.c +++ b/VNFs/DPPD-PROX/handle_lb_qinq.c @@ -248,13 +248,13 @@ struct qinq_packet { 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; @@ -262,7 +262,7 @@ struct ether_packet { prox_rte_ipv4_hdr ipv4_hdr; prox_rte_ipv6_hdr ipv6_hdr; }; -} __attribute__((packed)); +} __attribute__((packed)) __attribute__((__aligned__(2))); struct cpe_packet { union { diff --git a/VNFs/DPPD-PROX/handle_nat.c b/VNFs/DPPD-PROX/handle_nat.c index 4cd2de22..83c9ebc5 100644 --- a/VNFs/DPPD-PROX/handle_nat.c +++ b/VNFs/DPPD-PROX/handle_nat.c @@ -47,7 +47,7 @@ struct task_nat { 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) { diff --git a/VNFs/DPPD-PROX/prox_lua_types.h b/VNFs/DPPD-PROX/prox_lua_types.h index ce6bd9d2..83cc73cd 100644 --- a/VNFs/DPPD-PROX/prox_lua_types.h +++ b/VNFs/DPPD-PROX/prox_lua_types.h @@ -73,7 +73,7 @@ struct ipv6_tun_binding_entry { 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; diff --git a/VNFs/DPPD-PROX/prox_port_cfg.c b/VNFs/DPPD-PROX/prox_port_cfg.c index 60809f1d..b93198df 100644 --- a/VNFs/DPPD-PROX/prox_port_cfg.c +++ b/VNFs/DPPD-PROX/prox_port_cfg.c @@ -190,7 +190,7 @@ static void set_ip_address(char *devname, uint32_t ip, uint8_t prefix) 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)); diff --git a/VNFs/DPPD-PROX/qinq.h b/VNFs/DPPD-PROX/qinq.h index 1d11114d..03c89b9b 100644 --- a/VNFs/DPPD-PROX/qinq.h +++ b/VNFs/DPPD-PROX/qinq.h @@ -36,6 +36,6 @@ struct qinq_hdr { struct my_vlan_hdr svlan; struct my_vlan_hdr cvlan; uint16_t ether_type; -} __attribute__((packed)); +} __attribute__((packed)) __attribute__((__aligned__(2))); #endif /* _QINQ_H_ */ -- cgit 1.2.3-korg