aboutsummaryrefslogtreecommitdiffstats
path: root/src/vppinfra/bitmap.h
diff options
context:
space:
mode:
authorVladislav Grishenko <themiron@yandex-team.ru>2023-02-14 12:34:29 +0500
committerDamjan Marion <dmarion@0xa5.net>2023-03-06 14:31:47 +0000
commita20afdc845f4e901f7d3e6974e59a0dc2e8bf427 (patch)
treedd2360ee691903cd058af8fda23008be46e3ea73 /src/vppinfra/bitmap.h
parent1ee334c6f86b3e814aca1443ec7dfccdfc34ab26 (diff)
vppinfra: fix clib_bitmap_will_expand() result inversion
Pool's pool_put_will_expand() calls clib_bitmap_will_expand(), so every put except ones that leads to free_bitmap reallocation will get false positive results and vice versa. Unfortunatelly there's no related test and existing bitmap tests are failing silently with false positive result as well. Fortunatelly neither clib_bitmap_will_expand() nor pool_put_will_expand() are being used by current vpp codebase. Type: fix Signed-off-by: Vladislav Grishenko <themiron@yandex-team.ru> Change-Id: Id5bb900cf6a1b1002d37670f5c415c74165b5421
Diffstat (limited to 'src/vppinfra/bitmap.h')
-rw-r--r--src/vppinfra/bitmap.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/vppinfra/bitmap.h b/src/vppinfra/bitmap.h
index d579afd9979..abb1405d3a2 100644
--- a/src/vppinfra/bitmap.h
+++ b/src/vppinfra/bitmap.h
@@ -208,7 +208,7 @@ clib_bitmap_set (uword * ai, uword i, uword value)
always_inline u8
clib_bitmap_will_expand (uword *ai, uword i)
{
- return (i / BITS (ai[0])) < vec_max_len (ai);
+ return (i / BITS (ai[0])) >= vec_max_len (ai);
}
/** Gets the ith bit value from a bitmap