Commit b7349216 authored by Cunyin Chang's avatar Cunyin Chang Committed by Jim Harris
Browse files

nvme: optimization for nvme probe and detachment.



remove the unnecessary rte_eal_pci_probe_one() in function
spdk_pci_device_detach(), this could cause error message when we
terminate the application, it will also not make sense try to probe one
device after we detach it, we could call spdk_pci_nvme_device_attach()
instead of spdk_pci_nvme_enumerate() when we have one given device address,
dpdk will try to scan the device and add it back to pci device list then.

Change-Id: I35f5bb412249bb20da57394f0531c10a49691906
Signed-off-by: default avatarCunyin Chang <cunyin.chang@intel.com>
parent f75fe739
Loading
Loading
Loading
Loading
+0 −5
Original line number Diff line number Diff line
@@ -87,11 +87,6 @@ spdk_pci_device_detach(struct spdk_pci_device *device)
	rte_eal_device_remove(&device->device);
#endif
	rte_eal_pci_detach(&addr);
	/* This will not actually load any drivers because our
	 * callback isn't set, but it will re-add the device
	 * to DPDK's internal list.
	 */
	rte_eal_pci_probe_one(&addr);
}

int
+5 −1
Original line number Diff line number Diff line
@@ -644,7 +644,11 @@ nvme_pcie_ctrlr_scan(const struct spdk_nvme_transport_id *trid,
		_nvme_pcie_hotplug_monitor(cb_ctx, probe_cb, remove_cb);
	}

	if (enum_ctx.has_pci_addr == false) {
		return spdk_pci_nvme_enumerate(pcie_nvme_enum_cb, &enum_ctx);
	} else {
		return spdk_pci_nvme_device_attach(pcie_nvme_enum_cb, &enum_ctx, &enum_ctx.pci_addr);
	}
}

static int