diff --git a/lib/env_dpdk/env_internal.h b/lib/env_dpdk/env_internal.h index c7900d9d3..2303f432c 100644 --- a/lib/env_dpdk/env_internal.h +++ b/lib/env_dpdk/env_internal.h @@ -46,8 +46,8 @@ #include #include -#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], diff --git a/lib/env_dpdk/init.c b/lib/env_dpdk/init.c index c03e74584..8778fbadb 100644 --- a/lib/env_dpdk/init.c +++ b/lib/env_dpdk/init.c @@ -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", diff --git a/lib/env_dpdk/memory.c b/lib/env_dpdk/memory.c index 20ab9f051..c6f920ed6 100644 --- a/lib/env_dpdk/memory.c +++ b/lib/env_dpdk/memory.c @@ -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.