From 10ae544444cfafc4367d9c1f39f332b6206772bf Mon Sep 17 00:00:00 2001 From: Konstantin Ananyev Date: Wed, 28 Apr 2021 15:39:11 +0000 Subject: bump dpdk version to 20.05 Bump dpdk version to 20.05 and adjust tldk source. Signed-off-by: Konstantin Ananyev Change-Id: Id2ce864ad20b3b347f1ac05cd67c15384e454c52 --- test/gtest/test_common.cpp | 52 ++++++++++++++++++------------------ test/gtest/test_common.h | 2 +- test/gtest/test_tle_udp_stream_gen.h | 22 +++++++-------- 3 files changed, 38 insertions(+), 38 deletions(-) (limited to 'test') diff --git a/test/gtest/test_common.cpp b/test/gtest/test_common.cpp index 65e3a51..a91c8ba 100644 --- a/test/gtest/test_common.cpp +++ b/test/gtest/test_common.cpp @@ -27,7 +27,7 @@ port_init(dpdk_port_t port, struct rte_mempool *mbuf_pool) socket_id = rte_eth_dev_socket_id(port); memset(&port_conf, 0, sizeof(struct rte_eth_conf)); - port_conf.rxmode.max_rx_pkt_len = ETHER_MAX_LEN; + port_conf.rxmode.max_rx_pkt_len = RTE_ETHER_MAX_LEN; /* Configure the Ethernet device. */ retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf); @@ -77,9 +77,9 @@ fill_pkt_hdr_len(struct rte_mbuf *m, uint32_t l2, uint32_t l3, uint32_t l4) } int -is_ipv4_frag(const struct ipv4_hdr *iph) +is_ipv4_frag(const struct rte_ipv4_hdr *iph) { - const uint16_t mask = rte_cpu_to_be_16(~IPV4_HDR_DF_FLAG); + const uint16_t mask = rte_cpu_to_be_16(~RTE_IPV4_HDR_DF_FLAG); return ((mask & iph->fragment_offset) != 0); } @@ -88,14 +88,14 @@ void fill_ipv4_hdr_len(struct rte_mbuf *m, uint32_t l2, uint32_t proto, uint32_t frag) { - const struct ipv4_hdr *iph; + const struct rte_ipv4_hdr *iph; int32_t dlen, len; dlen = rte_pktmbuf_data_len(m); - dlen -= l2 + sizeof(struct udp_hdr); + dlen -= l2 + sizeof(struct rte_udp_hdr); - iph = rte_pktmbuf_mtod_offset(m, const struct ipv4_hdr *, l2); - len = (iph->version_ihl & IPV4_HDR_IHL_MASK) * IPV4_IHL_MULTIPLIER; + iph = rte_pktmbuf_mtod_offset(m, const struct rte_ipv4_hdr *, l2); + len = (iph->version_ihl & RTE_IPV4_HDR_IHL_MASK) * RTE_IPV4_IHL_MULTIPLIER; if (frag != 0 && is_ipv4_frag(iph)) { m->packet_type &= ~RTE_PTYPE_L4_MASK; @@ -105,7 +105,7 @@ fill_ipv4_hdr_len(struct rte_mbuf *m, uint32_t l2, uint32_t proto, if (len > dlen || (proto <= IPPROTO_MAX && iph->next_proto_id != proto)) m->packet_type = RTE_PTYPE_UNKNOWN; else - fill_pkt_hdr_len(m, l2, len, sizeof(struct udp_hdr)); + fill_pkt_hdr_len(m, l2, len, sizeof(struct rte_udp_hdr)); } int @@ -135,10 +135,10 @@ fill_ipv6x_hdr_len(struct rte_mbuf *m, uint32_t l2, uint32_t nproto, const struct ip6_ext *ipx; int32_t dlen, len, ofs; - len = sizeof(struct ipv6_hdr); + len = sizeof(struct rte_ipv6_hdr); dlen = rte_pktmbuf_data_len(m); - dlen -= l2 + sizeof(struct udp_hdr); + dlen -= l2 + sizeof(struct rte_udp_hdr); ofs = l2 + len; ipx = rte_pktmbuf_mtod_offset(m, const struct ip6_ext *, ofs); @@ -179,20 +179,20 @@ fill_ipv6x_hdr_len(struct rte_mbuf *m, uint32_t l2, uint32_t nproto, if ((ofs == 0 && nproto != fproto) || len > dlen) m->packet_type = RTE_PTYPE_UNKNOWN; else - fill_pkt_hdr_len(m, l2, len, sizeof(struct udp_hdr)); + fill_pkt_hdr_len(m, l2, len, sizeof(struct rte_udp_hdr)); } void fill_ipv6_hdr_len(struct rte_mbuf *m, uint32_t l2, uint32_t fproto) { - const struct ipv6_hdr *iph; + const struct rte_ipv6_hdr *iph; - iph = rte_pktmbuf_mtod_offset(m, const struct ipv6_hdr *, - sizeof(struct ether_hdr)); + iph = rte_pktmbuf_mtod_offset(m, const struct rte_ipv6_hdr *, + sizeof(struct rte_ether_hdr)); if (iph->proto == fproto) - fill_pkt_hdr_len(m, l2, sizeof(struct ipv6_hdr), - sizeof(struct udp_hdr)); + fill_pkt_hdr_len(m, l2, sizeof(struct rte_ipv6_hdr), + sizeof(struct rte_udp_hdr)); else if (ipv6x_hdr(iph->proto) != 0) fill_ipv6x_hdr_len(m, l2, iph->proto, fproto); } @@ -202,32 +202,32 @@ fill_eth_hdr_len(struct rte_mbuf *m) { uint32_t dlen, l2; uint16_t etp; - const struct ether_hdr *eth; + const struct rte_ether_hdr *eth; dlen = rte_pktmbuf_data_len(m); /* check that first segment is at least 42B long. */ - if (dlen < sizeof(struct ether_hdr) + sizeof(struct ipv4_hdr) + - sizeof(struct udp_hdr)) { + if (dlen < sizeof(struct rte_ether_hdr) + sizeof(struct rte_ipv4_hdr) + + sizeof(struct rte_udp_hdr)) { m->packet_type = RTE_PTYPE_UNKNOWN; return; } l2 = sizeof(*eth); - eth = rte_pktmbuf_mtod(m, const struct ether_hdr *); + eth = rte_pktmbuf_mtod(m, const struct rte_ether_hdr *); etp = eth->ether_type; - if (etp == rte_be_to_cpu_16(ETHER_TYPE_VLAN)) - l2 += sizeof(struct vlan_hdr); + if (etp == rte_be_to_cpu_16(RTE_ETHER_TYPE_VLAN)) + l2 += sizeof(struct rte_vlan_hdr); - if (etp == rte_be_to_cpu_16(ETHER_TYPE_IPv4)) { + if (etp == rte_be_to_cpu_16(RTE_ETHER_TYPE_IPV4)) { m->packet_type = RTE_PTYPE_L4_UDP | RTE_PTYPE_L3_IPV4_EXT_UNKNOWN | RTE_PTYPE_L2_ETHER; fill_ipv4_hdr_len(m, l2, IPPROTO_UDP, 1); - } else if (etp == rte_be_to_cpu_16(ETHER_TYPE_IPv6) && - dlen >= l2 + sizeof(struct ipv6_hdr) + - sizeof(struct udp_hdr)) { + } else if (etp == rte_be_to_cpu_16(RTE_ETHER_TYPE_IPV6) && + dlen >= l2 + sizeof(struct rte_ipv6_hdr) + + sizeof(struct rte_udp_hdr)) { m->packet_type = RTE_PTYPE_L4_UDP | RTE_PTYPE_L3_IPV6_EXT_UNKNOWN | RTE_PTYPE_L2_ETHER; diff --git a/test/gtest/test_common.h b/test/gtest/test_common.h index 9c521b8..5b01114 100644 --- a/test/gtest/test_common.h +++ b/test/gtest/test_common.h @@ -64,7 +64,7 @@ void fill_pkt_hdr_len(struct rte_mbuf *m, uint32_t l2, uint32_t l3, uint32_t l4); int -is_ipv4_frag(const struct ipv4_hdr *iph); +is_ipv4_frag(const struct rte_ipv4_hdr *iph); void fill_ipv4_hdr_len(struct rte_mbuf *m, uint32_t l2, uint32_t proto, diff --git a/test/gtest/test_tle_udp_stream_gen.h b/test/gtest/test_tle_udp_stream_gen.h index 1f3d210..8476375 100644 --- a/test/gtest/test_tle_udp_stream_gen.h +++ b/test/gtest/test_tle_udp_stream_gen.h @@ -65,8 +65,8 @@ static int lookup4_function(void *opaque, const struct in_addr *addr, struct tle_dest *res) { struct in_addr route; - struct ether_hdr *eth; - struct ipv4_hdr *ip4h; + struct rte_ether_hdr *eth; + struct rte_ipv4_hdr *ip4h; auto routes = static_cast *>(opaque); /* Check all routes added in map for a match with dest *addr */ @@ -81,11 +81,11 @@ lookup4_function(void *opaque, const struct in_addr *addr, struct tle_dest *res) res->l2_len = sizeof(*eth); res->l3_len = sizeof(*ip4h); res->head_mp = mbuf_pool; - eth = (struct ether_hdr *)res->hdr; - eth->ether_type = rte_cpu_to_be_16(ETHER_TYPE_IPv4); - ip4h = (struct ipv4_hdr *)(eth + 1); + eth = (struct rte_ether_hdr *)res->hdr; + eth->ether_type = rte_cpu_to_be_16(RTE_ETHER_TYPE_IPV4); + ip4h = (struct rte_ipv4_hdr *)(eth + 1); ip4h->version_ihl = (4 << 4) | - (sizeof(*ip4h) / IPV4_IHL_MULTIPLIER); + (sizeof(*ip4h) / RTE_IPV4_IHL_MULTIPLIER); ip4h->time_to_live = 64; ip4h->next_proto_id = IPPROTO_UDP; ip4h->fragment_offset = 0; @@ -101,8 +101,8 @@ static int lookup6_function(void *opaque, const struct in6_addr *addr, struct tle_dest *res) { - struct ether_hdr *eth; - struct ipv6_hdr *ip6h; + struct rte_ether_hdr *eth; + struct rte_ipv6_hdr *ip6h; struct in6_addr route; auto routes = static_cast *>(opaque); @@ -118,9 +118,9 @@ lookup6_function(void *opaque, const struct in6_addr *addr, res->l2_len = sizeof(*eth); res->l3_len = sizeof(*ip6h); res->head_mp = mbuf_pool; - eth = (struct ether_hdr *)res->hdr; - eth->ether_type = rte_cpu_to_be_16(ETHER_TYPE_IPv6); - ip6h = (struct ipv6_hdr *)(eth + 1); + eth = (struct rte_ether_hdr *)res->hdr; + eth->ether_type = rte_cpu_to_be_16(RTE_ETHER_TYPE_IPV6); + ip6h = (struct rte_ipv6_hdr *)(eth + 1); ip6h->vtc_flow = 6 << 4; ip6h->proto = IPPROTO_UDP; ip6h->hop_limits = 64; -- cgit 1.2.3-korg