From: Anatoly Burakov Date: Fri, 18 Nov 2016 16:32:49 +0000 (+0000) Subject: vdev: fix detaching with alias X-Git-Tag: spdx-start~5289 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=c431384c8fbf8503693bcae1bdcd58d6fa459b8a;p=dpdk.git vdev: fix detaching with alias Fixes: d63eed6b2dca ("eal: add driver name alias") Signed-off-by: Anatoly Burakov Acked-by: Thomas Monjalon --- diff --git a/lib/librte_eal/common/eal_common_vdev.c b/lib/librte_eal/common/eal_common_vdev.c index 0ff2377dd6..7d6e54f446 100644 --- a/lib/librte_eal/common/eal_common_vdev.c +++ b/lib/librte_eal/common/eal_common_vdev.c @@ -111,6 +111,14 @@ rte_eal_vdev_uninit(const char *name) return driver->remove(name); } + /* 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->remove(name); + } + RTE_LOG(ERR, EAL, "no driver found for %s\n", name); return -EINVAL; }