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 <dariusz.stojaczyk@intel.com> Reviewed-on: https://review.gerrithub.io/c/438243 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
This commit is contained in:
parent
6af0c997ef
commit
480b0b9ed8
@ -373,11 +373,11 @@ spdk_pci_enumerate(struct spdk_pci_driver *driver,
|
|||||||
driver->cb_arg = enum_ctx;
|
driver->cb_arg = enum_ctx;
|
||||||
|
|
||||||
#if RTE_VERSION >= RTE_VERSION_NUM(17, 11, 0, 3)
|
#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)
|
#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
|
#else
|
||||||
if (rte_eal_pci_probe() != 0) {
|
if (rte_eal_pci_scan() != 0 || rte_eal_pci_probe() != 0) {
|
||||||
#endif
|
#endif
|
||||||
driver->cb_arg = NULL;
|
driver->cb_arg = NULL;
|
||||||
driver->cb_fn = NULL;
|
driver->cb_fn = NULL;
|
||||||
|
Loading…
Reference in New Issue
Block a user