Commit 480b0b9e authored by Darek Stojaczyk's avatar Darek Stojaczyk Committed by Jim Harris
Browse files

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: default avatarDarek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/c/438243


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
parent 6af0c997
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -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;