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 30FD8432B7; Mon, 6 Nov 2023 08:14:19 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B6DA0402A9; Mon, 6 Nov 2023 08:14: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 B14D94027F for ; Mon, 6 Nov 2023 08:14:15 +0100 (CET) Received: from dggpeml100024.china.huawei.com (unknown [172.30.72.53]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4SP2Y66PPtzPnyq; Mon, 6 Nov 2023 15:10: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; Mon, 6 Nov 2023 15:13:35 +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> From: fengchengwen Message-ID: Date: Mon, 6 Nov 2023 15:13:35 +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: <20231105191804.7fc675de@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: dggems706-chm.china.huawei.com (10.3.19.183) 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/6 11:18, Stephen Hemminger wrote: > On Sun, 5 Nov 2023 05:45:35 +0000 > Chengwen Feng wrote: > >> +* **Updated kvargs process API.** >> + >> + * Introduced rte_kvargs_process_opt() API, which inherits the function >> + of rte_kvargs_process() and could handle both key=value and only-key >> + cases. >> + >> + * Constraint rte_kvargs_process() API can only handle key=value cases, >> + it will return -1 when handle only-key case (that is the matched key's >> + value is NULL). >> + > > 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 > > Then use ABI versioning to add the new arg and you would not have to introduce > a new function. And add a legacy API version that does what current code does. > > All the drivers in DPDK would get the new API/ABI but any customer apps using rte_kvargs_process() > would get the old version. > > > . >