diff options
author | Matus Fabian <matfabia@cisco.com> | 2018-08-21 03:15:50 -0700 |
---|---|---|
committer | Dave Barach <openvpp@barachs.net> | 2018-08-22 15:14:29 +0000 |
commit | 828d27ea0edb97280a0164041a286973fa74b5a2 (patch) | |
tree | 00c318426c5ccd916bbe1da1a8814a2d7ccc48fe /src/vppinfra/bihash_template.h | |
parent | 69ce30d6ab7c6afba475b25bb32542b1e955b91d (diff) |
bihash: add support for reuse of expired entry when bucket is full (VPP-1272)
Applications such as NAT that dynamically create entries require these entries to expire after some time.
Bihash user can now lazily delete expired entries. When inserting and bucket is full, expired entry is overwritten.
Change-Id: I6852305df399b546159407f1729c856afde5a634
Signed-off-by: Matus Fabian <matfabia@cisco.com>
Diffstat (limited to 'src/vppinfra/bihash_template.h')
-rw-r--r-- | src/vppinfra/bihash_template.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/vppinfra/bihash_template.h b/src/vppinfra/bihash_template.h index 9bf4737cd84..cfb8ceac69e 100644 --- a/src/vppinfra/bihash_template.h +++ b/src/vppinfra/bihash_template.h @@ -176,6 +176,12 @@ void BV (clib_bihash_free) (BVT (clib_bihash) * h); int BV (clib_bihash_add_del) (BVT (clib_bihash) * h, BVT (clib_bihash_kv) * add_v, int is_add); +int BV (clib_bihash_add_or_overwrite_stale) (BVT (clib_bihash) * h, + BVT (clib_bihash_kv) * add_v, + int (*is_stale_cb) (BVT + (clib_bihash_kv) + *, void *), + void *arg); int BV (clib_bihash_search) (BVT (clib_bihash) * h, BVT (clib_bihash_kv) * search_v, BVT (clib_bihash_kv) * return_v); |