aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Magistro <koncept1@gmail.com>2021-11-11 01:24:50 +0000
committerBen Magistro <koncept1@gmail.com>2021-12-16 01:27:07 +0000
commit3b80f5d6fbc5ed41fa462acb8c2ccf87e31d9b61 (patch)
tree7107cd3bfb853c1d4d08a17d5cfe638de8f9fb4e
parentb792c1f27d58040f3a815da18183d329bd6bd84b (diff)
tldk: Switch to DPDK v21.11
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.21798-5-olivier.matz@6wind.com/ * https://patches.dpdk.org/project/dpdk/patch/20211018134854.1258938-4-ferruh.yigit@intel.com/ * https://patches.dpdk.org/project/dpdk/patch/20211018134854.1258938-1-ferruh.yigit@intel.com/ Signed-off-by: Ben Magistro <koncept1@gmail.com> Change-Id: I0501d389a7cacf3cd6d5db2683697b03f57cb818
-rw-r--r--dpdk/Makefile4
-rw-r--r--examples/l4fwd/common.h8
-rw-r--r--examples/l4fwd/pkt.c2
-rw-r--r--examples/l4fwd/port.h4
-rw-r--r--lib/libtle_l4p/ctx.c10
-rw-r--r--lib/libtle_l4p/misc.h14
-rw-r--r--lib/libtle_l4p/tcp_misc.h2
-rw-r--r--lib/libtle_l4p/tcp_rxtx.c10
-rw-r--r--lib/libtle_l4p/udp_rxtx.c10
-rw-r--r--test/gtest/test_common.cpp2
10 files changed, 32 insertions, 34 deletions
diff --git a/dpdk/Makefile b/dpdk/Makefile
index a4abac8..e70eff6 100644
--- a/dpdk/Makefile
+++ b/dpdk/Makefile
@@ -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)
diff --git a/examples/l4fwd/common.h b/examples/l4fwd/common.h
index a2cd5f6..f53501c 100644
--- a/examples/l4fwd/common.h
+++ b/examples/l4fwd/common.h
@@ -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);
diff --git a/examples/l4fwd/pkt.c b/examples/l4fwd/pkt.c
index 6694e81..f8605a7 100644
--- a/examples/l4fwd/pkt.c
+++ b/examples/l4fwd/pkt.c
@@ -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))
diff --git a/examples/l4fwd/port.h b/examples/l4fwd/port.h
index ce730dd..2c84e3e 100644
--- a/examples/l4fwd/port.h
+++ b/examples/l4fwd/port.h
@@ -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)
diff --git a/lib/libtle_l4p/ctx.c b/lib/libtle_l4p/ctx.c
index 90dcfb5..0192c8c 100644
--- a/lib/libtle_l4p/ctx.c
+++ b/lib/libtle_l4p/ctx.c
@@ -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;
diff --git a/lib/libtle_l4p/misc.h b/lib/libtle_l4p/misc.h
index e1efb0d..7685a12 100644
--- a/lib/libtle_l4p/misc.h
+++ b/lib/libtle_l4p/misc.h
@@ -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,
diff --git a/lib/libtle_l4p/tcp_misc.h b/lib/libtle_l4p/tcp_misc.h
index 46a0a5f..75163e3 100644
--- a/lib/libtle_l4p/tcp_misc.h
+++ b/lib/libtle_l4p/tcp_misc.h
@@ -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);
diff --git a/lib/libtle_l4p/tcp_rxtx.c b/lib/libtle_l4p/tcp_rxtx.c
index 20a2665..8056619 100644
--- a/lib/libtle_l4p/tcp_rxtx.c
+++ b/lib/libtle_l4p/tcp_rxtx.c
@@ -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;
diff --git a/lib/libtle_l4p/udp_rxtx.c b/lib/libtle_l4p/udp_rxtx.c
index 8963df5..9d6429e 100644
--- a/lib/libtle_l4p/udp_rxtx.c
+++ b/lib/libtle_l4p/udp_rxtx.c
@@ -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) {
diff --git a/test/gtest/test_common.cpp b/test/gtest/test_common.cpp
index e7fa788..74e535f 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 = 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);