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 6D5F456A1 for ; Thu, 22 Mar 2018 03:46:20 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Mar 2018 19:46:18 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,342,1517904000"; d="scan'208";a="40123247" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by fmsmga001.fm.intel.com with ESMTP; 21 Mar 2018 19:46:18 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 21 Mar 2018 19:46:18 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.166]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.108]) with mapi id 14.03.0319.002; Thu, 22 Mar 2018 10:46:16 +0800 From: "Wang, Xiao W" To: Thomas Monjalon CC: "dev@dpdk.org" , "maxime.coquelin@redhat.com" , "yliu@fridaylinux.org" , "Wang, Zhihong" , "Bie, Tiwei" , "Chen, Junjie J" , "Xu, Rosen" , "Daly, Dan" , "Liang, Cunming" , "Burakov, Anatoly" , "gaetan.rivet@6wind.com" Thread-Topic: [dpdk-dev] [PATCH v2 2/3] bus/pci: expose sysfs parsing API Thread-Index: AQHTwM+7tdZxlxn3NECLlzWy4kQG1aPaoysAgADqC6A= Date: Thu, 22 Mar 2018 02:46:15 +0000 Message-ID: References: <20180309230809.63361-3-xiao.w.wang@intel.com> <20180321132108.52464-1-xiao.w.wang@intel.com> <20180321132108.52464-3-xiao.w.wang@intel.com> <63424504.iVi4kYAKMf@xps> In-Reply-To: <63424504.iVi4kYAKMf@xps> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZWU0MDUxMzYtNzQzOC00ZDY3LWE4OWUtN2VkMjlkMTYwZjA0IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjIuNS4xOCIsIlRydXN0ZWRMYWJlbEhhc2giOiJ6XC8yNjlkQ3V3QnpkdVRJRkJxWWlRcHVJc1BQcFMrMTZTRk9YRUJTSjl1ejRqM29ORHZEQ1wvODd0RkZ3N3kxYVQifQ== 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="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v2 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: Thu, 22 Mar 2018 02:46:21 -0000 Hi Thomas, > -----Original Message----- > From: Thomas Monjalon [mailto:thomas@monjalon.net] > Sent: Thursday, March 22, 2018 4:45 AM > To: Wang, Xiao W > Cc: dev@dpdk.org; maxime.coquelin@redhat.com; yliu@fridaylinux.org; Wang, > Zhihong ; Bie, Tiwei ; Chen, > Junjie J ; Xu, Rosen ; Daly, > Dan ; Liang, Cunming ; > Burakov, Anatoly ; gaetan.rivet@6wind.com > Subject: Re: [dpdk-dev] [PATCH v2 2/3] bus/pci: expose sysfs parsing API >=20 > 21/03/2018 14:21, Xiao Wang: > > 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 > > --- > > /* parse driver */ > > snprintf(filename, sizeof(filename), "%s/driver", dirname); > > - ret =3D pci_get_kernel_driver_by_path(filename, driver); > > + ret =3D rte_pci_device_kdriver_name(addr, driver); >=20 > I guess the snprintf above becomes useless. Will remove it. >=20 > > + * @param dri_name > > + * Output buffer pointer. >=20 > Parameter name and comment can be improved here: > "kdrv_name" would be more meaningful. > As a comment, "Output buffer for kernel driver name" Thanks for the suggestion. Will improve it. >=20 > > +/** > > + * @warning > > + * @b EXPERIMENTAL: this API may change, or be removed, without prior > notice > > + * > > + * Parse the "resource" sysfs file. > > + * > > + * @param filename > > + * The PCI resource file path. > > + * @dev > > + * Pointer of rte_pci_device object, into which the parse result is = recorded. > > + * @return > > + * 0 on success, -1 on error, 1 on no driver found. > > + */ > > +int __rte_experimental > > +rte_pci_parse_sysfs_resource(const char *filename, struct rte_pci_devi= ce > *dev); >=20 > This is a Linux specific API. > Maybe remove "sysfs" and replace "filename" by "resource"? Yes, "sysfs" makes it Linux specific. Will change it. Thanks for the above comments. BRs, Xiao