X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvppinfra%2Fbihash_template.h;h=8398c38f57706488509359d58fff233e50cb3c45;hb=6e74aa2b9877623c6130d7b2a43b7d8fd0a1b9f8;hp=2101d44defe71b3eeb0cd8b4a1c20fbbfc16fea0;hpb=30765e77ac98913abefbdb9e8325a2b3f1e11082;p=vpp.git diff --git a/src/vppinfra/bihash_template.h b/src/vppinfra/bihash_template.h index 2101d44defe..8398c38f577 100644 --- a/src/vppinfra/bihash_template.h +++ b/src/vppinfra/bihash_template.h @@ -384,11 +384,10 @@ static inline void BV (clib_bihash_prefetch_data) CLIB_PREFETCH (v, CLIB_CACHE_LINE_BYTES, READ); } -static inline int BV (clib_bihash_search_inline_2) +static inline int BV (clib_bihash_search_inline_2_with_hash) (BVT (clib_bihash) * h, - BVT (clib_bihash_kv) * search_key, BVT (clib_bihash_kv) * valuep) + u64 hash, BVT (clib_bihash_kv) * search_key, BVT (clib_bihash_kv) * valuep) { - u64 hash; u32 bucket_index; BVT (clib_bihash_value) * v; BVT (clib_bihash_bucket) * b; @@ -399,8 +398,6 @@ static inline int BV (clib_bihash_search_inline_2) ASSERT (valuep); - hash = BV (clib_bihash_hash) (search_key); - bucket_index = hash & (h->nbuckets - 1); b = &h->buckets[bucket_index]; @@ -461,6 +458,19 @@ static inline int BV (clib_bihash_search_inline_2) return -1; } +static inline int BV (clib_bihash_search_inline_2) + (BVT (clib_bihash) * h, + BVT (clib_bihash_kv) * search_key, BVT (clib_bihash_kv) * valuep) +{ + u64 hash; + + hash = BV (clib_bihash_hash) (search_key); + + return BV (clib_bihash_search_inline_2_with_hash) (h, hash, search_key, + valuep); +} + + #endif /* __included_bihash_template_h__ */ /** @endcond */