hash: remove unnecessary locks in lock-free
Remove __hash_rw_reader_unlock() calls from lock free hash lookup Signed-off-by: Dharmik Thakkar <dharmik.thakkar@arm.com> Reviewed-by: Gavin Hu <gavin.hu@arm.com> Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com> Acked-by: Yipeng Wang <yipeng1.wang@intel.com>
This commit is contained in:
parent
94f73b5b6e
commit
cd723fc70c
@ -1286,10 +1286,8 @@ __rte_hash_lookup_with_hash_lf(const struct rte_hash *h, const void *key,
|
|||||||
/* Check if key is in primary location */
|
/* Check if key is in primary location */
|
||||||
bkt = &h->buckets[prim_bucket_idx];
|
bkt = &h->buckets[prim_bucket_idx];
|
||||||
ret = search_one_bucket_lf(h, key, short_sig, data, bkt);
|
ret = search_one_bucket_lf(h, key, short_sig, data, bkt);
|
||||||
if (ret != -1) {
|
if (ret != -1)
|
||||||
__hash_rw_reader_unlock(h);
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
|
||||||
/* Calculate secondary hash */
|
/* Calculate secondary hash */
|
||||||
bkt = &h->buckets[sec_bucket_idx];
|
bkt = &h->buckets[sec_bucket_idx];
|
||||||
|
|
||||||
@ -1297,10 +1295,8 @@ __rte_hash_lookup_with_hash_lf(const struct rte_hash *h, const void *key,
|
|||||||
FOR_EACH_BUCKET(cur_bkt, bkt) {
|
FOR_EACH_BUCKET(cur_bkt, bkt) {
|
||||||
ret = search_one_bucket_lf(h, key, short_sig,
|
ret = search_one_bucket_lf(h, key, short_sig,
|
||||||
data, cur_bkt);
|
data, cur_bkt);
|
||||||
if (ret != -1) {
|
if (ret != -1)
|
||||||
__hash_rw_reader_unlock(h);
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* The loads of sig_current in search_one_bucket
|
/* The loads of sig_current in search_one_bucket
|
||||||
|
Loading…
x
Reference in New Issue
Block a user