From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id 0C5271BE35 for ; Fri, 6 Jul 2018 19:36:14 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Jul 2018 10:36:13 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,317,1526367600"; d="scan'208";a="243192637" Received: from irsmsx105.ger.corp.intel.com ([163.33.3.28]) by fmsmga005.fm.intel.com with ESMTP; 06 Jul 2018 10:36:08 -0700 Received: from irsmsx156.ger.corp.intel.com (10.108.20.68) by irsmsx105.ger.corp.intel.com (163.33.3.28) with Microsoft SMTP Server (TLS) id 14.3.319.2; Fri, 6 Jul 2018 18:36:07 +0100 Received: from irsmsx108.ger.corp.intel.com ([169.254.11.139]) by IRSMSX156.ger.corp.intel.com ([169.254.3.205]) with mapi id 14.03.0319.002; Fri, 6 Jul 2018 18:36:07 +0100 From: "De Lara Guarch, Pablo" To: "Wang, Yipeng1" CC: "dev@dpdk.org" , "Richardson, Bruce" , "honnappa.nagarahalli@arm.com" , "vguvva@caviumnetworks.com" , "brijesh.s.singh@gmail.com" Thread-Topic: [PATCH v2 6/6] hash: add new API function to query the key count Thread-Index: AQHUD9/Q6ELnDloy6E+TUopz/a6UmqSCfyQA Date: Fri, 6 Jul 2018 17:36:06 +0000 Message-ID: References: <1528455078-328182-1-git-send-email-yipeng1.wang@intel.com> <1530275097-123488-1-git-send-email-yipeng1.wang@intel.com> <1530275097-123488-7-git-send-email-yipeng1.wang@intel.com> In-Reply-To: <1530275097-123488-7-git-send-email-yipeng1.wang@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiOTI5NDNjMmMtNjdmNS00MmNhLWFmMzEtYmQxZDg4NzA1OTBhIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiZWVXUjlBMENXcE1DXC9naXgyUmlDMU54VEJna29JRWlLUlRTU2dHNkljVkFkUTlTZWM2NEMzbTJnVFNRT2dSclUifQ== x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.200.100 dlp-reaction: no-action x-originating-ip: [163.33.239.180] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v2 6/6] hash: add new API function to query the key count X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jul 2018 17:36:15 -0000 > -----Original Message----- > From: Wang, Yipeng1 > Sent: Friday, June 29, 2018 1:25 PM > To: De Lara Guarch, Pablo > Cc: dev@dpdk.org; Wang, Yipeng1 ; Richardson, > Bruce ; honnappa.nagarahalli@arm.com; > vguvva@caviumnetworks.com; brijesh.s.singh@gmail.com > Subject: [PATCH v2 6/6] hash: add new API function to query the key count >=20 > Add a new function, rte_hash_count, to return the number of keys that are > currently stored in the hash table. Corresponding test functions are adde= d into > hash_test and hash_multiwriter test. >=20 > Signed-off-by: Yipeng Wang > --- > lib/librte_hash/rte_cuckoo_hash.c | 24 ++++++++++++++++++++++++ > lib/librte_hash/rte_hash.h | 11 +++++++++++ > lib/librte_hash/rte_hash_version.map | 8 ++++++++ > test/test/test_hash.c | 12 ++++++++++++ > test/test/test_hash_multiwriter.c | 9 +++++++++ > 5 files changed, 64 insertions(+) >=20 > diff --git a/lib/librte_hash/rte_cuckoo_hash.c > b/lib/librte_hash/rte_cuckoo_hash.c > index 4a90049..3f3d023 100644 > --- a/lib/librte_hash/rte_cuckoo_hash.c > +++ b/lib/librte_hash/rte_cuckoo_hash.c > @@ -370,6 +370,30 @@ rte_hash_secondary_hash(const hash_sig_t > primary_hash) > return primary_hash ^ ((tag + 1) * alt_bits_xor); } >=20 > +int32_t > +rte_hash_count(struct rte_hash *h) Parameter should be "const". For the rest of the patch: Acked-by: Pablo de Lara