[dpdk-dev] [PATCH v4 2/9] bus: add device iterator

Gaëtan Rivet gaetan.rivet at 6wind.com
Wed Jun 21 14:15:56 CEST 2017


On Wed, Jun 21, 2017 at 01:55:39PM +0200, Thomas Monjalon wrote:
> 21/06/2017 01:29, Gaetan Rivet:
> > +/**
> > + * Device comparison function.
> > + *
> > + * @param dev
> > + *   Device handle.
> > + *
> > + * @param data
> > + *   Data to compare against.
> > + *
> > + * @return
> > + *   0 if the device matches the data.
> > + *   !0 if the device does not match.
> > + *   <0 if ordering is possible and the device is lower than the data.
> > + *   >0 if ordering is possible and the device is greater than the data.
> > + */
> > +typedef int (*rte_dev_cmp_t)(const struct rte_device *dev, const void *data);
> 
> data is really abstract.
> Maybe a comment is missing to explain that data is better specified
> in bus implementations?
> 

I'm not sure it is better specified in rte_bus though :).
However, the usage can be understood there, why it exists in the first
place.

I think bus iterators could benefit some more explanation about the why.

> Why not implement it for PCI?
> 

I sent this series with only the patches from Jan, initially in the
version he solely developed. Only afterward did I fix a few bugs,
reworked a few APIs.

As such, two other series complete this patchset:

[dpdk-dev] [PATCH v3] pci: implement find_device bus operation
http://dpdk.org/ml/archives/dev/2017-June/067485.html

And

[dpdk-dev] [PATCH v3 0/3] eal: complete attach / detach support
http://dpdk.org/ml/archives/dev/2017-June/067516.html

It might make sense to merge all three series together.
They are conceptually linked very closely. The only reason I did not do
so at first was because I was unsure about who would take responsibility
for the attach / detach patchset, and if it had not be me I did not want to
put undue responsibility of my patches on whomever would.

But that point is moot now.

-- 
Gaëtan Rivet
6WIND


More information about the dev mailing list