[PATCH v2 00/61] kvargs: add numeric conversion helpers

Stephen Hemminger stephen at networkplumber.org
Wed Sep 30 17:21:46 CEST 2026


On Wed, 30 Sep 2026 09:14:22 +0800
fengchengwen <fengchengwen at huawei.com> wrote:

> > 
> > Library (patches 1 to 3)
> > ------------------------
> > 
> >   rte_kvargs_to_uint/to_int/to_hex     convert with an explicit range
> > 
> >   rte_kvargs_handle_u8/u16/u32/u64     store into a typed variable
> >   rte_kvargs_handle_i8/i16/i32/i64
> >   rte_kvargs_handle_uint/int/long/ulong/size
> > 
> >   rte_kvargs_handle_bool               1/y/yes/on/true and negatives,
> >                                        bare key means true
> >   rte_kvargs_handle_socket_id          -1 (SOCKET_ID_ANY) through
> >                                        RTE_MAX_NUMA_NODES - 1
> >   rte_kvargs_handle_hex32/hex64        bare hex mask, 0x optional  
> 
> The argparse also provide such convert functions
> int rte_argparse_parse_type(const char *str, enum rte_argparse_value_type val_type, void *val);
> 
> Can these be merged into one?


No because argparse takes different function signature than kvargs. The point of these
helpers was to be drop in replacement in drivers. The two overlap, but kvargs covers
a few more cases.



More information about the dev mailing list