From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id DE78E432C0; Tue, 7 Nov 2023 04:22:18 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AF18A402B5; Tue, 7 Nov 2023 04:22:18 +0100 (CET) Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by mails.dpdk.org (Postfix) with ESMTP id 74132402A1 for ; Tue, 7 Nov 2023 04:22:17 +0100 (CET) Received: from dggpeml100024.china.huawei.com (unknown [172.30.72.54]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4SPYRZ5XfxzVlpd; Tue, 7 Nov 2023 11:22:02 +0800 (CST) Received: from [10.67.121.161] (10.67.121.161) by dggpeml100024.china.huawei.com (7.185.36.115) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.31; Tue, 7 Nov 2023 11:21:29 +0800 Subject: Re: [PATCH v4 1/5] kvargs: add one new process API To: Stephen Hemminger CC: , , References: <20230314124813.39521-1-fengchengwen@huawei.com> <20231105054539.22303-1-fengchengwen@huawei.com> <20231105054539.22303-2-fengchengwen@huawei.com> <20231105191804.7fc675de@hermes.local> <20231106081930.48004190@hermes.local> From: fengchengwen Message-ID: <2030efec-7f0a-5fa1-637e-a05a37cd7092@huawei.com> Date: Tue, 7 Nov 2023 11:21:29 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: <20231106081930.48004190@hermes.local> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.67.121.161] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To dggpeml100024.china.huawei.com (7.185.36.115) X-CFilter-Loop: Reflected X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Hi Stephen, On 2023/11/7 0:19, Stephen Hemminger wrote: > On Mon, 6 Nov 2023 15:13:35 +0800 > fengchengwen 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 > > . >