DPDK v18.11 is the latest LTS verison.
As of the API/ABI changes introduced in ether at v18.08, we cannot
compile l4fwd and nginx with old DPDK versions.
Change-Id: I225302d9a257e9bce4aa22ff84d76a57170e7eb7
Signed-off-by: Jianfeng Tan <henry.tjf@antfin.com>
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
1) Obtain latest supported DPDK version and build it.
(refer to http://dpdk.org for information how to download and build it).
- Currently supported(tested) DPDK versions: 16.11 LTS, 17.11 LTS, 18.02.
+ Currently supported(tested) DPDK versions: 18.11 LTS.
2) Make sure that RTE_SDK and RTE_TARGET DPDK related environment variables
are setup correctly.
3) Go to the TLDK root directory and type: 'make all'.
static const struct rte_eth_conf port_conf_default = {
.rxmode = {
- .hw_vlan_strip = 1,
+ .offloads = DEV_RX_OFFLOAD_VLAN_STRIP,
},
};
if ((pcf->rx_offload & RX_CSUM_OFFLOAD) != 0) {
RTE_LOG(ERR, USER1, "%s(%u): enabling RX csum offload;\n",
__func__, pcf->id);
- port_conf.rxmode.hw_ip_checksum = 1;
+ port_conf.rxmode.offloads |= pcf->rx_offload & RX_CSUM_OFFLOAD;
}
port_conf.rxmode.max_rx_pkt_len = pcf->mtu + ETHER_CRC_LEN;
if (port_conf.rxmode.max_rx_pkt_len > ETHER_MAX_LEN)
- port_conf.rxmode.jumbo_frame = 1;
+ port_conf.rxmode.offloads |= DEV_RX_OFFLOAD_JUMBO_FRAME;
port_conf.rxmode.mq_mode = ETH_MQ_RX_RSS;
port_conf.rx_adv_conf.rss_conf.rss_hf = ETH_RSS_IP | ETH_RSS_TCP;
+ port_conf.rx_adv_conf.rss_conf.rss_hf &=
+ dev_info.flow_type_rss_offloads;
+
+ port_conf.txmode.offloads = pcf->tx_offload;
rc = rte_eth_dev_configure(pcf->id, pcf->nb_queues, pcf->nb_queues,
&port_conf);
uint32_t port_id, i, nb_rxd, nb_txd;
struct rte_eth_dev_info dev_info;
const struct tldk_ctx_conf *ctx;
- const struct tldk_port_conf *pcf;
ctx = tcx->cf;
for (i = 0; i < ctx->nb_dev; i++) {
port_id = ctx->dev[i].port;
queue_id = ctx->dev[i].queue;
- pcf = &cf->port[port_id];
rte_eth_dev_info_get(port_id, &dev_info);
nb_txd = RTE_MIN(TX_RING_SIZE, dev_info.tx_desc_lim.nb_max);
dev_info.default_txconf.tx_free_thresh = nb_txd / 2;
- if (pcf->tx_offload != 0) {
- RTE_LOG(ERR, USER1,
- "%s(port=%u): enabling full featured TX;\n",
- __func__, port_id);
- dev_info.default_txconf.txq_flags = 0;
- }
-
socket = rte_eth_dev_socket_id(port_id);
rc = rte_eth_rx_queue_setup(port_id, queue_id, nb_rxd,
{
int32_t rc;
uint32_t i, n, smask;
- void *cb;
+ const void *cb;
const struct ptype2cb *ptype2cb;
static const struct ptype2cb tcp_ptype2cb[] = {
# Scripts require non-POSIX parts of bash
SHELL := /bin/bash
-DPDK_VERSION ?= v17.11
+DPDK_VERSION ?= v18.11
DPDK_BUILD_DIR ?= $(CURDIR)/_build
DPDK_INSTALL_DIR ?= $(DPDK_BUILD_DIR)/dpdk/$(RTE_TARGET)
DPDK_PKTMBUF_HEADROOM ?= 128
$(call set,RTE_LIBRTE_PMD_BOND,y)
$(call set,RTE_LIBRTE_IP_FRAG,y)
@# not needed
- $(call set,RTE_LIBRTE_TIMER,n)
$(call set,RTE_LIBRTE_CFGFILE,n)
- $(call set,RTE_LIBRTE_LPM,y)
- $(call set,RTE_LIBRTE_ACL,n)
$(call set,RTE_LIBRTE_POWER,n)
$(call set,RTE_LIBRTE_DISTRIBUTOR,n)
$(call set,RTE_LIBRTE_REORDER,n)
- $(call set,RTE_LIBRTE_PORT,n)
- $(call set,RTE_LIBRTE_TABLE,n)
- $(call set,RTE_LIBRTE_PIPELINE,n)
$(call set,RTE_LIBRTE_FLOW_CLASSIFY,n)
$(call set,RTE_LIBRTE_PMD_CRYPTO_SCHEDULER,n)
$(call set,RTE_KNI_KMOD,n)
static const struct rte_eth_conf port_conf_default = {
.rxmode = {
- .hw_vlan_strip = 1,
- .jumbo_frame = 0,
+ .offloads = DEV_RX_OFFLOAD_VLAN_STRIP,
},
};
{
int32_t rc;
uint32_t i, n, smask;
- void *cb;
+ const void *cb;
const struct ptype2cb *ptype2cb;
static const struct ptype2cb tcp_ptype2cb[] = {
if ((uprt->rx_offload & RX_CSUM_OFFLOAD) != 0) {
RTE_LOG(ERR, USER1, "%s(%u): enabling RX csum offload;\n",
__func__, uprt->id);
- port_conf.rxmode.hw_ip_checksum = 1;
+ port_conf.rxmode.offloads |= uprt->rx_offload & RX_CSUM_OFFLOAD;
}
port_conf.rxmode.max_rx_pkt_len = uprt->mtu + ETHER_CRC_LEN;
if (port_conf.rxmode.max_rx_pkt_len > ETHER_MAX_LEN)
- port_conf.rxmode.jumbo_frame = 1;
+ port_conf.rxmode.offloads |= DEV_RX_OFFLOAD_JUMBO_FRAME;
rc = update_rss_conf(uprt, &dev_info, &port_conf, proto);
if (rc != 0)
return rc;
+ port_conf.txmode.offloads = uprt->tx_offload;
+
rc = rte_eth_dev_configure(uprt->id, uprt->nb_lcore, uprt->nb_lcore,
&port_conf);
RTE_LOG(NOTICE, USER1,
nb_txd = RTE_MIN(TX_RING_SIZE, dev_info.tx_desc_lim.nb_max);
dev_info.default_txconf.tx_free_thresh = nb_txd / 2;
- if (uprt->tx_offload != 0) {
- RTE_LOG(ERR, USER1, "%s(%u): enabling full featured TX;\n",
- __func__, uprt->id);
- dev_info.default_txconf.txq_flags = 0;
- }
for (q = 0; q < uprt->nb_lcore; q++) {
rc = rte_eth_rx_queue_setup(uprt->id, q, nb_rxd,
vector<stream_g> gen_streams;
};
-const char *vdevargs[] = {VDEV_NAME",rx_pcap=" RX_PCAP",tx_pcap=" TX_PCAP};
+const char *vdevargs = "rx_pcap=" RX_PCAP ",tx_pcap=" TX_PCAP;
class test_tle_udp_gen_base : public testing::TestWithParam<test_str> {
public:
map<string, tle_dev *> routes4;
map<string, tle_dev *> routes6;
test_str tp;
- void *cb;
+ const void *cb;
};
int
test_tle_udp_gen_base::setup_devices(dpdk_port_t *portid)
{
/* attach + configure + start pmd device */
- if (rte_eth_dev_attach(vdevargs[0], portid) != 0)
+ if (rte_eal_hotplug_add("vdev", VDEV_NAME, vdevargs) < 0 ||
+ rte_eth_dev_get_port_by_name(VDEV_NAME, portid) != 0)
return -1;
cb = rte_eth_add_rx_callback(*portid, 0,
typen_rx_callback, nullptr);
rte_eth_dev_stop(portid);
rte_eth_dev_close(portid);
- rte_eth_dev_detach(portid, name);
+ rte_eal_hotplug_remove("vdev", VDEV_NAME);
return 0;
}