[dpdk-dev] [PATCH v1 02/11] drivers/bus/ifpga: add function for AFU search by name

Xu, Rosen rosen.xu at intel.com
Mon Mar 11 14:10:30 CET 2019


Hi,

> -----Original Message-----
> From: Yigit, Ferruh
> Sent: Wednesday, March 06, 2019 20:45
> To: Xu, Rosen <rosen.xu at intel.com>; dev at dpdk.org
> Cc: Zhang, Tianfei <tianfei.zhang at intel.com>; Wei, Dan
> <dan.wei at intel.com>; Pei, Andy <andy.pei at intel.com>; Yang, Qiming
> <qiming.yang at intel.com>; Wang, Haiyue <haiyue.wang at intel.com>; Chen,
> Santos <santos.chen at intel.com>; Zhang, Zhang <zhang.zhang at intel.com>
> Subject: Re: [PATCH v1 02/11] drivers/bus/ifpga: add function for AFU search
> by name
> 
> On 2/28/2019 7:13 AM, Rosen Xu wrote:
> > In many scenarios, AFU is needed searched by name, this function add
> > the feature.
> >
> > Signed-off-by: Rosen Xu <rosen.xu at intel.com>
> > Signed-off-by: Andy Pei <andy.pei at intel.com>
> > ---
> >  drivers/bus/ifpga/ifpga_bus.c     | 13 +++++++++++++
> >  drivers/bus/ifpga/rte_bus_ifpga.h |  3 +++
> >  2 files changed, 16 insertions(+)
> >
> > diff --git a/drivers/bus/ifpga/ifpga_bus.c
> > b/drivers/bus/ifpga/ifpga_bus.c index 55d3abf..dfd6b1f 100644
> > --- a/drivers/bus/ifpga/ifpga_bus.c
> > +++ b/drivers/bus/ifpga/ifpga_bus.c
> > @@ -73,6 +73,19 @@ void rte_ifpga_driver_unregister(struct
> rte_afu_driver *driver)
> >  	return NULL;
> >  }
> >
> > +struct rte_afu_device *
> > +rte_ifpga_find_afu_by_name(const char *name) {
> > +	struct rte_afu_device *afu_dev = NULL;
> > +
> > +	TAILQ_FOREACH(afu_dev, &ifpga_afu_dev_list, next) {
> > +		if (afu_dev &&
> > +			!strcmp(afu_dev->device.name, name))
> > +			return afu_dev;
> > +	}
> > +	return NULL;
> > +}
> 
> I can see this function called from drivers in following patches, did you test
> this via shared library build? To be able to called from different library,
> should this API needs to be added into .map file?

Fix in patch v2.

> > +
> >  static const char * const valid_args[] = {
> >  #define IFPGA_ARG_NAME         "ifpga"
> >  	IFPGA_ARG_NAME,
> > diff --git a/drivers/bus/ifpga/rte_bus_ifpga.h
> > b/drivers/bus/ifpga/rte_bus_ifpga.h
> > index 820eeaa..5762a33 100644
> > --- a/drivers/bus/ifpga/rte_bus_ifpga.h
> > +++ b/drivers/bus/ifpga/rte_bus_ifpga.h
> > @@ -119,6 +119,9 @@ struct rte_afu_driver {
> >  	return NULL;
> >  }
> >
> > +struct rte_afu_device *
> > +rte_ifpga_find_afu_by_name(const char *name);
> 
> This is public header, can you please add function comments in doxygen
> format?

Okay.


More information about the dev mailing list