[dpdk-dev] [PATCH v2 04/18] eal: add lightweight kvarg parsing utility

Neil Horman nhorman at tuxdriver.com
Thu Mar 22 15:10:37 CET 2018


On Wed, Mar 21, 2018 at 05:32:24PM +0000, Wiles, Keith wrote:
> 
> 
> > On Mar 21, 2018, at 12:15 PM, Gaetan Rivet <gaetan.rivet at 6wind.com> wrote:
> > 
> > This library offers a quick way to parse parameters passed with a
> > key=value syntax.
> > 
> > A single function is needed and finds the relevant element within the
> > text. No dynamic allocation is performed. It is possible to chain the
> > parsing of each pairs for quickly scanning a list.
> > 
> > This utility is private to the EAL and should allow avoiding having to
> > move around the more complete librte_kvargs.
> 
> What is the big advantage with this code and the librte_kvargs code. Is it just no allocation, rte_kvargs needs to be build before parts of EAL or what?
> 
> My concern is we have now two flavors one in EAL and one in librte_kvargs, would it not be more reasonable to improve rte_kvargs to remove your objections? I am all for fast, better, stronger code :-)
> 
+1, this really doesn't make much sense to me.  Two parsing routines seems like
its just asking for us to have to fix parsing bugs in two places.  If allocation
is a concern, I don't see why you can't just change the malloc in
rte_kvargs_parse to an automatic allocation on the stack, or a preallocation set
of kvargs that can be shared from init time.  librte_kvargs isn't necessecarily
the best parsing library ever, but its not bad, and it just seems wrong to go
re-inventing the wheel.

Neil

> > 
> > Signed-off-by: Gaetan Rivet <gaetan.rivet at 6wind.com>
> 
> Regards,
> Keith
> 
> 


More information about the dev mailing list