Hi Stephen, On 2023/11/7 0:19, Stephen Hemminger wrote: > On Mon, 6 Nov 2023 15:13:35 +0800 > fengchengwen <fengcheng...@huawei.com> wrote: > >>>> + >>> >>> Looks good but may I suggest some alternatives. >>> >>> Since this is an API and ABI change as was not announced, maybe a little >>> late >>> in the process for this release. And since unlikely to go in 23.11 need to >>> do something >>> better in 24.03. >>> >>> What about changing the args to rte_kvargs_process() to add an additional >>> default >>> value. Most callers don't have a default (use key-value) but the ones that >>> take only-key >>> would pass the default value. >> >> The API definition changed, it may need modify most drivers. >> >> Although it's a little late, better continue current. >> >> Thanks >> Chengwen > > Looking ahead, I would like to replace all of EAL args and KVargs processing > with something more like the python parseargs library. The API is cleaner and > incorporating the help with arg parsing is a real benefit. Thomas also > suggested > integrating help in the arg parsing. > > Something like: https://github.com/cofyc/argparse
The argparse is great, especial it integrate help in the arg parsing, which could help for parse args. I will propose a argparse library RFC later, and we could both work on it. As for this commit, I think it has difference: the KV pair was not separated by spaces, So for: dpdk-testpmd -a 0000:7d:00.0,a=1,b=2,c=3 --file-prefix=feng We could parse 'a' has value: 0000:7d:00.0,a=1,b=2,c=3 'file-prefix' has value: feng by argparse. and then use kvargs to parse a=1,b=2,c=3. Thanks Chengwen > > . >