From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id D2B95914 for ; Mon, 6 Mar 2017 16:16:33 +0100 (CET) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Mar 2017 07:16:32 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.35,254,1484035200"; d="scan'208";a="1138557873" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by fmsmga002.fm.intel.com with ESMTP; 06 Mar 2017 07:16:32 -0800 Received: from fmsmsx113.amr.corp.intel.com ([169.254.13.172]) by FMSMSX106.amr.corp.intel.com ([169.254.5.63]) with mapi id 14.03.0248.002; Mon, 6 Mar 2017 07:16:32 -0800 From: "Wiles, Keith" To: Pascal Mazon CC: "Yigit, Ferruh" , "dev@dpdk.org" Thread-Topic: [PATCH v3] net/tap: fix dev name look-up Thread-Index: AQHSlow/2MrF7YkjJ0+4H704zBUZlKGIckiA Date: Mon, 6 Mar 2017 15:16:32 +0000 Message-ID: <3C5605DE-671B-4159-B344-788BB4E46C70@intel.com> References: <64e79c8c7398e0af093168d614c0ca62dc28377e.1488808159.git.pascal.mazon@6wind.com> In-Reply-To: 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: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v3] 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 15:16:34 -0000 > On Mar 6, 2017, at 9:13 AM, Pascal Mazon wrote: >=20 > Store the device name in dev->data->name, to have symmetrical behavior > between rte_pmd_tap_probe(name) and rte_pmd_tap_remove(name). >=20 > The netdevice name (linux interface name) is stored in the name field of > struct pmd_internals. >=20 > snprintf(data->name) has been moved closer to the rte_ethdev_allocate() > as it should use the same name. >=20 > Signed-off-by: Pascal Mazon > --- > drivers/net/tap/rte_eth_tap.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) >=20 > diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.= c > index 47a706070652..ece3a5fcc897 100644 > --- a/drivers/net/tap/rte_eth_tap.c > +++ b/drivers/net/tap/rte_eth_tap.c > @@ -663,7 +663,9 @@ eth_dev_tap_create(const char *name, char *tap_name) > goto error_exit; > } >=20 > - dev =3D rte_eth_dev_allocate(tap_name); > + /* name in allocation and data->name must be consistent */ > + snprintf(data->name, sizeof(data->name), "%s", name); > + dev =3D rte_eth_dev_allocate(name); > if (!dev) { > RTE_LOG(ERR, PMD, "TAP Unable to allocate device struct\n"); > goto error_exit; > @@ -691,7 +693,6 @@ 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); >=20 > /* Presetup the fds to -1 as being not valid */ > for (i =3D 0; i < RTE_PMD_TAP_MAX_QUEUES; i++) { > --=20 > 2.8.0.rc0 Looks good to me, but Ferruh seems to be the expect here :-) >=20 Regards, Keith