[dpdk-dev] [PATCH] dev: fix virtual dev attach

Gaetan Rivet gaetan.rivet at 6wind.com
Mon Jul 31 12:57:05 CEST 2017


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 at 6wind.com>
---
 lib/librte_eal/common/eal_common_dev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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;
 
 	/*
-- 
2.1.4



More information about the dev mailing list