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 88A9A41E09; Thu, 9 Mar 2023 14:12:23 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 753D740ED7; Thu, 9 Mar 2023 14:12:23 +0100 (CET) Received: from mail-wr1-f51.google.com (mail-wr1-f51.google.com [209.85.221.51]) by mails.dpdk.org (Postfix) with ESMTP id BF62C400D7 for ; Thu, 9 Mar 2023 14:12:21 +0100 (CET) Received: by mail-wr1-f51.google.com with SMTP id l1so1789382wry.12 for ; Thu, 09 Mar 2023 05:12:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind.com; s=google; t=1678367541; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=68VNBa+SCsNZVQeSqlXZeDkzkVgEuaVW6zrdHDWtkag=; b=hFZEN80oHoND4X8exESrlwZDNWufzf534ooxET5EiCb0ONMZKO4DfuBkZYTU0T8xZi lyWKz9uSZ8ggde4vraKhblk0Gfha6by2WD/enuv88WMnS0gKzln4ryLUkKVMhqsplrGO J5idZCCji0kdykejhQygv3cdTylHRDlwXVett0Scqef4YSVZVHt11t2e9kxLHvwzHzax BUb48VQdMU45wrCedboQC0rzPyejRSc5NF0zminlR9oMMsppA+QdGhZzj/P6gcbHnXyJ r9T/ZsavEIRoo0BSqC8IZBIimVMVO7weRW9FR24B9rTwQ9Snr22FDXogzaDIYZ7hCxyt bt/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678367541; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=68VNBa+SCsNZVQeSqlXZeDkzkVgEuaVW6zrdHDWtkag=; b=xTLn4cC0K26bjohI+M8yN9rZL9yQdWy6dk+N1xcj4+wyvb8F2udzpq2elFEq4bUyJw YzSpDqKtAlxaaMTF32Q7e8iXXg/i1zyYZsL4bmaXAKksj03OxPCMkD92H6nazhcw7wLz HHZlQHJgQIrawOwYn6Toptq98CoG+GiAVgLTLBhRxKNHX3tAC0vlkyrYpaotspJNU9QT yzl6Yo87A407E0KqPMu4ooEg/aQlCUh+4gVJ9YzBL55BTTSL1QBHeMpO6qmmDczuzyDA aPaWYLbDbel+dSRfEx8X/j8gQUEtCSE8KWBJtpDB+k9cAJV7dFLbyQCnG9jacwvMetZO T1Pw== X-Gm-Message-State: AO0yUKVO/P4bsg08yyUPG52kqInqmN10f1WRgqkZJHv9L5e7vIPk8QFV 77CpWXHLNA71DBPA2iznEqkqMw== X-Google-Smtp-Source: AK7set+MUT3Bi4sPc6nNub7OnVbjXk7QpXStfRuhPz/i9AvT+P+gOXouYJC8axlGcafsO8t7xHJvhQ== X-Received: by 2002:a05:6000:11c8:b0:2cb:a82c:2523 with SMTP id i8-20020a05600011c800b002cba82c2523mr17670392wrx.35.1678367541455; Thu, 09 Mar 2023 05:12:21 -0800 (PST) Received: from 6wind.com ([2a01:e0a:5ac:6460:c065:401d:87eb:9b25]) by smtp.gmail.com with ESMTPSA id g18-20020a5d4892000000b002c70e60abd4sm17518299wrq.2.2023.03.09.05.12.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Mar 2023 05:12:21 -0800 (PST) Date: Thu, 9 Mar 2023 14:12:20 +0100 From: Olivier Matz To: Chengwen Feng Cc: thomas@monjalon.net, ferruh.yigit@amd.com, dev@dpdk.org Subject: Re: [PATCH 1/9] kvargs: detailed definition of callback prototype Message-ID: References: <20230302075012.32423-1-fengchengwen@huawei.com> <20230302075012.32423-2-fengchengwen@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230302075012.32423-2-fengchengwen@huawei.com> 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 Chengwen, The patch looks good to me. Please find below few minor style comments. On Thu, Mar 02, 2023 at 07:50:04AM +0000, Chengwen Feng wrote: > [PATCH 1/9] kvargs: detailed definition of callback prototype kvargs: add API documentation for process callback > > The rte_kvargs_process() was used to parse KV pairs, it also supports was -> is > to parse 'only keys' (e.g. socket_id) type. And the callback function > (which prototype is arg_handler_t) parameter 'value' is NULL when > parsed 'only keys'. parsed -> parsing > > But where there is no detailed definition of 'value' maybe NULL, so -where maybe -> may be > this patch adds it. > > Cc: stable@dpdk.org > > Signed-off-by: Chengwen Feng With this: Acked-by: Olivier Matz Thanks! > --- > lib/kvargs/rte_kvargs.h | 14 +++++++++++++- > 1 file changed, 13 insertions(+), 1 deletion(-) > > diff --git a/lib/kvargs/rte_kvargs.h b/lib/kvargs/rte_kvargs.h > index 359a9f5b09..4900b750bc 100644 > --- a/lib/kvargs/rte_kvargs.h > +++ b/lib/kvargs/rte_kvargs.h > @@ -36,7 +36,19 @@ extern "C" { > /** separator character used between key and value */ > #define RTE_KVARGS_KV_DELIM "=" > > -/** Type of callback function used by rte_kvargs_process() */ > +/** > + * Callback prototype used by rte_kvargs_process(). > + * > + * @param key > + * The key to consider, it will not be NULL. > + * @param value > + * The value corresponding to the key, it may be NULL (e.g. only with key) > + * @param opaque > + * An opaque pointer coming from the caller. > + * @return > + * - >=0 handle key success. > + * - <0 on error. > + */ > typedef int (*arg_handler_t)(const char *key, const char *value, void *opaque); > > /** A key/value association */ > -- > 2.17.1 >