From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Wang, Xiao W" Subject: Re: [PATCH 2/3] bus/pci: expose sysfs parsing API Date: Thu, 15 Mar 2018 16:49:41 +0000 Message-ID: References: <20180309230809.63361-1-xiao.w.wang@intel.com> <20180309230809.63361-3-xiao.w.wang@intel.com> <20180314133035.tmqgh2ghdyv3b47e@bidouze.vm.6wind.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Cc: "dev@dpdk.org" , "Wang, Zhihong" , "maxime.coquelin@redhat.com" , "yliu@fridaylinux.org" , "Liang, Cunming" , "Xu, Rosen" , "Chen, Junjie J" , "Daly, Dan" To: =?iso-8859-1?Q?Ga=EBtan_Rivet?= , "Burakov, Anatoly" Return-path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id F1FC44D3A for ; Thu, 15 Mar 2018 18:05:45 +0100 (CET) In-Reply-To: <20180314133035.tmqgh2ghdyv3b47e@bidouze.vm.6wind.com> Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi Rivet, > -----Original Message----- > From: Ga=EBtan Rivet [mailto:gaetan.rivet@6wind.com] > Sent: Wednesday, March 14, 2018 9:31 PM > To: Burakov, Anatoly > Cc: Wang, Xiao W ; dev@dpdk.org; Wang, Zhihong > ; maxime.coquelin@redhat.com; > yliu@fridaylinux.org; Liang, Cunming ; Xu, Rosen > ; Chen, Junjie J ; Daly, Dan > > Subject: Re: [dpdk-dev] [PATCH 2/3] bus/pci: expose sysfs parsing API >=20 > Hi, >=20 > On Wed, Mar 14, 2018 at 11:19:31AM +0000, Burakov, Anatoly wrote: > > On 09-Mar-18 11:08 PM, Xiao Wang wrote: > > > Some existing sysfs parsing functions are helpful for the later vDPA > > > driver, this patch make them global and expose them to shared lib. > > > > > > Signed-off-by: Xiao Wang > > > --- > > > drivers/bus/pci/linux/pci.c | 9 ++++----- > > > drivers/bus/pci/linux/pci_init.h | 8 ++++++++ > > > drivers/bus/pci/rte_bus_pci_version.map | 8 ++++++++ > > > 3 files changed, 20 insertions(+), 5 deletions(-) > > > > > > diff --git a/drivers/bus/pci/linux/pci.c b/drivers/bus/pci/linux/pci.= c > > > index abde64119..81e5e5650 100644 > > > --- a/drivers/bus/pci/linux/pci.c > > > +++ b/drivers/bus/pci/linux/pci.c > > > @@ -32,7 +32,7 @@ > > > extern struct rte_pci_bus rte_pci_bus; > > > -static int > > > +int > > > pci_get_kernel_driver_by_path(const char *filename, char *dri_name) > > > > Here and in other places - shouldn't this too be prefixed with rte_? > > >=20 > A public PCI function should be prefixed by rte_pci_ yes. OK, will add this prefix. >=20 > Additionally, if this function was to be exposed, then there should be a > BSD implementation as well (shared map file). >=20 > I don't know how BSD works, I'm not sure parsing the filesystem is the > way to get a PCI driver name. If so, maybe the function should be called > another, generic, way, that would work for both linux and BSD (and > ideally, having a real BSD implementation). BSD is not parsing the filesystem, it uses PCIOCGETCONF ioctl to retrieve PCI device information. This function is quite linux, especially for the API name. I'm afraid we ca= n only return err on BSD for this API. BRs, Xiao >=20 > > > > -- > > Thanks, > > Anatoly >=20 > -- > Ga=EBtan Rivet > 6WIND