summaryrefslogtreecommitdiffstats
path: root/src/vppinfra/bitmap.h
diff options
context:
space:
mode:
authorStanislav Zaikin <zstaseg@gmail.com>2021-11-04 09:32:32 +0100
committerFlorin Coras <florin.coras@gmail.com>2021-11-25 22:45:58 +0000
commit09abed65b5c62cca5b850cc060e72192e3490811 (patch)
tree5ada564a2f0300a95ea7af528a62107bbf979197 /src/vppinfra/bitmap.h
parent4551715aaa647e5e565d81bd19fded8cacd8f778 (diff)
vppinfra: will_expand for pool_put and bitmap
Macro for pool_put and put a barrier inside load_balance_destroy when bitmap is actually growing. Type: improvement Signed-off-by: Stanislav Zaikin <zstaseg@gmail.com> Change-Id: Ief2912e8efd744289ebed68373fa6fd0ee83118e
Diffstat (limited to 'src/vppinfra/bitmap.h')
-rw-r--r--src/vppinfra/bitmap.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/vppinfra/bitmap.h b/src/vppinfra/bitmap.h
index af651ef0b7e..3c95bfb4b43 100644
--- a/src/vppinfra/bitmap.h
+++ b/src/vppinfra/bitmap.h
@@ -206,6 +206,14 @@ clib_bitmap_set (uword * ai, uword i, uword value)
return ai;
}
+always_inline u8
+clib_bitmap_will_expand (uword *ai, uword i)
+{
+ uword i0 = i / BITS (ai[0]);
+ return _vec_resize_will_expand (ai, 1, i0 * sizeof (ai[0]), 0,
+ sizeof (uword));
+}
+
/** Gets the ith bit value from a bitmap
@param ai - pointer to the bitmap
@param i - the bit position to interrogate