summaryrefslogtreecommitdiffstats
path: root/src/vppinfra/bihash_template.h
diff options
context:
space:
mode:
authorDave Barach <dave@barachs.net>2019-09-03 10:57:19 -0400
committerFlorin Coras <florin.coras@gmail.com>2019-09-03 16:00:08 +0000
commitbdf9b97774f02458ede6b7c7ae2d5728bddba000 (patch)
treeb83fe7c9e5553f082bce5ca89e1684bcd8b5372f /src/vppinfra/bihash_template.h
parentba0da570f264785f6b50eff7829f6653c0924069 (diff)
vppinfra: add bihash_init2
Add controls to list / not list a specific bihash in clib_all_bihashes, to immediately initialize a bihash. clib_bihash_init2 is now the primary API. It takes a typical args_t structure. clib_bihash_init becomes a compatibility widget. It fabricates an args_t and calls init2... Type: refactor Ticket: VPP-1758 Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: Ib3e1304884997cf7025af20bdc67a7dda290f15b
Diffstat (limited to 'src/vppinfra/bihash_template.h')
-rw-r--r--src/vppinfra/bihash_template.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/vppinfra/bihash_template.h b/src/vppinfra/bihash_template.h
index 0865c2b3ab4..ebd70c03371 100644
--- a/src/vppinfra/bihash_template.h
+++ b/src/vppinfra/bihash_template.h
@@ -159,6 +159,17 @@ BVS (clib_bihash)
} BVT (clib_bihash);
+typedef struct
+{
+ BVT (clib_bihash) * h;
+ char *name;
+ u32 nbuckets;
+ uword memory_size;
+ format_function_t *fmt_fn;
+ u8 instantiate_immediately;
+ u8 dont_add_to_all_bihash_list;
+} BVT (clib_bihash_init2_args);
+
extern void **clib_all_bihashes;
#if BIHASH_32_64_SVM
@@ -291,6 +302,8 @@ static inline uword BV (clib_bihash_get_offset) (BVT (clib_bihash) * h,
void BV (clib_bihash_init)
(BVT (clib_bihash) * h, char *name, u32 nbuckets, uword memory_size);
+void BV (clib_bihash_init2) (BVT (clib_bihash_init2_args) * a);
+
#if BIHASH_32_64_SVM
void BV (clib_bihash_master_init_svm)
(BVT (clib_bihash) * h, char *name, u32 nbuckets, u64 memory_size);