From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id 88ABE3772 for ; Mon, 6 Mar 2017 15:15:28 +0100 (CET) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga104.jf.intel.com with ESMTP; 06 Mar 2017 06:15:27 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.35,254,1484035200"; d="scan'208";a="73289487" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by fmsmga006.fm.intel.com with ESMTP; 06 Mar 2017 06:15:27 -0800 Received: from fmsmsx126.amr.corp.intel.com (10.18.125.43) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.248.2; Mon, 6 Mar 2017 06:15:27 -0800 Received: from fmsmsx113.amr.corp.intel.com ([169.254.13.172]) by FMSMSX126.amr.corp.intel.com ([169.254.1.200]) with mapi id 14.03.0248.002; Mon, 6 Mar 2017 06:15:26 -0800 From: "Wiles, Keith" To: "Yigit, Ferruh" CC: Pascal Mazon , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH] net/tap: fix dev name look-up Thread-Index: AQHSk/vvpgtB5ZhQ90aruQhnYomA/qGHTtgAgAEXfoA= Date: Mon, 6 Mar 2017 14:15:26 +0000 Message-ID: <50C67BB6-76E8-4CB0-9493-284CA82B5DC4@intel.com> References: <1ad979ca71ba1ebe10572237a6a5b4694c23b645.1488531158.git.pascal.mazon@6wind.com> <83e0d49d-e2b5-1b4b-288f-2d0eaaedc94b@intel.com> In-Reply-To: <83e0d49d-e2b5-1b4b-288f-2d0eaaedc94b@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.254.49.209] Content-Type: text/plain; charset="us-ascii" Content-ID: <727FE9AD32EE384CA807A83B15BA7789@intel.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 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: Mon, 06 Mar 2017 14:15:29 -0000 > On Mar 5, 2017, at 3:35 PM, Yigit, Ferruh wrote: >=20 > 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"). >>=20 >> A look-up using tap_name is expected to return this device, not a >> look-up using name (e.g. "net_tap0"). >=20 > This will break rte_pmd_tap_remove(), because it gets device name > (net_tap0) as parameter. >=20 > 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. >=20 > 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= () All of these different names for the device is driving me crazy :-) As long as the name of the device as seen from the ifconfig command or host= facing name is dtapX then I am ok. We need to clean this up somehow as it = is very confusing. >=20 >>=20 >> Signed-off-by: Pascal Mazon >> --- >> drivers/net/tap/rte_eth_tap.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >>=20 >> 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 =3D NULL; >> dev->rx_pkt_burst =3D pmd_rx_burst; >> dev->tx_pkt_burst =3D pmd_tx_burst; >> - snprintf(dev->data->name, sizeof(dev->data->name), "%s", name); >> + snprintf(dev->data->name, sizeof(dev->data->name), "%s", tap_name); >>=20 >> /* Presetup the fds to -1 as being not valid */ >> for (i =3D 0; i < RTE_PMD_TAP_MAX_QUEUES; i++) { >>=20 >=20 Regards, Keith