From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id AF0C42BD3 for ; Mon, 19 Mar 2018 02:31:29 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 18 Mar 2018 18:31:27 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,328,1517904000"; d="scan'208";a="34889433" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by FMSMGA003.fm.intel.com with ESMTP; 18 Mar 2018 18:31:27 -0700 Received: from fmsmsx152.amr.corp.intel.com (10.18.125.5) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.319.2; Sun, 18 Mar 2018 18:31:27 -0700 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by FMSMSX152.amr.corp.intel.com (10.18.125.5) with Microsoft SMTP Server (TLS) id 14.3.319.2; Sun, 18 Mar 2018 18:31:27 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.166]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.226]) with mapi id 14.03.0319.002; Mon, 19 Mar 2018 09:31:24 +0800 From: "Wang, Xiao W" To: =?iso-8859-1?Q?Ga=EBtan_Rivet?= CC: "Burakov, Anatoly" , "dev@dpdk.org" , "Wang, Zhihong" , "maxime.coquelin@redhat.com" , "yliu@fridaylinux.org" , "Liang, Cunming" , "Xu, Rosen" , "Chen, Junjie J" , "Daly, Dan" Thread-Topic: [dpdk-dev] [PATCH 2/3] bus/pci: expose sysfs parsing API Thread-Index: AQHTt7OzLfB2XQzF1kaMiGjT+WmvO6PPFyGAgAAkn4CAAksuEP//hxGAgAXCnLA= Date: Mon, 19 Mar 2018 01:31:23 +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> <20180315171921.zbdymoqrbfs6u6su@bidouze.vm.6wind.com> In-Reply-To: <20180315171921.zbdymoqrbfs6u6su@bidouze.vm.6wind.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZWM0MjYwYTItZDZmZi00NDQxLWExOGMtOTk2Mjc4OGFkMGY0IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjIuNS4xOCIsIlRydXN0ZWRMYWJlbEhhc2giOiJMd2RjdzVsY094V0xpcnhUMkllVzZ3MlMyUjk5K1Y0b1hMM3gwR2VoK0hsV3pka2RCWVd4MkdcL3U1K29cL1hcL1J5In0= dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH 2/3] bus/pci: expose sysfs parsing API 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, 19 Mar 2018 01:31:30 -0000 Hi Rivet, > -----Original Message----- > From: Ga=EBtan Rivet [mailto:gaetan.rivet@6wind.com] > Sent: Friday, March 16, 2018 1:19 AM > To: Wang, Xiao W > Cc: Burakov, Anatoly ; 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 > On Thu, Mar 15, 2018 at 04:49:41PM +0000, Wang, Xiao W wrote: > > 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 > > > > > > Hi, > > > > > > 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 v= DPA > > > > > 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_n= ame) > > > > > > > > Here and in other places - shouldn't this too be prefixed with rte_= ? > > > > > > > > > > A public PCI function should be prefixed by rte_pci_ yes. > > > > OK, will add this prefix. > > > > > > > > Additionally, if this function was to be exposed, then there should b= e a > > > BSD implementation as well (shared map file). > > > > > > I don't know how BSD works, I'm not sure parsing the filesystem is th= e > > > way to get a PCI driver name. If so, maybe the function should be cal= led > > > 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 retrie= ve > > PCI device information. > > This function is quite linux, especially for the API name. I'm afraid w= e can > > only return err on BSD for this API. >=20 > How about renaming the function to something like > rte_pci_device_kdriver_name(); >=20 > and allowing for a sensible BSD implementation to happen if someone > needs it? Yes, it looks more generic, and allows a BSD implementation to happen. I will rename it as below in next version. rte_pci_device_kdriver_name(const struct rte_pci_addr *addr, char *dri_name= ) BRs, Xiao >=20 > -- > Ga=EBtan Rivet > 6WIND