From patchwork Wed May 10 11:01:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ferruh Yigit X-Patchwork-Id: 24196 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id A7CC82BAA; Wed, 10 May 2017 13:01:10 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 698912BAA for ; Wed, 10 May 2017 13:01:09 +0200 (CEST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga105.jf.intel.com with ESMTP; 10 May 2017 04:01:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos; i="5.38,318,1491289200"; d="scan'208"; a="1167129084" Received: from silpixa00372839.ir.intel.com (HELO silpixa00372839.ger.corp.intel.com) ([10.237.222.154]) by fmsmga002.fm.intel.com with ESMTP; 10 May 2017 04:01:06 -0700 From: Ferruh Yigit To: Jan Blunck , Gaetan Rivet , Tetsuya Mukawa , Declan Doherty Cc: dev@dpdk.org, Ferruh Yigit Date: Wed, 10 May 2017 12:01:04 +0100 Message-Id: <20170510110104.70838-1-ferruh.yigit@intel.com> X-Mailer: git-send-email 2.9.3 Subject: [dpdk-dev] [PATCH] eal: remove vdev probe by dev args X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Virtual device/driver probing done via name. A new alternative method introduced to probe the device with providing driver name in devargs as "driver=". This patch removes alternative method and fixes virtual device usages with proper device names. Fixes: 87c3bf29c642 ("test: do not short-circuit null device creation") Fixes: d39670086a63 ("eal: parse driver argument before probing drivers") Signed-off-by: Ferruh Yigit --- drivers/net/null/rte_eth_null.c | 1 - lib/librte_eal/common/eal_common_vdev.c | 40 ++------------------------------- test/test/test_link_bonding_rssconf.c | 5 ++--- 3 files changed, 4 insertions(+), 42 deletions(-) diff --git a/drivers/net/null/rte_eth_null.c b/drivers/net/null/rte_eth_null.c index 2c94339..5aef059 100644 --- a/drivers/net/null/rte_eth_null.c +++ b/drivers/net/null/rte_eth_null.c @@ -49,7 +49,6 @@ static unsigned default_packet_copy; static const char *valid_arguments[] = { ETH_NULL_PACKET_SIZE_ARG, ETH_NULL_PACKET_COPY_ARG, - "driver", NULL }; diff --git a/lib/librte_eal/common/eal_common_vdev.c b/lib/librte_eal/common/eal_common_vdev.c index 0037a64..8744cc1 100644 --- a/lib/librte_eal/common/eal_common_vdev.c +++ b/lib/librte_eal/common/eal_common_vdev.c @@ -70,48 +70,14 @@ rte_vdev_unregister(struct rte_vdev_driver *driver) TAILQ_REMOVE(&vdev_driver_list, driver, next); } -/* - * Parse "driver" devargs without adding a dependency on rte_kvargs.h - */ -static char *parse_driver_arg(const char *args) -{ - const char *c; - char *str; - - if (!args || args[0] == '\0') - return NULL; - - c = args; - - do { - if (strncmp(c, "driver=", 7) == 0) { - c += 7; - break; - } - - c = strchr(c, ','); - if (c) - c++; - } while (c); - - if (c) - str = strdup(c); - else - str = NULL; - - return str; -} - static int vdev_probe_all_drivers(struct rte_vdev_device *dev) { const char *name; - char *drv_name; struct rte_vdev_driver *driver; int ret = 1; - drv_name = parse_driver_arg(rte_vdev_device_args(dev)); - name = drv_name ? drv_name : rte_vdev_device_name(dev); + name = rte_vdev_device_name(dev); RTE_LOG(DEBUG, EAL, "Search driver %s to probe device %s\n", name, rte_vdev_device_name(dev)); @@ -129,7 +95,7 @@ vdev_probe_all_drivers(struct rte_vdev_device *dev) ret = driver->probe(dev); if (ret) dev->device.driver = NULL; - goto out; + return ret; } } @@ -146,8 +112,6 @@ vdev_probe_all_drivers(struct rte_vdev_device *dev) } } -out: - free(drv_name); return ret; } diff --git a/test/test/test_link_bonding_rssconf.c b/test/test/test_link_bonding_rssconf.c index d28db7d..dcbc9d1 100644 --- a/test/test/test_link_bonding_rssconf.c +++ b/test/test/test_link_bonding_rssconf.c @@ -62,7 +62,7 @@ #define BONDED_DEV_NAME ("rssconf_bond_dev") -#define SLAVE_DEV_NAME_FMT ("rssconf_slave%d") +#define SLAVE_DEV_NAME_FMT ("net_null%d") #define SLAVE_RXTX_QUEUE_FMT ("rssconf_slave%d_q%d") #define NUM_MBUFS 8191 @@ -550,8 +550,7 @@ test_setup(void) port_id = rte_eth_dev_count(); snprintf(name, sizeof(name), SLAVE_DEV_NAME_FMT, port_id); - retval = rte_vdev_init(name, - "driver=net_null,size=64,copy=0"); + retval = rte_vdev_init(name, "size=64,copy=0"); TEST_ASSERT_SUCCESS(retval, "Failed to create null device '%s'\n", name);