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 64D033DC for ; Sun, 5 Mar 2017 22:35:09 +0100 (CET) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga105.fm.intel.com with ESMTP; 05 Mar 2017 13:35:08 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.35,250,1484035200"; d="scan'208";a="232565485" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.254.177.89]) ([10.254.177.89]) by fmsmga004.fm.intel.com with ESMTP; 05 Mar 2017 13:35:06 -0800 To: Pascal Mazon , keith.wiles@intel.com References: <1ad979ca71ba1ebe10572237a6a5b4694c23b645.1488531158.git.pascal.mazon@6wind.com> Cc: dev@dpdk.org From: Ferruh Yigit Message-ID: <83e0d49d-e2b5-1b4b-288f-2d0eaaedc94b@intel.com> Date: Sun, 5 Mar 2017 21:35:04 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 MIME-Version: 1.0 In-Reply-To: <1ad979ca71ba1ebe10572237a6a5b4694c23b645.1488531158.git.pascal.mazon@6wind.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-dev] [PATCH] net/tap: fix dev name look-up 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: , X-List-Received-Date: Sun, 05 Mar 2017 21:35:09 -0000 On 3/3/2017 8:54 AM, Pascal Mazon wrote: > The call to rte_eth_dev_allocate(tap_name) sets dev->data->name to > tap_name (e.g. "dtap0"). > > A look-up using tap_name is expected to return this device, not a > look-up using name (e.g. "net_tap0"). This will break rte_pmd_tap_remove(), because it gets device name (net_tap0) as parameter. And logically this is wrong too, current eth_dev->data->name is to keep device name, all other PMDs use this way, not for Linux interface name. Current tap PMD, first gives "dtap0" to rte_eth_dev_allocate() as argument, which sets device name to this value. Later with snprintf() overwrites the device name with correct value, I think better thing to do is give correct argument to rte_eth_dev_allocate() and remove snprintf() > > Signed-off-by: Pascal Mazon > --- > drivers/net/tap/rte_eth_tap.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c > index 47a706070652..14c345f07afa 100644 > --- a/drivers/net/tap/rte_eth_tap.c > +++ b/drivers/net/tap/rte_eth_tap.c > @@ -691,7 +691,7 @@ eth_dev_tap_create(const char *name, char *tap_name) > dev->driver = NULL; > dev->rx_pkt_burst = pmd_rx_burst; > dev->tx_pkt_burst = pmd_tx_burst; > - snprintf(dev->data->name, sizeof(dev->data->name), "%s", name); > + snprintf(dev->data->name, sizeof(dev->data->name), "%s", tap_name); > > /* Presetup the fds to -1 as being not valid */ > for (i = 0; i < RTE_PMD_TAP_MAX_QUEUES; i++) { >