New upstream version 18.11.2
[deb_dpdk.git] / drivers / bus / vdev / vdev.c
index 2c03ca4..87f0e2b 100644 (file)
@@ -143,10 +143,11 @@ vdev_probe_all_drivers(struct rte_vdev_device *dev)
        struct rte_vdev_driver *driver;
        int ret;
 
-       name = rte_vdev_device_name(dev);
+       if (rte_dev_is_probed(&dev->device))
+               return -EEXIST;
 
-       VDEV_LOG(DEBUG, "Search driver %s to probe device %s", name,
-               rte_vdev_device_name(dev));
+       name = rte_vdev_device_name(dev);
+       VDEV_LOG(DEBUG, "Search driver to probe device %s", name);
 
        if (vdev_parse(name, &driver))
                return -1;
@@ -482,7 +483,7 @@ static int
 vdev_probe(void)
 {
        struct rte_vdev_device *dev;
-       int ret = 0;
+       int r, ret = 0;
 
        /* call the init function for each virtual device */
        TAILQ_FOREACH(dev, &vdev_device_list, next) {
@@ -491,10 +492,10 @@ vdev_probe(void)
                 * we call each driver probe.
                 */
 
-               if (rte_dev_is_probed(&dev->device))
-                       continue;
-
-               if (vdev_probe_all_drivers(dev)) {
+               r = vdev_probe_all_drivers(dev);
+               if (r != 0) {
+                       if (r == -EEXIST)
+                               continue;
                        VDEV_LOG(ERR, "failed to initialize %s device",
                                rte_vdev_device_name(dev));
                        ret = -1;