From 3cc92124d007cc690ad374ede910a7ff7994c75a Mon Sep 17 00:00:00 2001 From: Darek Stojaczyk Date: Sun, 18 Nov 2018 00:48:44 +0100 Subject: [PATCH] pci: do not manually unmap resources if probe fails We need to do it only for DPDK 16.11, which leaks the mappings otherwise. DPDK was fixed in version 17.02 with the following commit: e84ad157 (pci: unmap resources if probe fails) Unmapping the resources twice doesn't actually cause us any trouble, but prints an ambiguous error message. Change-Id: I8b62e86d5fff8fe924dbf9ae2e37cff29298d412 Signed-off-by: Darek Stojaczyk Reviewed-on: https://review.gerrithub.io/433863 (master) Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/448367 Reviewed-by: Jim Harris Reviewed-by: Ben Walker Tested-by: SPDK CI Jenkins --- lib/env_dpdk/pci.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/env_dpdk/pci.c b/lib/env_dpdk/pci.c index 2d5aeccb2..b94bc424a 100644 --- a/lib/env_dpdk/pci.c +++ b/lib/env_dpdk/pci.c @@ -48,9 +48,7 @@ spdk_pci_device_init(struct rte_pci_driver *driver, int rc; if (!ctx->cb_fn) { -#if RTE_VERSION >= RTE_VERSION_NUM(17, 05, 0, 4) - rte_pci_unmap_device(device); -#elif RTE_VERSION >= RTE_VERSION_NUM(16, 11, 0, 0) +#if RTE_VERSION >= RTE_VERSION_NUM(16, 11, 0, 0) && RTE_VERSION < RTE_VERSION_NUM(17, 02, 0, 1) rte_eal_pci_unmap_device(device); #endif