From 480b0b9ed8ac3ef9012d94b4c5879fb86e9889d6 Mon Sep 17 00:00:00 2001 From: Darek Stojaczyk Date: Wed, 26 Dec 2018 10:12:23 +0100 Subject: [PATCH] pci: rescan the bus on device enumeration The enumerate callback doesn't currently iterate through any hotplugged devices, as it uses an outdated device list underneath. What updates that list is a bus rescan, which happens implicitly on DPDK init or a specific device attach. This wasn't crucial until we refactored NVMe bdev hotplug poller to use enumerate instead of attach, which broke the hotplug entirely. Unluckily, the hotplug tests were broken as well and didn't detect this in time. We fix the above by rescanning the pci bus before iterating through its devices inside spdk_pci_enumerate(). Change-Id: I9643514ff07883eff0f3004b6991ca43ce0b2804 Signed-off-by: Darek Stojaczyk Reviewed-on: https://review.gerrithub.io/c/438243 Tested-by: SPDK CI Jenkins Chandler-Test-Pool: SPDK Automated Test System Reviewed-by: Jim Harris Reviewed-by: Shuhei Matsumoto --- lib/env_dpdk/pci.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/env_dpdk/pci.c b/lib/env_dpdk/pci.c index ec32e56af..e76d06898 100644 --- a/lib/env_dpdk/pci.c +++ b/lib/env_dpdk/pci.c @@ -373,11 +373,11 @@ spdk_pci_enumerate(struct spdk_pci_driver *driver, driver->cb_arg = enum_ctx; #if RTE_VERSION >= RTE_VERSION_NUM(17, 11, 0, 3) - if (rte_bus_probe() != 0) { + if (rte_bus_scan() != 0 || rte_bus_probe() != 0) { #elif RTE_VERSION >= RTE_VERSION_NUM(17, 05, 0, 4) - if (rte_pci_probe() != 0) { + if (rte_pci_scan() != 0 || rte_pci_probe() != 0) { #else - if (rte_eal_pci_probe() != 0) { + if (rte_eal_pci_scan() != 0 || rte_eal_pci_probe() != 0) { #endif driver->cb_arg = NULL; driver->cb_fn = NULL;