[PATCH 03/12] net/pcap: use bool for flags
Stephen Hemminger
stephen at networkplumber.org
Fri Jan 9 01:23:27 CET 2026
On Wed, 7 Jan 2026 10:28:32 +0000
Marat Khalili <marat.khalili at huawei.com> wrote:
> > @@ -1180,31 +1181,29 @@ open_tx_iface(const char *key, const char *value, void *extra_args)
> > }
> >
> > static int
> > -select_phy_mac(const char *key __rte_unused, const char *value,
> > - void *extra_args)
> > +process_bool_flag(const char *key, const char *value, void *extra_args)
>
> This function probably belongs in some common library. There is a similar code
> in lib/argparse/rte_argparse.c and lib/cmdline/cmdline_parse_bool.c that might
> benefit. Having some tests could also be useful.
>
> I would also think of naming more, word "process" does not really convey much
> meaning. How about "parse_bool"?
I just went off and tried that and it ends up not being that good.
The problem is that the place for common code in DPDK is currently EAL.
But if you put bool parsing in EAL it creates a circular dependency
since EAL depends on argparse and kvargs. So can't use any new string
parsing there. Cmdline does its own validation so common code won't help
there either.
Good idea, just won't work.
Going back to just 0/1 for now.
More information about the dev
mailing list