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 3FB62DE3 for ; Mon, 12 Jun 2017 10:57:15 +0200 (CEST) Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga104.jf.intel.com with ESMTP; 12 Jun 2017 01:57:15 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.39,333,1493708400"; d="scan'208";a="112009173" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.237.220.91]) ([10.237.220.91]) by orsmga005.jf.intel.com with ESMTP; 12 Jun 2017 01:57:12 -0700 To: Jan Blunck , Thomas Monjalon Cc: dev , "John W. Linville" , Stephen Hurd , Ajit Khaparde , Declan Doherty , Helin Zhang , Jingjing Wu , Wenzhuo Lu , Konstantin Ananyev , Pascal Mazon , Gaetan Rivet References: <20170526161141.4746-1-ferruh.yigit@intel.com> <20170526161141.4746-2-ferruh.yigit@intel.com> <1804015.XMfruEeC3U@xps> From: Ferruh Yigit Message-ID: <4b4ba4b2-3abe-0d5b-0dea-6e37ec6b5507@intel.com> Date: Mon, 12 Jun 2017 09:57:11 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-dev] [PATCH 2/2] drivers/net: use device name from device structure 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, 12 Jun 2017 08:57:16 -0000 On 6/10/2017 8:35 AM, Jan Blunck wrote: > On Fri, Jun 9, 2017 at 3:52 PM, Thomas Monjalon wrote: >> 26/05/2017 18:11, Ferruh Yigit: >>> Device name resides in two different locations, in rte_device->name and >>> in ethernet device private data. >> >> Yes would be nice to remove the name from rte_eth_dev_data. >> > > I wonder if this is really the right thing to do. The name in the > eth_dev data is the eth_dev device name and it might be different from > the low-level device name. Some busses might use UUID as the device > identifier and I don't believe that this is a user friendly name. Right now eth_dev->data->name is same with with rte_dev->device->name. And there is an assumption that they will be same [1]. But if you think they can be different in the future, I think we can: 1- Keep as it is. 2- Reduce to single variable as much as possible (this patch), when different naming implemented, update relevant parts according. Since this is internal structure, I believe won't cause an ABI issue. [1] rte_eth_dev_pci_allocate() and rte_eth_vdev_allocate() use rte_dev->device->name to call rte_eth_dev_allocate(), which inside calls rte_eth_dev_allocated() with same name. Which assumes any previously created eth_dev, created with rte_dev->device->name. > >>> For now, the copy in the ethernet device private data is required for >>> multi process support, the name is the how secondary process finds about >>> primary process device. >> >> Yes it is in rte_eth_dev_attach_secondary(). >> This secondary process forces us to write ugly data structures. >> >>> But for drivers there is no reason to use the copy in the ethernet >>> device private data. >> >> Yes I agree. > > Probably. But it also depends on at what stage the driver is using the > name and what information is printed. During probing I would expect > the low-level device name to be printed. After probing the eth_dev PMD > should use the user friendly device name. This makes sense when different naming used for core device and eth_dev, but this is not the case for now. > >> There are probably other places where we can avoid using this field. >> I see rte_eth_dev_get_name_by_port() and rte_eth_dev_get_port_by_name() >> using rte_eth_dev_data[port].name. >> >>> This patch updates PMDs to use only rte_device->name. >>> >>> Signed-off-by: Ferruh Yigit >>