Commit 5502004d authored by Ben Walker's avatar Ben Walker
Browse files

nvme: After detach, force the device back into DPDK's internal list



Change-Id: I0d745034d8319bc864d91e891b7c9bd0f7c25b6d
Signed-off-by: default avatarBen Walker <benjamin.walker@intel.com>
parent 34f052d2
Loading
Loading
Loading
Loading
+13 −1
Original line number Diff line number Diff line
@@ -76,10 +76,22 @@ spdk_pci_device_fini(struct rte_pci_device *device)
void
spdk_pci_device_detach(struct spdk_pci_device *device)
{
	struct rte_pci_addr	addr;

	addr.domain = device->addr.domain;
	addr.bus = device->addr.bus;
	addr.devid = device->addr.devid;
	addr.function = device->addr.function;

#if RTE_VERSION >= RTE_VERSION_NUM(16, 11, 0, 0)
	rte_eal_device_remove(&device->device);
#endif
	rte_eal_pci_detach(&device->addr);
	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