tldk: Switch to DPDK v21.11 54/34454/6
authorBen Magistro <[email protected]>
Thu, 11 Nov 2021 01:24:50 +0000 (01:24 +0000)
committerBen Magistro <[email protected]>
Thu, 16 Dec 2021 01:27:07 +0000 (01:27 +0000)
Several flags have been deprecated or removed, this shifts to the new
flags and updates structures accordingly.  On the DPDK side, the
relevant patches are:
* https://patches.dpdk.org/project/dpdk/patch/20211015192408[email protected]/
* https://patches.dpdk.org/project/dpdk/patch/20211018134854.1258938[email protected]/
* https://patches.dpdk.org/project/dpdk/patch/20211018134854.1258938[email protected]/

Signed-off-by: Ben Magistro <[email protected]>
Change-Id: I0501d389a7cacf3cd6d5db2683697b03f57cb818

dpdk/Makefile
examples/l4fwd/common.h
examples/l4fwd/pkt.c
examples/l4fwd/port.h
lib/libtle_l4p/ctx.c
lib/libtle_l4p/misc.h
lib/libtle_l4p/tcp_misc.h
lib/libtle_l4p/tcp_rxtx.c
lib/libtle_l4p/udp_rxtx.c
test/gtest/test_common.cpp

index a4abac8..e70eff6 100644 (file)
@@ -19,7 +19,7 @@ RTE_OUTPUT ?= $(O)
 DOWNLOAD_DIR := $(CURDIR)/downloads
 MESON_DIR := $(CURDIR)/meson
 
-DPDK_VERSION          ?= 20.11
+DPDK_VERSION          ?= v21.11
 DPDK_SRC_DIR          ?= $(RTE_OUTPUT)-src
 DPDK_BUILD_DIR        ?= $(RTE_OUTPUT)-build
 DPDK_INSTALL_DIR      ?= $(RTE_OUTPUT)
@@ -30,7 +30,7 @@ S := $(DPDK_SRC_DIR)
 B := $(DPDK_BUILD_DIR)
 I := $(DPDK_INSTALL_DIR)
 
-DPDK_GIT_REPO ?= http://dpdk.org/git/dpdk-stable
+DPDK_GIT_REPO ?= http://dpdk.org/git/dpdk
 
 JOBS := $(shell grep processor /proc/cpuinfo | wc -l)
 
index a2cd5f6..f53501c 100644 (file)
@@ -368,8 +368,8 @@ fill_dst(struct tle_dest *dst, struct netbe_dev *bed,
 
        eth = (struct rte_ether_hdr *)dst->hdr;
 
-       rte_ether_addr_copy(&bed->port.mac, &eth->s_addr);
-       rte_ether_addr_copy(&bdp->mac, &eth->d_addr);
+       rte_ether_addr_copy(&bed->port.mac, &eth->src_addr);
+       rte_ether_addr_copy(&bdp->mac, &eth->dst_addr);
        eth->ether_type = rte_cpu_to_be_16(l3_type);
 
        if (l3_type == RTE_ETHER_TYPE_IPV4) {
@@ -448,8 +448,8 @@ fill_arp_reply(struct netbe_dev *dev, struct rte_mbuf *m)
 
        /* set up the ethernet data */
        eth = rte_pktmbuf_mtod(m, struct rte_ether_hdr *);
-       eth->d_addr = eth->s_addr;
-       eth->s_addr = dev->port.mac;
+       eth->dst_addr = eth->src_addr;
+       eth->src_addr = dev->port.mac;
 
        /* set up the arp data */
        ahdr = rte_pktmbuf_mtod_offset(m, struct rte_arp_hdr *, m->l2_len);
index 6694e81..f8605a7 100644 (file)
@@ -418,7 +418,7 @@ fix_reassembled(struct rte_mbuf *m, int32_t hwcsum, uint32_t proto)
                m->packet_type |= RTE_PTYPE_L4_UDP;
 
        /* fix reassemble setting TX flags. */
-       m->ol_flags &= ~PKT_TX_IP_CKSUM;
+       m->ol_flags &= ~RTE_MBUF_F_TX_IP_CKSUM;
 
        /* fix l3_len after reassemble. */
        if (RTE_ETH_IS_IPV6_HDR(m->packet_type))
index ce730dd..2c84e3e 100644 (file)
@@ -182,9 +182,7 @@ port_init(struct netbe_port *uprt, uint32_t proto)
                        __func__, uprt->id);
                port_conf.rxmode.offloads |= uprt->rx_offload & RX_CSUM_OFFLOAD;
        }
-       port_conf.rxmode.max_rx_pkt_len = uprt->mtu + RTE_ETHER_CRC_LEN;
-       if (port_conf.rxmode.max_rx_pkt_len > RTE_ETHER_MAX_LEN)
-               port_conf.rxmode.offloads |= DEV_RX_OFFLOAD_JUMBO_FRAME;
+       port_conf.rxmode.mtu = uprt->mtu - RTE_ETHER_HDR_LEN;
 
        rc = update_rss_conf(uprt, &dev_info, &port_conf, proto);
        if (rc != 0)
index 90dcfb5..0192c8c 100644 (file)
@@ -244,16 +244,16 @@ tle_add_dev(struct tle_ctx *ctx, const struct tle_dev_param *dev_prm)
 
        if ((dev_prm->tx_offload & DEV_TX_OFFLOAD_UDP_CKSUM) != 0 &&
                        ctx->prm.proto == TLE_PROTO_UDP) {
-               dev->tx.ol_flags[TLE_V4] |= PKT_TX_IPV4 | PKT_TX_UDP_CKSUM;
-               dev->tx.ol_flags[TLE_V6] |= PKT_TX_IPV6 | PKT_TX_UDP_CKSUM;
+               dev->tx.ol_flags[TLE_V4] |= RTE_MBUF_F_TX_IPV4 | RTE_MBUF_F_TX_UDP_CKSUM;
+               dev->tx.ol_flags[TLE_V6] |= RTE_MBUF_F_TX_IPV6 | RTE_MBUF_F_TX_UDP_CKSUM;
        } else if ((dev_prm->tx_offload & DEV_TX_OFFLOAD_TCP_CKSUM) != 0 &&
                        ctx->prm.proto == TLE_PROTO_TCP) {
-               dev->tx.ol_flags[TLE_V4] |= PKT_TX_IPV4 | PKT_TX_TCP_CKSUM;
-               dev->tx.ol_flags[TLE_V6] |= PKT_TX_IPV6 | PKT_TX_TCP_CKSUM;
+               dev->tx.ol_flags[TLE_V4] |= RTE_MBUF_F_TX_IPV4 | RTE_MBUF_F_TX_TCP_CKSUM;
+               dev->tx.ol_flags[TLE_V6] |= RTE_MBUF_F_TX_IPV6 | RTE_MBUF_F_TX_TCP_CKSUM;
        }
 
        if ((dev_prm->tx_offload & DEV_TX_OFFLOAD_IPV4_CKSUM) != 0)
-               dev->tx.ol_flags[TLE_V4] |= PKT_TX_IPV4 | PKT_TX_IP_CKSUM;
+               dev->tx.ol_flags[TLE_V4] |= RTE_MBUF_F_TX_IPV4 | RTE_MBUF_F_TX_IP_CKSUM;
 
        dev->prm = *dev_prm;
        dev->ctx = ctx;
index e1efb0d..7685a12 100644 (file)
@@ -216,7 +216,7 @@ _ipv4x_phdr_cksum(const struct rte_ipv4_hdr *ipv4_hdr, size_t ipv4h_len,
        s1 = ipv4_hdr->dst_addr;
        CKSUM_ADD_CARRY(s0, s1);
 
-       if (ol_flags & PKT_TX_TCP_SEG)
+       if (ol_flags & RTE_MBUF_F_TX_TCP_SEG)
                s1 = 0;
        else
                s1 = rte_cpu_to_be_16(
@@ -300,16 +300,16 @@ check_pkt_csum(const struct rte_mbuf *m, uint64_t ol_flags, uint32_t type,
        uint16_t csum;
        int32_t ret;
 
-       fl4 = ol_flags & PKT_RX_L4_CKSUM_MASK;
+       fl4 = ol_flags & RTE_MBUF_F_RX_L4_CKSUM_MASK;
        fl3 = (type == TLE_V4) ?
-               (ol_flags & PKT_RX_IP_CKSUM_MASK) : PKT_RX_IP_CKSUM_GOOD;
+               (ol_flags & RTE_MBUF_F_RX_IP_CKSUM_MASK) : RTE_MBUF_F_RX_IP_CKSUM_GOOD;
 
        /* case 0: both ip and l4 cksum is verified or data is valid */
-       if ((fl3 | fl4) == (PKT_RX_IP_CKSUM_GOOD | PKT_RX_L4_CKSUM_GOOD))
+       if ((fl3 | fl4) == (RTE_MBUF_F_RX_IP_CKSUM_GOOD | RTE_MBUF_F_RX_L4_CKSUM_GOOD))
                return 0;
 
        /* case 1: either ip or l4 cksum bad */
-       if (fl3 == PKT_RX_IP_CKSUM_BAD || fl4 == PKT_RX_L4_CKSUM_BAD)
+       if (fl3 == RTE_MBUF_F_RX_IP_CKSUM_BAD || fl4 == RTE_MBUF_F_RX_L4_CKSUM_BAD)
                return 1;
 
        /* case 2: either ip or l4 or both cksum is unknown */
@@ -319,12 +319,12 @@ check_pkt_csum(const struct rte_mbuf *m, uint64_t ol_flags, uint32_t type,
                m->l2_len);
 
        ret = 0;
-       if (fl3 == PKT_RX_IP_CKSUM_UNKNOWN && l3h4->hdr_checksum != 0) {
+       if (fl3 == RTE_MBUF_F_RX_IP_CKSUM_UNKNOWN && l3h4->hdr_checksum != 0) {
                csum = _ipv4x_cksum(l3h4, m->l3_len);
                ret = (csum != UINT16_MAX);
        }
 
-       if (ret == 0 && fl4 == PKT_RX_L4_CKSUM_UNKNOWN) {
+       if (ret == 0 && fl4 == RTE_MBUF_F_RX_L4_CKSUM_UNKNOWN) {
 
                /*
                 * for IPv4 it is allowed to have zero UDP cksum,
index 46a0a5f..75163e3 100644 (file)
@@ -435,7 +435,7 @@ get_pkt_info(const struct rte_mbuf *m, union pkt_info *pi, union seg_info *si)
                ((uintptr_t)tcph + offsetof(struct rte_tcp_hdr, src_port));
        pi->tf.flags = tcph->tcp_flags;
        pi->tf.type = type;
-       pi->csf = m->ol_flags & (PKT_RX_IP_CKSUM_MASK | PKT_RX_L4_CKSUM_MASK);
+       pi->csf = m->ol_flags & (RTE_MBUF_F_RX_IP_CKSUM_MASK | RTE_MBUF_F_RX_L4_CKSUM_MASK);
        pi->port.raw = prt->raw;
 
        get_seg_info(tcph, si);
index 20a2665..8056619 100644 (file)
@@ -277,19 +277,19 @@ tcp_fill_mbuf(struct rte_mbuf *m, const struct tle_tcp_stream *s,
                l3h->packet_id = rte_cpu_to_be_16(pid);
                l3h->total_length = rte_cpu_to_be_16(plen + dst->l3_len + l4);
 
-               if ((ol_flags & PKT_TX_TCP_CKSUM) != 0)
+               if ((ol_flags & RTE_MBUF_F_TX_TCP_CKSUM) != 0)
                        l4h->cksum = _ipv4x_phdr_cksum(l3h, m->l3_len,
                                ol_flags);
                else if (swcsm != 0)
                        l4h->cksum = _ipv4_udptcp_mbuf_cksum(m, len, l3h);
 
-               if ((ol_flags & PKT_TX_IP_CKSUM) == 0 && swcsm != 0)
+               if ((ol_flags & RTE_MBUF_F_TX_IP_CKSUM) == 0 && swcsm != 0)
                        l3h->hdr_checksum = _ipv4x_cksum(l3h, m->l3_len);
        } else {
                struct rte_ipv6_hdr *l3h;
                l3h = (struct rte_ipv6_hdr *)(l2h + dst->l2_len);
                l3h->payload_len = rte_cpu_to_be_16(plen + l4);
-               if ((ol_flags & PKT_TX_TCP_CKSUM) != 0)
+               if ((ol_flags & RTE_MBUF_F_TX_TCP_CKSUM) != 0)
                        l4h->cksum = rte_ipv6_phdr_cksum(l3h, ol_flags);
                else if (swcsm != 0)
                        l4h->cksum = _ipv6_udptcp_mbuf_cksum(m, len, l3h);
@@ -326,12 +326,12 @@ tcp_update_mbuf(struct rte_mbuf *m, uint32_t type, const struct tcb *tcb,
                        m->l2_len);
                l3h->hdr_checksum = 0;
                l3h->packet_id = rte_cpu_to_be_16(pid);
-               if ((m->ol_flags & PKT_TX_IP_CKSUM) == 0)
+               if ((m->ol_flags & RTE_MBUF_F_TX_IP_CKSUM) == 0)
                        l3h->hdr_checksum = _ipv4x_cksum(l3h, m->l3_len);
        }
 
        /* have to calculate TCP checksum in SW */
-       if ((m->ol_flags & PKT_TX_TCP_CKSUM) == 0) {
+       if ((m->ol_flags & RTE_MBUF_F_TX_TCP_CKSUM) == 0) {
 
                l4h->cksum = 0;
 
index 8963df5..9d6429e 100644 (file)
@@ -361,19 +361,19 @@ udp_fill_mbuf(struct rte_mbuf *m,
                l3h->total_length = rte_cpu_to_be_16(plen + dst->l3_len +
                        sizeof(*l4h));
 
-               if ((ol_flags & PKT_TX_UDP_CKSUM) != 0)
+               if ((ol_flags & RTE_MBUF_F_TX_UDP_CKSUM) != 0)
                        l4h->cksum = _ipv4x_phdr_cksum(l3h, m->l3_len,
                                ol_flags);
                else
                        l4h->cksum = _ipv4_udptcp_mbuf_cksum(m, len, l3h);
 
-               if ((ol_flags & PKT_TX_IP_CKSUM) == 0)
+               if ((ol_flags & RTE_MBUF_F_TX_IP_CKSUM) == 0)
                        l3h->hdr_checksum = _ipv4x_cksum(l3h, m->l3_len);
        } else {
                struct rte_ipv6_hdr *l3h;
                l3h = (struct rte_ipv6_hdr *)(l2h + dst->l2_len);
                l3h->payload_len = rte_cpu_to_be_16(plen + sizeof(*l4h));
-               if ((ol_flags & PKT_TX_UDP_CKSUM) != 0)
+               if ((ol_flags & RTE_MBUF_F_TX_UDP_CKSUM) != 0)
                        l4h->cksum = rte_ipv6_phdr_cksum(l3h, ol_flags);
                else
                        l4h->cksum = _ipv6_udptcp_mbuf_cksum(m, len, l3h);
@@ -394,7 +394,7 @@ frag_fixup(const struct rte_mbuf *ms, struct rte_mbuf *mf, uint32_t type)
        mf->ol_flags = ms->ol_flags;
        mf->tx_offload = ms->tx_offload;
 
-       if (type == TLE_V4 && (ms->ol_flags & PKT_TX_IP_CKSUM) == 0) {
+       if (type == TLE_V4 && (ms->ol_flags & RTE_MBUF_F_TX_IP_CKSUM) == 0) {
                l3h = rte_pktmbuf_mtod(mf, struct rte_ipv4_hdr *);
                l3h->hdr_checksum = _ipv4x_cksum(l3h, mf->l3_len);
        }
@@ -570,7 +570,7 @@ tle_udp_stream_send(struct tle_stream *us, struct rte_mbuf *pkt[],
                while (i != num && frg == 0) {
                        frg = pkt[i]->pkt_len > mtu;
                        if (frg != 0)
-                               ol_flags &= ~PKT_TX_UDP_CKSUM;
+                               ol_flags &= ~RTE_MBUF_F_TX_UDP_CKSUM;
                        rc = udp_fill_mbuf(pkt[i], type, ol_flags, pid + i,
                                udph, &dst);
                        if (rc != 0) {
index e7fa788..74e535f 100644 (file)
@@ -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 = RTE_ETHER_MAX_LEN;
+       port_conf.rxmode.mtu = RTE_ETHER_MAX_LEN;
 
        /* Configure the Ethernet device. */
        retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf);