diff options
author | Damjan Marion <damarion@cisco.com> | 2020-04-15 17:45:23 +0200 |
---|---|---|
committer | Florin Coras <florin.coras@gmail.com> | 2020-04-15 19:33:45 +0000 |
commit | 7edc86d005d7051341d380fba2b1fe4bc7dd016e (patch) | |
tree | c2991d5257e15a8e90fcf3c4fe1d48478298b2fa /src/vppinfra/cuckoo_template.h | |
parent | 08eb2bb205f998a75dacd1f3b999ec1a10160b35 (diff) |
vppinfra: add clib_cuckoo_search_inline_with_hash function
Type: improvement
Change-Id: I547263ae954506f11101666ff768524fbfdb579e
Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/vppinfra/cuckoo_template.h')
-rw-r--r-- | src/vppinfra/cuckoo_template.h | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/vppinfra/cuckoo_template.h b/src/vppinfra/cuckoo_template.h index 06c4afdc79b..f785e7ec642 100644 --- a/src/vppinfra/cuckoo_template.h +++ b/src/vppinfra/cuckoo_template.h @@ -408,13 +408,13 @@ always_inline int CV (clib_cuckoo_bucket_search) (CVT (clib_cuckoo_bucket) * return CLIB_CUCKOO_ERROR_NOT_FOUND; } -always_inline int CV (clib_cuckoo_search_inline) (CVT (clib_cuckoo) * h, - CVT (clib_cuckoo_kv) * kvp) +always_inline int +CV (clib_cuckoo_search_inline_with_hash) (CVT (clib_cuckoo) * h, u64 hash, + CVT (clib_cuckoo_kv) * kvp) { clib_cuckoo_lookup_info_t lookup; int rv; - u64 hash = CV (clib_cuckoo_hash) (kvp); CVT (clib_cuckoo_bucket) * buckets; again: buckets = h->buckets; @@ -447,6 +447,13 @@ again: return rv; } +always_inline int CV (clib_cuckoo_search_inline) (CVT (clib_cuckoo) * h, + CVT (clib_cuckoo_kv) * kvp) +{ + u64 hash = CV (clib_cuckoo_hash) (kvp); + return CV (clib_cuckoo_search_inline_with_hash) (h, hash, kvp); +} + #endif /* __included_cuckoo_template_h__ */ /** @endcond */ |