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 E992CA0C44; Mon, 12 Apr 2021 14:07:16 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A2BDB14115D; Mon, 12 Apr 2021 14:07:16 +0200 (CEST) Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-eopbgr750078.outbound.protection.outlook.com [40.107.75.78]) by mails.dpdk.org (Postfix) with ESMTP id 84BC0141159 for ; Mon, 12 Apr 2021 14:07:15 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IQCXpGNLF3FJ3MDk0CnvhVH5HRPdgrt5y0188PI06IY6BvL70ZSaebnbCBlcE8wcvS3yqc+UyZxtD+YerpvJu5C9ubeI16YrENkQ3E3KXfAXl4oY3j8XxiozoCKoh2ogT/TyYBXutH0OjpRQ40klAm+8dzGzvf4KE7RBhD4Im6ejNZ3G7WLI5R+c8WcRyLs7+fXBOaizXSioaaNjhOFYPkgKxPMBOC+XrtE0abUTI3Hsq+PP1lV13KdNLJCFNHM0T7wirsxelNwzKRLbwas8/F7zsmbo4v+qiEQvY2OrXzapSzcpQ2QoWH5nK6Dk1MdOU9R+P58GHGyL0kpRLOmTYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=gaazBVsNkBVuCUyYNcGO4V2sfLJ40Pd/5eNCJHFV/Go=; b=RDgHizRic3fE7b8o+keiq/gVZgCHX708oKj2tQiLiv3txXlgGOxAJh9jYIM0jc7xym4P7ms7lipKHoWs45iuZOju7AneUgQDXlFEk3YS/AC+xC8RkT26htA1nQA4rKCxpj1eC4IqVV8Cs7jEXhJtbTacIAmVKlquRtsAFHQGf2QxU5syGzJ69A8TbLmAqNot9JiioD79VHj7OCPX3Lo8Zevn4OHcyUwjATmZIEo5dI/5pWDGZl+ZrynZqvRcnBxyB68j7jIlfU8FHZkezPXdW9mO6s5SVmREjwQwBmgszGdzEdK7s7TMayG9EKGfzxNyWlGPOV8oKv6ucSaYjNA3/Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=gaazBVsNkBVuCUyYNcGO4V2sfLJ40Pd/5eNCJHFV/Go=; b=kt2WQsMOZm6QXWGk/ezaqIPi/oQdIBimG7XOBkbCpdo291LmP9aUnOJrFxS0cKiJIT9laEcqhpq+OzODoIjZtXqcPRzRJLSpbYj3KTvZuWbhUpqLG9OXCjaRHEIHAIW5RodnkjC7Jc1cDV/NiXn5pKBvD8JCQ4QLhMEh7ztCmR5Q/ieeDp0I8lce23YCuHC0ZL+aHYZT/Py1BNvdj+RIFNWHQ7EL7MZBolLrE7qUD8tn70EBMhjoyKb1br40VVrGr2zigWSHHFBMmT9Dus3iUnLgG896TdaNl/6NdnOyBf4ffmRoKzq3UKsbLRtU/EtnxjzguRyCszTi4Sid1ivcbQ== Received: from BY5PR12MB4324.namprd12.prod.outlook.com (2603:10b6:a03:209::10) by BY5PR12MB3666.namprd12.prod.outlook.com (2603:10b6:a03:1a4::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4020.22; Mon, 12 Apr 2021 12:07:13 +0000 Received: from BY5PR12MB4324.namprd12.prod.outlook.com ([fe80::b919:53f4:6757:331c]) by BY5PR12MB4324.namprd12.prod.outlook.com ([fe80::b919:53f4:6757:331c%5]) with mapi id 15.20.4020.022; Mon, 12 Apr 2021 12:07:13 +0000 From: "Xueming(Steven) Li" To: Olivier Matz CC: NBU-Contact-Thomas Monjalon , Gaetan Rivet , "dev@dpdk.org" , Asaf Penso , Ray Kinsella , Neil Horman Thread-Topic: [PATCH v4 3/5] kvargs: add get by key function Thread-Index: AQHXLhU4QOsdCIctHEa4yGFobLjnIqqwdMGAgABXl1A= Date: Mon, 12 Apr 2021 12:07:13 +0000 Message-ID: References: <1608304614-13908-2-git-send-email-xuemingl@nvidia.com> <1618064637-16413-4-git-send-email-xuemingl@nvidia.com> <20210412065253.GD1650@platinum> In-Reply-To: <20210412065253.GD1650@platinum> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: 6wind.com; dkim=none (message not signed) header.d=none;6wind.com; dmarc=none action=none header.from=nvidia.com; x-originating-ip: [207.244.67.150] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: b75460df-24bb-4718-eaf5-08d8fdab81f9 x-ms-traffictypediagnostic: BY5PR12MB3666: x-ld-processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6790; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: r0qGL1FUCHwC75n/SvwEBVXr36ztEVnVGItqWQV9XeLiHFy1SsmqpX8p+Mo8F+JJyerbFGo9RrABfveJCPX+olx//SL3KsfDsdjH9+vW716nDhezljzr7MnIfgQBf3QnC3giwR8qB/rWAQiLy/b7KHX7F/abQO/yKH/FYwMel38gXse8ziB6iibIckm++cizyvwEzb+uZ5NSVRLWn7PcWT3M0aYi4yc5T8VVCVZySdac+IogNc63nWaoBQSmhPZr6N2kHEDpwFS7YZVTGSOYvHH7V4AP91bBGkEQqBC70psFNC/O3IGLwEG2bYoxHUYBqbUcZArPe4m/GFAaWFwuWc6upo19PAtpt7WVO4wEb+mgOvJtoBGoUWJxyqyGPfZv3Ot3nw7XQc0o202x30s2CLDp6KFwGUf8vlawnASy69E1UInSNWGlYzmqWKg4X4LLXaIMIcG23PSePYcrryiNZbYwbrq+tmh6m6wrIuCI22pXZk9ak5w4SibhxyjG8ig+4tbKSe0I5Yy346U/nCirHCxkKzG3OWioFmmY40hUQjqlWVo8hBlSEAbsYbpcsrfC6jOMmfvL+cHecL/FycNsFn6BE/LSiZlIlR9nGalc9oQ= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BY5PR12MB4324.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(39860400002)(346002)(396003)(376002)(366004)(136003)(38100700002)(9686003)(478600001)(66446008)(71200400001)(76116006)(316002)(55016002)(4326008)(66556008)(53546011)(64756008)(6506007)(86362001)(8676002)(66476007)(83380400001)(33656002)(5660300002)(55236004)(8936002)(2906002)(186003)(54906003)(66946007)(52536014)(6916009)(26005)(7696005); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?Zi+Eb9mm+5Dnj17t5kfVohg2CSM1+i/hvRuY7h/w6wPAsXTp4xDQAQkUE4IX?= =?us-ascii?Q?OWZ6jb1zQ2ALJeAfWYanWmj2GVp5kE7STmNdbRtbaDAHdYQubT/mb1E54pd4?= =?us-ascii?Q?Z/kU3wPPg25zyoG4Ch3SEDQca74hSuTJmxJ6ksDpRS/xFtaGL2Tgf9zlwo9I?= =?us-ascii?Q?9eLeCM5VQALlEFyUZF3wdwn2MDg6mMGpiJwwvJVfzRXPWOAJpmJUPsCl8/kZ?= =?us-ascii?Q?WQcleGMk4qVCgjFHb/ac5XhO98fe+ffwhYtqlA3wb9M7w+2+gIWLZk7aLAMJ?= =?us-ascii?Q?zRAGEmfs4txaDmkbe88ZMPFzDeFJmLQan6aEpnVdxxRjAKAaAcxja2VqarMj?= =?us-ascii?Q?ep5ROWYrCL9AGADuSe52Hiu1qlFe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i8inqSU3Vw5gzMSjwJbtFKbAL7apTzuhpV9vW4CI6KX4Bs?= =?us-ascii?Q?n+SBI+8MNEY47pHmZc9H812f?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BY5PR12MB4324.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: b75460df-24bb-4718-eaf5-08d8fdab81f9 X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Apr 2021 12:07:13.3953 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: wky2jAsqCFC2Pc94C+mcbcFvk8bpt8LWuXyGiwPi0DA4umPnUATyuCxc+4wuXUAm9F5G5umzu8WxR31bZg0ODA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR12MB3666 Subject: Re: [dpdk-dev] [PATCH v4 3/5] kvargs: add get by key function 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 Sender: "dev" > -----Original Message----- > From: Olivier Matz > Sent: Monday, April 12, 2021 2:53 PM > To: Xueming(Steven) Li > Cc: NBU-Contact-Thomas Monjalon ; Gaetan Rivet ; dev@dpdk.org; Asaf Penso > ; Ray Kinsella ; Neil Horman > Subject: Re: [PATCH v4 3/5] kvargs: add get by key function >=20 > Hi Xueming, >=20 > On Sat, Apr 10, 2021 at 02:23:55PM +0000, Xueming Li wrote: > > Adds a new function to get value of a specific key from kvargs list. > > > > Signed-off-by: Xueming Li > > Reviewed-by: Gaetan Rivet > > --- > > lib/librte_kvargs/rte_kvargs.c | 20 ++++++++++++++++++++ > > lib/librte_kvargs/rte_kvargs.h | 21 +++++++++++++++++++++ > > lib/librte_kvargs/version.map | 3 +++ > > 3 files changed, 44 insertions(+) > > > > diff --git a/lib/librte_kvargs/rte_kvargs.c > > b/lib/librte_kvargs/rte_kvargs.c index ffae8914cf..40e7670ab3 100644 > > --- a/lib/librte_kvargs/rte_kvargs.c > > +++ b/lib/librte_kvargs/rte_kvargs.c > > @@ -203,6 +203,26 @@ rte_kvargs_free(struct rte_kvargs *kvlist) > > free(kvlist); > > } > > > > +/* Lookup a value in an rte_kvargs list by its key. */ const char * > > +rte_kvargs_get(const struct rte_kvargs *kvlist, const char *key) { > > + unsigned int i; > > + > > + if (!kvlist) > > + return NULL; > > + for (i =3D 0; i < kvlist->count; ++i) { > > + /* Allows key to be NULL. */ > > + if (!key && !kvlist->pairs[i].key) > > + return kvlist->pairs[i].value; >=20 > Is it possible that kvlist->pairs[i].key =3D=3D NULL? In which case? Impossible, will remove this in next version, thanks. >=20 >=20 > Thanks, > Olivier