[dpdk-dev] [PATCH v2 2/3] bus/pci: expose sysfs parsing API

Wang, Xiao W xiao.w.wang at intel.com
Thu Mar 22 03:46:15 CET 2018


Hi Thomas,

> -----Original Message-----
> From: Thomas Monjalon [mailto:thomas at monjalon.net]
> Sent: Thursday, March 22, 2018 4:45 AM
> To: Wang, Xiao W <xiao.w.wang at intel.com>
> Cc: dev at dpdk.org; maxime.coquelin at redhat.com; yliu at fridaylinux.org; Wang,
> Zhihong <zhihong.wang at intel.com>; Bie, Tiwei <tiwei.bie at intel.com>; Chen,
> Junjie J <junjie.j.chen at intel.com>; Xu, Rosen <rosen.xu at intel.com>; Daly,
> Dan <dan.daly at intel.com>; Liang, Cunming <cunming.liang at intel.com>;
> Burakov, Anatoly <anatoly.burakov at intel.com>; gaetan.rivet at 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.wang at 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


More information about the dev mailing list