Commit 2bedc03d authored by Darek Stojaczyk's avatar Darek Stojaczyk Committed by Jim Harris
Browse files

pci: remove error prints on detach failures



DPDK already prints at least one error message, so
there's no need to print a yet another one.

Change-Id: I1c7bdfe5ca2095b93ec282bf193a717627d5fa27
Signed-off-by: default avatarDarek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/434410


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
parent 8acb61ef
Loading
Loading
Loading
Loading
+3 −13
Original line number Diff line number Diff line
@@ -103,22 +103,12 @@ spdk_pci_device_fini(struct rte_pci_device *_dev)
void
spdk_pci_device_detach(struct spdk_pci_device *dev)
{
	struct rte_pci_device *device = dev->dev_handle;

#if RTE_VERSION >= RTE_VERSION_NUM(18, 11, 0, 0)
	rte_eal_hotplug_remove("pci", device->device.name);
#elif RTE_VERSION >= RTE_VERSION_NUM(17, 11, 0, 3)
	struct rte_pci_device *device = dev->dev_handle;
	struct spdk_pci_addr	addr;
	char			bdf[32];

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

	spdk_pci_addr_fmt(bdf, sizeof(bdf), &addr);
	if (rte_eal_dev_detach(&device->device) < 0) {
		fprintf(stderr, "Failed to detach PCI device %s (device already removed?).\n", bdf);
	}
	rte_eal_dev_detach(&device->device);
#elif RTE_VERSION >= RTE_VERSION_NUM(17, 05, 0, 4)
	rte_pci_detach(&device->addr);
#else