Hi Thomas, > -----Original Message----- > From: Thomas Monjalon [mailto:tho...@monjalon.net] > Sent: Thursday, March 22, 2018 4:45 AM > To: Wang, Xiao W <xiao.w.w...@intel.com> > Cc: dev@dpdk.org; maxime.coque...@redhat.com; y...@fridaylinux.org; Wang, > Zhihong <zhihong.w...@intel.com>; Bie, Tiwei <tiwei....@intel.com>; Chen, > Junjie J <junjie.j.c...@intel.com>; Xu, Rosen <rosen...@intel.com>; Daly, > Dan <dan.d...@intel.com>; Liang, Cunming <cunming.li...@intel.com>; > Burakov, Anatoly <anatoly.bura...@intel.com>; gaetan.ri...@6wind.com > Subject: Re: [dpdk-dev] [PATCH v2 2/3] bus/pci: expose sysfs parsing API > > 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 <xiao.w.w...@intel.com> > > --- > > /* parse driver */ > > snprintf(filename, sizeof(filename), "%s/driver", dirname); > > - ret = pci_get_kernel_driver_by_path(filename, driver); > > + ret = rte_pci_device_kdriver_name(addr, driver); > > I guess the snprintf above becomes useless.
Will remove it. > > > + * @param dri_name > > + * Output buffer pointer. > > 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. > > > +/** > > + * @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_device > *dev); > > 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