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 CD105432B4; Mon, 6 Nov 2023 04:18:08 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6B24A402B5; Mon, 6 Nov 2023 04:18:08 +0100 (CET) Received: from mail-pf1-f180.google.com (mail-pf1-f180.google.com [209.85.210.180]) by mails.dpdk.org (Postfix) with ESMTP id 581DF4027F for ; Mon, 6 Nov 2023 04:18:07 +0100 (CET) Received: by mail-pf1-f180.google.com with SMTP id d2e1a72fcca58-6b3c2607d9bso3219385b3a.1 for ; Sun, 05 Nov 2023 19:18:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1699240686; x=1699845486; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=RkHNE8K4V1nGuAP0E59xoUl9Uxx/O18nhfg+JkP+uug=; b=nW8dbedldss50TFn0IyZeZ+kKfrvPTRDIOzEDol9GPgmHgRFUlEFmJ0qoRl9B2DW+u pCUIta72IF8678ZHGc7r6bQs1lYm52Qf2SrnJEIfckhPXcxO/E5zV7psXwQSV0dVOjQN ROz2JY2TEdf9JP64P44DElqGfX4rXiCjhAvjL8+8U5jBZw+snnLJE+rOSBu83RLDGCkD VMypolXWgvv84x0DQFbKrS+iivxNOP8yc0SvwcCKaVNmTkYreiP9okUj48w01oCqyGaF ipsYN/Ad0+MV/bcPC4FaTodY64FKUZofmkmjWTcyBvuAXzb+7blm00AVvt55mlvXb+Ua 3cGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699240686; x=1699845486; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=RkHNE8K4V1nGuAP0E59xoUl9Uxx/O18nhfg+JkP+uug=; b=A5J08XLZSJAYrozJ01+Kt4KBnm4z5+7KQ96+dYYqPujCexj5nQNk8cfmu0U8vtRN1X O8xDhg3bO2kiUXAUSZp4OKG+Tn+GtZw/U8TZsN6hVlz+7CJDBGLXzTZxLi1wSEIFzoKR N3zB23P0WD4sjJ5YaHs22x4XylxxuXYZ4m1o80WkB6shXK9oOZR7uQfzj9tcVwUXrTQN w9NCN5sexLNBn77MRRtROLCv0Krdgg+evlSEc24vdX8BNHnszFoOgx2MS8BbbVZsNGAx RzTs/4Dk3Rk5ygEIyh39qfvx11RS1GHuNKxNq4PdbB+9Wiu04dp18S7Q/u+vj6TqxDxf FD/Q== X-Gm-Message-State: AOJu0YyZMn6xjdXklysFfczWLnv4qwLsEHhcEFKz4/m+QRlnfJv2SgOB 4KyJ/2rDdkmWPYaWJoLjNa0ZPw== X-Google-Smtp-Source: AGHT+IEOWWDEiPgOp8TlhfSJVO2orSeMwJtGVp29Tm4s8WEBrTVuDwfzdQ0yWTkXh8qn6fl3Gg4xQw== X-Received: by 2002:a05:6a00:18a6:b0:68b:bf33:2957 with SMTP id x38-20020a056a0018a600b0068bbf332957mr25652964pfh.22.1699240686259; Sun, 05 Nov 2023 19:18:06 -0800 (PST) Received: from hermes.local (204-195-123-141.wavecable.com. [204.195.123.141]) by smtp.gmail.com with ESMTPSA id k8-20020a633d08000000b005b92d3cb4c2sm4608949pga.58.2023.11.05.19.18.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Nov 2023 19:18:06 -0800 (PST) Date: Sun, 5 Nov 2023 19:18:04 -0800 From: Stephen Hemminger To: Chengwen Feng Cc: , , Subject: Re: [PATCH v4 1/5] kvargs: add one new process API Message-ID: <20231105191804.7fc675de@hermes.local> In-Reply-To: <20231105054539.22303-2-fengchengwen@huawei.com> References: <20230314124813.39521-1-fengchengwen@huawei.com> <20231105054539.22303-1-fengchengwen@huawei.com> <20231105054539.22303-2-fengchengwen@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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 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. 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.