lib/env: move minimum DPDK version to DPDK 19.11

SPDK supports two latest DPDK LTS releases and DPDK 20.11
is out now.

Remove all functionality and checks for versions <= DPDK 19.11.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: Ib4c750c49352fe4ad4b50c7a719867387808f0df
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5343
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
This commit is contained in:
Tomasz Zawadzki 2020-11-30 07:51:35 -05:00
parent d3a6cb8444
commit 6bb83abdef
3 changed files with 7 additions and 30 deletions

View File

@ -46,8 +46,8 @@
#include <rte_bus_pci.h>
#include <rte_dev.h>
#if RTE_VERSION < RTE_VERSION_NUM(18, 11, 0, 0)
#error RTE_VERSION is too old! Minimum 18.11 is required.
#if RTE_VERSION < RTE_VERSION_NUM(19, 11, 0, 0)
#error RTE_VERSION is too old! Minimum 19.11 is required.
#endif
/* x86-64 and ARM userspace virtual addresses use only the low 48 bits [0..47],

View File

@ -453,14 +453,12 @@ build_eal_cmdline(const struct spdk_env_opts *opts)
* physically or IOVA contiguous memory regions, then when we go to allocate a buffer pool, it can split
* the memory for a buffer over two allocations meaning the buffer will be split over a memory region.
*/
#if RTE_VERSION >= RTE_VERSION_NUM(19, 02, 0, 0)
if (!opts->env_context || strstr(opts->env_context, "--legacy-mem") == NULL) {
args = push_arg(args, &argcount, _sprintf_alloc("%s", "--match-allocations"));
if (args == NULL) {
return -1;
}
}
#endif
if (opts->shm_id < 0) {
args = push_arg(args, &argcount, _sprintf_alloc("--file-prefix=spdk_pid%d",

View File

@ -710,25 +710,16 @@ memory_hotplug_cb(enum rte_mem_event event_type,
if (event_type == RTE_MEM_EVENT_ALLOC) {
spdk_mem_register((void *)addr, len);
#if RTE_VERSION >= RTE_VERSION_NUM(19, 02, 0, 0)
if (!spdk_env_dpdk_external_init()) {
return;
}
#endif
/* Prior to DPDK 19.02, we have to worry about DPDK
* freeing memory in different units than it was allocated.
* That doesn't work with things like RDMA MRs. So for
* those versions of DPDK, mark each segment so that DPDK
* won't later free it. That ensures we don't have to deal
* with that scenario.
/* When the user initialized DPDK separately, we can't
* be sure that --match-allocations RTE flag was specified.
* Without this flag, DPDK can free memory in different units
* than it was allocated. It doesn't work with things like RDMA MRs.
*
* DPDK 19.02 added the --match-allocations RTE flag to
* avoid this condition.
*
* Note: if the user initialized DPDK separately, we can't
* be sure that --match-allocations was specified, so need
* to still mark the segments so they aren't freed.
* For such cases, we mark segments so they aren't freed.
*/
while (len > 0) {
struct rte_memseg *seg;
@ -921,11 +912,7 @@ vtophys_get_paddr_memseg(uint64_t vaddr)
seg = rte_mem_virt2memseg((void *)(uintptr_t)vaddr, NULL);
if (seg != NULL) {
#if RTE_VERSION >= RTE_VERSION_NUM(19, 11, 0, 0)
paddr = seg->iova;
#else
paddr = seg->phys_addr;
#endif
if (paddr == RTE_BAD_IOVA) {
return SPDK_VTOPHYS_ERROR;
}
@ -1022,11 +1009,7 @@ vtophys_notify(void *cb_ctx, struct spdk_mem_map *map,
#if VFIO_ENABLED
enum rte_iova_mode iova_mode;
#if RTE_VERSION >= RTE_VERSION_NUM(19, 11, 0, 0)
iova_mode = rte_eal_iova_mode();
#else
iova_mode = rte_eal_get_configuration()->iova_mode;
#endif
if (spdk_iommu_is_enabled() && iova_mode == RTE_IOVA_VA) {
/* We'll use the virtual address as the iova to match DPDK. */
@ -1134,11 +1117,7 @@ vtophys_notify(void *cb_ctx, struct spdk_mem_map *map,
uint8_t *va = vaddr;
enum rte_iova_mode iova_mode;
#if RTE_VERSION >= RTE_VERSION_NUM(19, 11, 0, 0)
iova_mode = rte_eal_iova_mode();
#else
iova_mode = rte_eal_get_configuration()->iova_mode;
#endif
/*
* In virtual address mode, the region is contiguous and can be done in
* one unmap.