eal: add driver name alias
[dpdk.git] / lib / librte_eal / common / eal_common_vdev.c
index 8b05f50..0ff2377 100644 (file)
@@ -79,6 +79,14 @@ rte_eal_vdev_init(const char *name, const char *args)
                        return driver->probe(name, args);
        }
 
+       /* Give new names precedence over aliases. */
+       TAILQ_FOREACH(driver, &vdev_driver_list, next) {
+               if (driver->driver.alias &&
+                   !strncmp(driver->driver.alias, name,
+                           strlen(driver->driver.alias)))
+                       return driver->probe(name, args);
+       }
+
        RTE_LOG(ERR, EAL, "no driver found for %s\n", name);
        return -EINVAL;
 }