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: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/434410 (master)
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/448371
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
Darek Stojaczyk 2018-11-20 20:40:07 +01:00
parent 438c430058
commit 58ae282df8

View File

@ -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