From 6c75cd2242c26819b6456578497db3e3eccf7ef6 Mon Sep 17 00:00:00 2001 From: Damjan Marion Date: Tue, 11 Jan 2022 23:21:08 +0100 Subject: dpdk: bump to DPDK v21.11 Type: feature This patch bumps dpdk version from 21.08 to 21.11 Change-Id: Id37fdba75f1ea4f4eac3c92226f3b1c539e1daca Signed-off-by: Dastin Wilski Signed-off-by: Damjan Marion --- build/external/packages/dpdk.mk | 3 ++- src/plugins/dpdk/cryptodev/cryptodev.c | 11 +++++----- .../dpdk/cryptodev/cryptodev_op_data_path.c | 1 - .../dpdk/cryptodev/cryptodev_raw_data_path.c | 2 +- src/plugins/dpdk/device/common.c | 25 ++++++++++++++++++++-- src/plugins/dpdk/device/init.c | 9 +------- 6 files changed, 33 insertions(+), 18 deletions(-) diff --git a/build/external/packages/dpdk.mk b/build/external/packages/dpdk.mk index 2a2c27ba375..72068261800 100644 --- a/build/external/packages/dpdk.mk +++ b/build/external/packages/dpdk.mk @@ -22,9 +22,10 @@ DPDK_FAILSAFE_PMD ?= n DPDK_MACHINE ?= default DPDK_MLX_IBV_LINK ?= static -dpdk_version ?= 21.08 +dpdk_version ?= 21.11 dpdk_base_url ?= http://fast.dpdk.org/rel dpdk_tarball := dpdk-$(dpdk_version).tar.xz +dpdk_tarball_md5sum_21.11 := 58660bbbe9e95abce86e47692b196555 dpdk_tarball_md5sum_21.08 := de33433a1806280996a0ecbe66e3642f dpdk_tarball_md5sum_21.05 := a78bba290b11d9717d1272cc6bfaf7c3 dpdk_tarball_md5sum := $(dpdk_tarball_md5sum_$(dpdk_version)) diff --git a/src/plugins/dpdk/cryptodev/cryptodev.c b/src/plugins/dpdk/cryptodev/cryptodev.c index ab07e60519a..f9e986f9867 100644 --- a/src/plugins/dpdk/cryptodev/cryptodev.c +++ b/src/plugins/dpdk/cryptodev/cryptodev.c @@ -29,7 +29,6 @@ #include #include #include -#include #include #include "cryptodev.h" @@ -380,6 +379,7 @@ cryptodev_session_create (vlib_main_t *vm, vnet_crypto_key_index_t idx, struct rte_crypto_sym_xform xforms_enc[2] = { { 0 } }; struct rte_crypto_sym_xform xforms_dec[2] = { { 0 } }; struct rte_cryptodev_sym_session *sessions[CRYPTODEV_N_OP_TYPES] = { 0 }; + struct rte_cryptodev_info dev_info; u32 numa_node = vm->numa_node; clib_error_t *error; int ret = 0; @@ -447,8 +447,8 @@ cryptodev_session_create (vlib_main_t *vm, vnet_crypto_key_index_t idx, vec_foreach (dev_inst, cmt->cryptodev_inst) { u32 dev_id = dev_inst->dev_id; - struct rte_cryptodev *cdev = rte_cryptodev_pmd_get_dev (dev_id); - u32 driver_id = cdev->driver_id; + rte_cryptodev_info_get (dev_id, &dev_info); + u32 driver_id = dev_info.driver_id; /* if the session is already configured for the driver type, avoid configuring it again to increase the session data's refcnt */ @@ -1117,6 +1117,7 @@ dpdk_cryptodev_init (vlib_main_t * vm) cryptodev_engine_thread_t *cet; cryptodev_numa_data_t *numa_data; cryptodev_inst_t *dev_inst; + struct rte_cryptodev_info dev_info; u32 node; u8 nodes = 0; u32 skip_master = vlib_num_workers () > 0; @@ -1150,8 +1151,8 @@ dpdk_cryptodev_init (vlib_main_t * vm) vec_foreach (dev_inst, cmt->cryptodev_inst) { u32 dev_id = dev_inst->dev_id; - struct rte_cryptodev *cdev = rte_cryptodev_pmd_get_dev (dev_id); - u32 driver_id = cdev->driver_id; + rte_cryptodev_info_get (dev_id, &dev_info); + u32 driver_id = dev_info.driver_id; is_drv_unique (driver_id, &unique_drivers); u32 sess_sz = diff --git a/src/plugins/dpdk/cryptodev/cryptodev_op_data_path.c b/src/plugins/dpdk/cryptodev/cryptodev_op_data_path.c index 9b5746723a9..47cc15aaaff 100644 --- a/src/plugins/dpdk/cryptodev/cryptodev_op_data_path.c +++ b/src/plugins/dpdk/cryptodev/cryptodev_op_data_path.c @@ -27,7 +27,6 @@ #include #include #include -#include #include #include diff --git a/src/plugins/dpdk/cryptodev/cryptodev_raw_data_path.c b/src/plugins/dpdk/cryptodev/cryptodev_raw_data_path.c index 6793b9a589f..a7743133247 100644 --- a/src/plugins/dpdk/cryptodev/cryptodev_raw_data_path.c +++ b/src/plugins/dpdk/cryptodev/cryptodev_raw_data_path.c @@ -29,7 +29,7 @@ #include #include #include -#include +#include #include #include "cryptodev.h" diff --git a/src/plugins/dpdk/device/common.c b/src/plugins/dpdk/device/common.c index 8396386510c..3eca847de79 100644 --- a/src/plugins/dpdk/device/common.c +++ b/src/plugins/dpdk/device/common.c @@ -103,7 +103,10 @@ dpdk_device_setup (dpdk_device_t * xd) if (xd->conf.disable_multi_seg == 0) { txo |= DEV_TX_OFFLOAD_MULTI_SEGS; - rxo |= DEV_RX_OFFLOAD_JUMBO_FRAME | DEV_RX_OFFLOAD_SCATTER; + rxo |= DEV_RX_OFFLOAD_SCATTER; +#if RTE_VERSION < RTE_VERSION_NUM(21, 11, 0, 0) + rxo |= DEV_RX_OFFLOAD_JUMBO_FRAME; +#endif } if (xd->conf.enable_lro) @@ -156,13 +159,31 @@ dpdk_device_setup (dpdk_device_t * xd) } } +#if RTE_VERSION < RTE_VERSION_NUM(21, 11, 0, 0) if (rxo & DEV_RX_OFFLOAD_JUMBO_FRAME) conf.rxmode.max_rx_pkt_len = clib_min (ETHERNET_MAX_PACKET_BYTES, dev_info.max_rx_pktlen); - +#else + dpdk_log_debug ("[%u] min_mtu: %u, max_mtu: %u, min_rx_bufsize: %u, " + "max_rx_pktlen: %u, max_lro_pkt_size: %u", + xd->port_id, dev_info.min_mtu, dev_info.max_mtu, + dev_info.min_rx_bufsize, dev_info.max_rx_pktlen, + dev_info.max_lro_pkt_size); + + mtu = xd->conf.disable_multi_seg ? 2000 : ETHERNET_MAX_PACKET_BYTES; + conf.rxmode.mtu = clib_min (mtu, dev_info.max_rx_pktlen); +#endif + +retry: rv = rte_eth_dev_configure (xd->port_id, xd->conf.n_rx_queues, xd->conf.n_tx_queues, &conf); + if (rv < 0 && conf.intr_conf.rxq) + { + conf.intr_conf.rxq = 0; + goto retry; + } + if (rv < 0) { dpdk_device_error (xd, "rte_eth_dev_configure", rv); diff --git a/src/plugins/dpdk/device/init.c b/src/plugins/dpdk/device/init.c index a515bca359d..1d3e061aaaf 100644 --- a/src/plugins/dpdk/device/init.c +++ b/src/plugins/dpdk/device/init.c @@ -456,14 +456,7 @@ dpdk_lib_init (dpdk_main_t * dm) xd->port_type = VNET_DPDK_PORT_TYPE_ETH_1G; xd->conf.n_rx_desc = DPDK_NB_RX_DESC_VIRTIO; xd->conf.n_tx_desc = DPDK_NB_TX_DESC_VIRTIO; - /* - * Enable use of RX interrupts if supported. - * - * There is no device flag or capability for this, so - * use the same check that the virtio driver does. - */ - if (pci_dev && rte_intr_cap_multiple (&pci_dev->intr_handle)) - xd->conf.enable_rxq_int = 1; + xd->conf.enable_rxq_int = 1; break; /* vmxnet3 */ -- cgit 1.2.3-korg