[dpdk-dev] [PATCH v2 6/6] hash: add new API function to query the key count

De Lara Guarch, Pablo pablo.de.lara.guarch at intel.com
Fri Jul 6 19:36:06 CEST 2018



> -----Original Message-----
> From: Wang, Yipeng1
> Sent: Friday, June 29, 2018 1:25 PM
> To: De Lara Guarch, Pablo <pablo.de.lara.guarch at intel.com>
> Cc: dev at dpdk.org; Wang, Yipeng1 <yipeng1.wang at intel.com>; Richardson,
> Bruce <bruce.richardson at intel.com>; honnappa.nagarahalli at arm.com;
> vguvva at caviumnetworks.com; brijesh.s.singh at gmail.com
> Subject: [PATCH v2 6/6] hash: add new API function to query the key count
> 
> 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 added into
> hash_test and hash_multiwriter test.
> 
> Signed-off-by: Yipeng Wang <yipeng1.wang at intel.com>
> ---
>  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(+)
> 
> 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);  }
> 
> +int32_t
> +rte_hash_count(struct rte_hash *h)

Parameter should be "const".

For the rest of the patch:

Acked-by: Pablo de Lara <pablo.de.lara.guarch at intel.com>


More information about the dev mailing list