From 58ae282df8419d5113e28197c7273d589c792d60 Mon Sep 17 00:00:00 2001 From: Darek Stojaczyk Date: Tue, 20 Nov 2018 20:40:07 +0100 Subject: [PATCH] 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 Reviewed-on: https://review.gerrithub.io/434410 (master) Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/448371 Reviewed-by: Jim Harris Reviewed-by: Ben Walker Tested-by: SPDK CI Jenkins --- lib/env_dpdk/pci.c | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/lib/env_dpdk/pci.c b/lib/env_dpdk/pci.c index f808c0f731..7473125cac 100644 --- a/lib/env_dpdk/pci.c +++ b/lib/env_dpdk/pci.c @@ -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