summaryrefslogtreecommitdiffstats
path: root/src/vppinfra/bihash_template.h
diff options
context:
space:
mode:
authorNathan Skrzypczak <nathan.skrzypczak@gmail.com>2020-08-17 14:14:56 +0200
committerNathan Skrzypczak <nathan.skrzypczak@gmail.com>2020-08-17 16:33:50 +0200
commit42b29ba3d4a30e4bf660f3a0a6a4af40d62861fe (patch)
treeb6224d548f5e550a906f27fc6c586b95b630c030 /src/vppinfra/bihash_template.h
parentec9bf61fcb481b223d4c3e636e78f6cf9997ca57 (diff)
vppinfra: fix RC in bihash instantiation
There can be a race condition in the case a thread tries to do a bihash_search while another instantiates the bihash. Type: fix Change-Id: Ic61b590763beb409e112957c43a5a66cd10afb28 Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
Diffstat (limited to 'src/vppinfra/bihash_template.h')
-rw-r--r--src/vppinfra/bihash_template.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/vppinfra/bihash_template.h b/src/vppinfra/bihash_template.h
index 07adeb853ec..85c5d6505c0 100644
--- a/src/vppinfra/bihash_template.h
+++ b/src/vppinfra/bihash_template.h
@@ -388,7 +388,7 @@ static inline int BV (clib_bihash_search_inline_with_hash)
/* *INDENT-ON* */
#if BIHASH_LAZY_INSTANTIATE
- if (PREDICT_FALSE (alloc_arena (h) == 0))
+ if (PREDICT_FALSE (h->instantiated == 0))
return -1;
#endif
@@ -453,7 +453,7 @@ static inline void BV (clib_bihash_prefetch_data)
BVT (clib_bihash_bucket) * b;
#if BIHASH_LAZY_INSTANTIATE
- if (PREDICT_FALSE (alloc_arena (h) == 0))
+ if (PREDICT_FALSE (h->instantiated == 0))
return;
#endif
@@ -489,7 +489,7 @@ static inline int BV (clib_bihash_search_inline_2_with_hash)
ASSERT (valuep);
#if BIHASH_LAZY_INSTANTIATE
- if (PREDICT_FALSE (alloc_arena (h) == 0))
+ if (PREDICT_FALSE (h->instantiated == 0))
return -1;
#endif