From mboxrd@z Thu Jan 1 00:00:00 1970 From: "De Lara Guarch, Pablo" Subject: Re: [PATCH v2 6/6] hash: add new API function to query the key count 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> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Cc: "dev@dpdk.org" , "Richardson, Bruce" , "honnappa.nagarahalli@arm.com" , "vguvva@caviumnetworks.com" , "brijesh.s.singh@gmail.com" To: "Wang, Yipeng1" 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) In-Reply-To: <1530275097-123488-7-git-send-email-yipeng1.wang@intel.com> Content-Language: en-US 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: 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