aboutsummaryrefslogtreecommitdiffstats
path: root/src/vppinfra/bihash_template.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/vppinfra/bihash_template.h')
-rw-r--r--src/vppinfra/bihash_template.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/vppinfra/bihash_template.h b/src/vppinfra/bihash_template.h
index d145b61952a..2e2ba911b7c 100644
--- a/src/vppinfra/bihash_template.h
+++ b/src/vppinfra/bihash_template.h
@@ -129,6 +129,7 @@ BVS (clib_bihash)
u32 nbuckets;
u32 log2_nbuckets;
+ u64 memory_size;
u8 *name;
u64 *freelists;
@@ -157,6 +158,8 @@ BVS (clib_bihash)
} BVT (clib_bihash);
+extern void **clib_all_bihashes;
+
#if BIHASH_32_64_SVM
#undef alloc_arena_next
#undef alloc_arena_size
@@ -313,6 +316,8 @@ int BV (clib_bihash_search) (BVT (clib_bihash) * h,
void BV (clib_bihash_foreach_key_value_pair) (BVT (clib_bihash) * h,
void *callback, void *arg);
+void *clib_all_bihash_set_heap (void);
+void clib_bihash_copied (void *dst, void *src);
format_function_t BV (format_bihash);
format_function_t BV (format_bihash_kvp);
@@ -326,6 +331,9 @@ static inline int BV (clib_bihash_search_inline_with_hash)
BVT (clib_bihash_bucket) * b;
int i, limit;
+ if (PREDICT_FALSE (alloc_arena (h) == 0))
+ return -1;
+
bucket_index = hash & (h->nbuckets - 1);
b = &h->buckets[bucket_index];
@@ -389,6 +397,9 @@ static inline void BV (clib_bihash_prefetch_data)
BVT (clib_bihash_value) * v;
BVT (clib_bihash_bucket) * b;
+ if (PREDICT_FALSE (alloc_arena (h) == 0))
+ return;
+
bucket_index = hash & (h->nbuckets - 1);
b = &h->buckets[bucket_index];
@@ -414,6 +425,9 @@ static inline int BV (clib_bihash_search_inline_2_with_hash)
ASSERT (valuep);
+ if (PREDICT_FALSE (alloc_arena (h) == 0))
+ return -1;
+
bucket_index = hash & (h->nbuckets - 1);
b = &h->buckets[bucket_index];