[dpdk-dev] dev: fix virtual dev attach

Message ID 30721dc00d3d6e2509974511ba4c7d1850191d77.1501496837.git.gaetan.rivet@6wind.com (mailing list archive)
State Superseded, archived
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Gaëtan Rivet July 31, 2017, 10:57 a.m. UTC
  If the device cannot be parsed as a PCI device, the rte_devargs
function returns -EFAULT. This error code signifies that the address
given to the PCI bus is invalid. When it happens, the best course of
action is to try to plug the device using the vdev bus.

Fixes: 1c35f666df07 ("dev: fix attach proceeding with vdev on PCI
success")

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
---
 lib/librte_eal/common/eal_common_dev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Patch

diff --git a/lib/librte_eal/common/eal_common_dev.c b/lib/librte_eal/common/eal_common_dev.c
index d74f978..97b063e 100644
--- a/lib/librte_eal/common/eal_common_dev.c
+++ b/lib/librte_eal/common/eal_common_dev.c
@@ -74,7 +74,7 @@  int rte_eal_dev_attach(const char *name, const char *devargs)
 	}
 
 	ret = rte_eal_hotplug_add("pci", name, devargs);
-	if (ret != -EINVAL)
+	if (ret != -EINVAL && ret != -EFAULT)
 		return ret;
 
 	/*