From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id AC9F12C18 for ; Fri, 5 May 2017 11:44:15 +0200 (CEST) Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 May 2017 02:44:14 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.38,291,1491289200"; d="scan'208";a="83951301" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.237.220.81]) ([10.237.220.81]) by orsmga004.jf.intel.com with ESMTP; 05 May 2017 02:44:11 -0700 To: "Lu, Wenzhuo" , Thomas Monjalon , Shepard Siegel , Ed Czeck , John Miller , "Legacy, Allain (Wind River)" , "Peters, Matt (Wind River)" , "Zhang, Helin" , "Wu, Jingjing" , "Ananyev, Konstantin" , Andrew Rybchenko Cc: "dev@dpdk.org" References: <20170504130826.60701-1-ferruh.yigit@intel.com> <6A0DE07E22DDAD4C9103DF62FEBC09093B5A0963@shsmsx102.ccr.corp.intel.com> From: Ferruh Yigit Message-ID: <97a3ba01-ef2e-98ad-bf7b-d2e753573396@intel.com> Date: Fri, 5 May 2017 10:44:11 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.1.0 MIME-Version: 1.0 In-Reply-To: <6A0DE07E22DDAD4C9103DF62FEBC09093B5A0963@shsmsx102.ccr.corp.intel.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-dev] [PATCH] drivers/net: add generic ethdev macro to get PCI device 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: Fri, 05 May 2017 09:44:16 -0000 On 5/5/2017 1:44 AM, Lu, Wenzhuo wrote: > Hi, > >> -----Original Message----- >> From: Yigit, Ferruh >> Sent: Thursday, May 4, 2017 9:08 PM >> To: Thomas Monjalon; Shepard Siegel; Ed Czeck; John Miller; Legacy, Allain >> (Wind River); Peters, Matt (Wind River); Lu, Wenzhuo; Zhang, Helin; Wu, >> Jingjing; Ananyev, Konstantin; Andrew Rybchenko >> Cc: dev@dpdk.org; Yigit, Ferruh >> Subject: [PATCH] drivers/net: add generic ethdev macro to get PCI device >> >> Instead of many PMD define their own macro, define a generic one in ethdev >> and use that in PMDs. >> >> Signed-off-by: Ferruh Yigit > Acked-by: Wenzhuo Lu > > BTW, there're RTE_DEV_TO_PCI(dev->device) in many places, maybe we can replace them by the new macro RTE_ETH_DEV_TO_PCI. Net drivers use it always as RTE_DEV_TO_PCI(dev->device), since they all have eth_dev references, not rte_device. So there are two options, either convert all usages to RTE_DEV_TO_PCI(eth_dev->device) or RTE_ETH_DEV_TO_PCI(eth_dev) I think RTE_ETH_DEV_TO_PCI(eth_dev) is better since it hides eth_dev->device detail, which is not required in this context. And it reflects the intention better, get pci from eth device. I will update the patch to convert those usages too. Thanks, ferruh