[dpdk-dev] [PATCH v4 2/6] ethdev: add iterator to match devargs input

Thomas Monjalon thomas at monjalon.net
Tue Oct 16 14:06:59 CEST 2018


16/10/2018 12:58, Ferruh Yigit:
> On 10/9/2018 11:33 PM, Thomas Monjalon wrote:
> > The iterator will return the ethdev port ids matching a devargs string.
> > It is recommended to use the macro RTE_ETH_FOREACH_MATCHING_DEV()
> > for usage convenience.
> > 
> > The class string is prefixed with '+' in order to skip the validation
> > of the parameter keys. It is tolerated for the compatibility with
> > the old (current) syntax where all parameters (bus, class and driver)
> > are mixed in the same string without any delimiter.
> > Thanks to this compatibility prefix, the driver parameters will be
> > skipped during the ethdev parsing, and not considered invalid.
> > 
> > A macro is introduced in rte_common.h to workaround a const field.
> > This hack is needed to free const strings in the iterator.
> > It is preferred to keep the const for these fields, because it gives
> > a hint that they are not changed at each iteration.
> > 
> > Signed-off-by: Thomas Monjalon <thomas at monjalon.net>
> > Reviewed-by: Andrew Rybchenko <arybchenko at solarflare.com>
> 
> <...>
> > +	rte_eth_iterator_cleanup;
> > +	rte_eth_iterator_init;
> > +	rte_eth_iterator_next;
> 
> It would be great to add some unit test for these APIs, it would both show how
> they are used and verify this functionality with all that "+" trick etc..
> 
> Similar to previous patch, vdev iterator.
> 
> Is it too late to add some unit test for these functionality?

We do not have similar ethdev unit test yet.
So for -rc1, yes it is too late to introduce a new class of unit test.
I will try to work on it for -rc2.




More information about the dev mailing list