Code Review
/
vpp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
svm: minimal initial fifo
[vpp.git]
/
src
/
vppinfra
/
bihash_template.h
diff --git
a/src/vppinfra/bihash_template.h
b/src/vppinfra/bihash_template.h
index
2e2ba91
..
f11e6d5
100644
(file)
--- a/
src/vppinfra/bihash_template.h
+++ b/
src/vppinfra/bihash_template.h
@@
-142,6
+142,7
@@
BVS (clib_bihash)
#endif
u64 alloc_arena; /* Base of the allocation arena */
#endif
u64 alloc_arena; /* Base of the allocation arena */
+ volatile u8 instantiated;
/**
* A custom format function to print the Key and Value of bihash_key instead of default hexdump
/**
* A custom format function to print the Key and Value of bihash_key instead of default hexdump
@@
-158,6
+159,17
@@
BVS (clib_bihash)
} BVT (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
extern void **clib_all_bihashes;
#if BIHASH_32_64_SVM
@@
-290,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_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);
#if BIHASH_32_64_SVM
void BV (clib_bihash_master_init_svm)
(BVT (clib_bihash) * h, char *name, u32 nbuckets, u64 memory_size);
@@
-314,8
+328,16
@@
int BV (clib_bihash_search) (BVT (clib_bihash) * h,
BVT (clib_bihash_kv) * search_v,
BVT (clib_bihash_kv) * return_v);
BVT (clib_bihash_kv) * search_v,
BVT (clib_bihash_kv) * return_v);
+#define BIHASH_WALK_STOP 0
+#define BIHASH_WALK_CONTINUE 1
+
+typedef
+ int (*BV (clib_bihash_foreach_key_value_pair_cb)) (BVT (clib_bihash_kv) *,
+ void *);
void BV (clib_bihash_foreach_key_value_pair) (BVT (clib_bihash) * h,
void BV (clib_bihash_foreach_key_value_pair) (BVT (clib_bihash) * h,
- void *callback, void *arg);
+ BV
+ (clib_bihash_foreach_key_value_pair_cb)
+ cb, void *arg);
void *clib_all_bihash_set_heap (void);
void clib_bihash_copied (void *dst, void *src);
void *clib_all_bihash_set_heap (void);
void clib_bihash_copied (void *dst, void *src);