diff options
author | Dave Barach <dave@barachs.net> | 2020-04-16 12:00:14 -0400 |
---|---|---|
committer | Damjan Marion <dmarion@me.com> | 2020-04-21 10:26:14 +0000 |
commit | 16e4a4a0ae39ebc1ded1b6dba2799b176aee1828 (patch) | |
tree | 14e21d5be2bb77b9301b5cb56118e3e9d8293811 /src/plugins/gbp/gbp_endpoint.c | |
parent | b9753540d2a69bbab807653fc3d0c1b43ec4d6d5 (diff) |
vppinfra: bihash improvements
Template instances can allocate BIHASH_KVP_PER_PAGE data records
tangent to the bucket, to remove a dependent read / prefetch.
Template instances can ask for immediate memory allocation, to avoid
several branches in the lookup path.
Clean up l2 fib, gpb plugin codes: use clib_bihash_get_bucket(...)
Use hugepages for bihash allocation arenas
Type: improvement
Signed-off-by: Dave Barach <dave@barachs.net>
Signed-off-by: Damjan Marion <damarion@cisco.com>
Change-Id: I92fc11bc58e48d84e2d61f44580916dd1c56361c
Diffstat (limited to 'src/plugins/gbp/gbp_endpoint.c')
-rw-r--r-- | src/plugins/gbp/gbp_endpoint.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/plugins/gbp/gbp_endpoint.c b/src/plugins/gbp/gbp_endpoint.c index 9ef08904041..e1a810cf222 100644 --- a/src/plugins/gbp/gbp_endpoint.c +++ b/src/plugins/gbp/gbp_endpoint.c @@ -1398,8 +1398,8 @@ gbp_endpoint_scan_l2 (vlib_main_t * vm) last_start = vlib_time_now (vm); } - b = >e_table->buckets[i]; - if (b->offset == 0) + b = clib_bihash_get_bucket_16_8 (gte_table, i); + if (clib_bihash_bucket_is_empty_16_8 (b)) continue; v = clib_bihash_get_value_16_8 (gte_table, b->offset); @@ -1416,7 +1416,7 @@ gbp_endpoint_scan_l2 (vlib_main_t * vm) * Note: we may have just freed the bucket's backing * storage, so check right here... */ - if (b->offset == 0) + if (clib_bihash_bucket_is_empty_16_8 (b)) goto doublebreak; } v++; @@ -1453,8 +1453,8 @@ gbp_endpoint_scan_l3 (vlib_main_t * vm) last_start = vlib_time_now (vm); } - b = >e_table->buckets[i]; - if (b->offset == 0) + b = clib_bihash_get_bucket_24_8 (gte_table, i); + if (clib_bihash_bucket_is_empty_24_8 (b)) continue; v = clib_bihash_get_value_24_8 (gte_table, b->offset); @@ -1471,7 +1471,7 @@ gbp_endpoint_scan_l3 (vlib_main_t * vm) * Note: we may have just freed the bucket's backing * storage, so check right here... */ - if (b->offset == 0) + if (clib_bihash_bucket_is_empty_24_8 (b)) goto doublebreak; } v++; |