hash: support no free on delete
authorHonnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Fri, 26 Oct 2018 05:37:30 +0000 (00:37 -0500)
committerThomas Monjalon <thomas@monjalon.net>
Fri, 26 Oct 2018 10:44:52 +0000 (12:44 +0200)
commit9d033dac7d7cacca9559e0381f99b4c730e80979
tree14741f08fc73acd52adbe9c12f07a9997d3d200c
parent40f8e9c28c4e432a0a1300008a25097042382654
hash: support no free on delete

rte_hash_lookup_xxx APIs return the index of slot in
the key store. Application(reader) can use that index to reference
other data structures in its scope. Because of this, the
index should not be freed till the application completes
using the index.
RTE_HASH_EXTRA_FLAGS_NO_FREE_ON_DEL is introduced to support this.
When this flag is enabled rte_hash_del_xxx APIs do not free the
key-store index/internal memory associated with the deleted
entry. The new API rte_hash_free_key_with_position should be called
to free the key-store index/internal memory after calling
rte_hash_del_xxx APIs.

Suggested-by: Yipeng Wang <yipeng1.wang@intel.com>
Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
Reviewed-by: Yipeng Wang <yipeng1.wang@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
lib/librte_hash/rte_cuckoo_hash.c
lib/librte_hash/rte_cuckoo_hash.h
lib/librte_hash/rte_hash.h
lib/librte_hash/rte_hash_version.map
test/test/test_hash.c