From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id A33DC5585 for ; Fri, 18 Nov 2016 17:32:51 +0100 (CET) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga105.fm.intel.com with ESMTP; 18 Nov 2016 08:32:50 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,510,1473145200"; d="scan'208";a="788071368" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by FMSMGA003.fm.intel.com with ESMTP; 18 Nov 2016 08:32:50 -0800 Received: from sivswdev02.ir.intel.com (sivswdev02.ir.intel.com [10.237.217.46]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id uAIGWnAg006251 for ; Fri, 18 Nov 2016 16:32:49 GMT Received: from sivswdev02.ir.intel.com (localhost [127.0.0.1]) by sivswdev02.ir.intel.com with ESMTP id uAIGWnS0019327 for ; Fri, 18 Nov 2016 16:32:49 GMT Received: (from aburakov@localhost) by sivswdev02.ir.intel.com with œ id uAIGWnHn019323 for dev@dpdk.org; Fri, 18 Nov 2016 16:32:49 GMT From: Anatoly Burakov To: dev@dpdk.org Date: Fri, 18 Nov 2016 16:32:49 +0000 Message-Id: X-Mailer: git-send-email 1.7.0.7 Subject: [dpdk-dev] [PATCH] vdev: fix missing alias check on uninit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Nov 2016 16:32:53 -0000 Fixes: d63eed6b2dca ("eal: add driver name alias") Signed-off-by: Anatoly Burakov --- lib/librte_eal/common/eal_common_vdev.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/librte_eal/common/eal_common_vdev.c b/lib/librte_eal/common/eal_common_vdev.c index 0ff2377..7d6e54f 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; } -- 2.5.5