From: Dharmik Thakkar <dharmik.thakkar@arm.com>
To: Yipeng Wang <yipeng1.wang@intel.com>,
Sameh Gobriel <sameh.gobriel@intel.com>,
Bruce Richardson <bruce.richardson@intel.com>
Cc: dev@dpdk.org, honnappa.nagarahalli@arm.com,
Dharmik Thakkar <dharmik.thakkar@arm.com>
Subject: [dpdk-dev] [PATCH] lib/hash: remove unnecessary locks in lock-free
Date: Thu, 21 Nov 2019 12:17:59 -0600 [thread overview]
Message-ID: <20191121181759.11401-1-dharmik.thakkar@arm.com> (raw)
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>
---
lib/librte_hash/rte_cuckoo_hash.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/lib/librte_hash/rte_cuckoo_hash.c b/lib/librte_hash/rte_cuckoo_hash.c
index 87a4c01f2f9e..1a4795c82321 100644
--- a/lib/librte_hash/rte_cuckoo_hash.c
+++ b/lib/librte_hash/rte_cuckoo_hash.c
@@ -1285,10 +1285,8 @@ __rte_hash_lookup_with_hash_lf(const struct rte_hash *h, const void *key,
/* Check if key is in primary location */
bkt = &h->buckets[prim_bucket_idx];
ret = search_one_bucket_lf(h, key, short_sig, data, bkt);
- if (ret != -1) {
- __hash_rw_reader_unlock(h);
+ if (ret != -1)
return ret;
- }
/* Calculate secondary hash */
bkt = &h->buckets[sec_bucket_idx];
@@ -1296,10 +1294,8 @@ __rte_hash_lookup_with_hash_lf(const struct rte_hash *h, const void *key,
FOR_EACH_BUCKET(cur_bkt, bkt) {
ret = search_one_bucket_lf(h, key, short_sig,
data, cur_bkt);
- if (ret != -1) {
- __hash_rw_reader_unlock(h);
+ if (ret != -1)
return ret;
- }
}
/* The loads of sig_current in search_one_bucket
--
2.17.1
next reply other threads:[~2019-11-21 18:18 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-21 18:17 Dharmik Thakkar [this message]
2019-11-25 18:49 ` Wang, Yipeng1
2019-11-25 21:54 ` Thomas Monjalon
2019-11-25 22:02 ` Wang, Yipeng1
2019-11-25 22:44 ` Thomas Monjalon
2019-11-25 22:55 ` Dharmik Thakkar
2019-11-25 23:14 ` Thomas Monjalon
2020-01-17 16:42 ` Dharmik Thakkar
2020-01-19 23:37 ` Thomas Monjalon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191121181759.11401-1-dharmik.thakkar@arm.com \
--to=dharmik.thakkar@arm.com \
--cc=bruce.richardson@intel.com \
--cc=dev@dpdk.org \
--cc=honnappa.nagarahalli@arm.com \
--cc=sameh.gobriel@intel.com \
--cc=yipeng1.wang@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).