hash: fix total entries count
authorDharmik Thakkar <dharmik.thakkar@arm.com>
Thu, 9 May 2019 17:19:06 +0000 (17:19 +0000)
committerThomas Monjalon <thomas@monjalon.net>
Thu, 9 May 2019 20:31:29 +0000 (22:31 +0200)
commit52c7abbea95064edd73eee6ab1ceafaab066d55a
treef37b204fabf24b66092a0ad895ca322a2f5903d1
parent2bc731197b8afc0ea0a0796dd7cea43474a6e1f9
hash: fix total entries count

In rte_hash, with current implementation, it is possible that keys
are stored at indexes greater than the number of total entries.

Currently, in rte_hash_free_key_with_position(), due to incorrect
computation of total_entries, application cannot free keys with
indexes greater than the number of total entries.

This patch fixes this incorrect computation of total_entries.

Bugzilla ID: 261
Fixes: 9d033dac7d7c ("hash: support no free on delete")
Cc: stable@dpdk.org
Reported-by: Linfan <zhongdahulinfan@163.com>
Suggested-by: Linfan <zhongdahulinfan@163.com>
Signed-off-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
Acked-by: Yipeng Wang <yipeng1.wang@intel.com>
lib/librte_hash/rte_cuckoo_hash.c