* [PATCH bpf-next] selftests/bpf: Rename libarena struct bitmap to struct arena_bitmap
@ 2026-07-07 22:01 Yonghong Song
2026-07-07 22:14 ` Emil Tsalapatis
2026-07-08 3:20 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: Yonghong Song @ 2026-07-07 22:01 UTC (permalink / raw)
To: bpf
Cc: Alexei Starovoitov, Andrii Nakryiko, Daniel Borkmann, kernel-team,
Martin KaFai Lau, Emil Tsalapatis
When building bpf selftest with latest bpf-next, I got the following failure:
In file included from /home/yhs/work/bpf-next/tools/testing/selftests/bpf/libarena/selftests/test_parallel_bitmap.bpf.c:8:
/home/yhs/work/bpf-next/tools/testing/selftests/bpf/libarena/include/libarena/bitmap.h:11:8: error: redefinition of
'bitmap'
11 | struct bitmap {
| ^
/home/yhs/work/bpf-next/tools/testing/selftests/bpf/tools/include/vmlinux.h:51320:8: note: previous definition is here
51320 | struct bitmap {
| ^
The vmlinux.h struct bitmap comes from drivers/md/md-bitmap.c:
struct bitmap {
struct bitmap_counts { ... }
...
}
To fix the issue, I renamed libarena struct bitmap to arena_bitmap to avoid the conflict.
Cc: Emil Tsalapatis <emil@etsalapatis.com>
Signed-off-by: Yonghong Song <yonghong.song@linux.dev>
---
.../bpf/libarena/include/libarena/bitmap.h | 36 +++++++++---------
.../bpf/libarena/selftests/test_bitmap.bpf.c | 24 ++++++------
.../selftests/test_parallel_bitmap.bpf.c | 2 +-
.../selftests/bpf/libarena/src/bitmap.bpf.c | 38 +++++++++----------
4 files changed, 50 insertions(+), 50 deletions(-)
diff --git a/tools/testing/selftests/bpf/libarena/include/libarena/bitmap.h b/tools/testing/selftests/bpf/libarena/include/libarena/bitmap.h
index cf6b63f5d9a4..e2431ea6fdd6 100644
--- a/tools/testing/selftests/bpf/libarena/include/libarena/bitmap.h
+++ b/tools/testing/selftests/bpf/libarena/include/libarena/bitmap.h
@@ -8,27 +8,27 @@
#define BIT_MASK(nr) (1ULL << ((nr) % BITS_PER_LONG_LONG))
#define BIT_WORD(nr) ((nr) / BITS_PER_LONG_LONG)
-struct bitmap {
+struct arena_bitmap {
u64 bits[0];
};
-struct bitmap __arena *bmp_alloc(size_t bits);
-void bmp_free(struct bitmap __arena *bmp);
+struct arena_bitmap __arena *bmp_alloc(size_t bits);
+void bmp_free(struct arena_bitmap __arena *bmp);
-void __bmp_set_bit(u32 bit, struct bitmap __arena *bmp);
-void __bmp_clear_bit(u32 bit, struct bitmap __arena *bmp);
-void bmp_set_bit(u32 bit, struct bitmap __arena *bmp);
-void bmp_clear_bit(u32 bit, struct bitmap __arena *bmp);
-bool bmp_test_bit(u32 bit, struct bitmap __arena *bmp);
-bool bmp_test_and_clear_bit(u32 bit, struct bitmap __arena *bmp);
-bool bmp_test_and_set_bit(u32 bit, struct bitmap __arena *bmp);
+void __bmp_set_bit(u32 bit, struct arena_bitmap __arena *bmp);
+void __bmp_clear_bit(u32 bit, struct arena_bitmap __arena *bmp);
+void bmp_set_bit(u32 bit, struct arena_bitmap __arena *bmp);
+void bmp_clear_bit(u32 bit, struct arena_bitmap __arena *bmp);
+bool bmp_test_bit(u32 bit, struct arena_bitmap __arena *bmp);
+bool bmp_test_and_clear_bit(u32 bit, struct arena_bitmap __arena *bmp);
+bool bmp_test_and_set_bit(u32 bit, struct arena_bitmap __arena *bmp);
-void bmp_clear(size_t bits, struct bitmap __arena *bmp);
-void bmp_and(size_t bits, struct bitmap __arena *dst, struct bitmap __arena *src1, struct bitmap __arena *src2);
-void bmp_or(size_t bits, struct bitmap __arena *dst, struct bitmap __arena *src1, struct bitmap __arena *src2);
-bool bmp_empty(size_t bits, struct bitmap __arena *bmp);
-void bmp_copy(size_t bits, struct bitmap __arena *dst, struct bitmap __arena *src);
+void bmp_clear(size_t bits, struct arena_bitmap __arena *bmp);
+void bmp_and(size_t bits, struct arena_bitmap __arena *dst, struct arena_bitmap __arena *src1, struct arena_bitmap __arena *src2);
+void bmp_or(size_t bits, struct arena_bitmap __arena *dst, struct arena_bitmap __arena *src1, struct arena_bitmap __arena *src2);
+bool bmp_empty(size_t bits, struct arena_bitmap __arena *bmp);
+void bmp_copy(size_t bits, struct arena_bitmap __arena *dst, struct arena_bitmap __arena *src);
-bool bmp_intersects(size_t bits, struct bitmap __arena *arg1, struct bitmap __arena *arg2);
-bool bmp_subset(size_t bits, struct bitmap __arena *big, struct bitmap __arena *small);
-void bmp_print(size_t bits, struct bitmap __arena *bmp);
+bool bmp_intersects(size_t bits, struct arena_bitmap __arena *arg1, struct arena_bitmap __arena *arg2);
+bool bmp_subset(size_t bits, struct arena_bitmap __arena *big, struct arena_bitmap __arena *small);
+void bmp_print(size_t bits, struct arena_bitmap __arena *bmp);
diff --git a/tools/testing/selftests/bpf/libarena/selftests/test_bitmap.bpf.c b/tools/testing/selftests/bpf/libarena/selftests/test_bitmap.bpf.c
index e7d32f44d687..76319a529f02 100644
--- a/tools/testing/selftests/bpf/libarena/selftests/test_bitmap.bpf.c
+++ b/tools/testing/selftests/bpf/libarena/selftests/test_bitmap.bpf.c
@@ -8,7 +8,7 @@
#define MID_BIT (BITS_PER_LONG_LONG + 1)
#define LAST_BIT (TEST_BITS - 1)
-static void test_bmp_setall(struct bitmap __arena *bmp)
+static void test_bmp_setall(struct arena_bitmap __arena *bmp)
{
volatile u32 i;
@@ -19,7 +19,7 @@ static void test_bmp_setall(struct bitmap __arena *bmp)
SEC("syscall")
__weak int test_bitmap_alloc_free(void)
{
- struct bitmap __arena *bmp;
+ struct arena_bitmap __arena *bmp;
bmp = bmp_alloc(TEST_BITS);
if (!bmp)
@@ -47,7 +47,7 @@ __weak int test_bitmap_alloc_free(void)
SEC("syscall")
__weak int test_bitmap_bit_ops(void)
{
- struct bitmap __arena *bmp;
+ struct arena_bitmap __arena *bmp;
bmp = bmp_alloc(TEST_BITS);
if (!bmp)
@@ -97,7 +97,7 @@ __weak int test_bitmap_bit_ops(void)
return -EINVAL;
}
-static bool test_bitmap_test_and_clear_single(struct bitmap __arena *bmp, size_t ind)
+static bool test_bitmap_test_and_clear_single(struct arena_bitmap __arena *bmp, size_t ind)
{
if (bmp_test_and_clear_bit(ind, bmp))
return false;
@@ -116,7 +116,7 @@ static bool test_bitmap_test_and_clear_single(struct bitmap __arena *bmp, size_t
return true;
}
-static bool test_bitmap_test_and_set_single(struct bitmap __arena *bmp, size_t ind)
+static bool test_bitmap_test_and_set_single(struct arena_bitmap __arena *bmp, size_t ind)
{
if (bmp_test_and_set_bit(ind, bmp))
return false;
@@ -138,7 +138,7 @@ static bool test_bitmap_test_and_set_single(struct bitmap __arena *bmp, size_t i
SEC("syscall")
__weak int test_bitmap_test_and_clear_bit(void)
{
- struct bitmap __arena *bmp;
+ struct arena_bitmap __arena *bmp;
bmp = bmp_alloc(TEST_BITS);
if (!bmp)
@@ -167,7 +167,7 @@ __weak int test_bitmap_test_and_clear_bit(void)
SEC("syscall")
__weak int test_bitmap_test_and_set_bit(void)
{
- struct bitmap __arena *bmp;
+ struct arena_bitmap __arena *bmp;
bmp = bmp_alloc(TEST_BITS);
if (!bmp)
@@ -194,7 +194,7 @@ __weak int test_bitmap_test_and_set_bit(void)
SEC("syscall")
__weak int test_bitmap_and(void)
{
- struct bitmap __arena *src1 = NULL, *src2 = NULL, *dst = NULL;
+ struct arena_bitmap __arena *src1 = NULL, *src2 = NULL, *dst = NULL;
src1 = bmp_alloc(TEST_BITS);
src2 = bmp_alloc(TEST_BITS);
@@ -240,7 +240,7 @@ __weak int test_bitmap_and(void)
SEC("syscall")
__weak int test_bitmap_or(void)
{
- struct bitmap __arena *src1 = NULL, *src2 = NULL, *dst = NULL;
+ struct arena_bitmap __arena *src1 = NULL, *src2 = NULL, *dst = NULL;
src1 = bmp_alloc(TEST_BITS);
src2 = bmp_alloc(TEST_BITS);
@@ -285,7 +285,7 @@ __weak int test_bitmap_or(void)
SEC("syscall")
__weak int test_bitmap_subset(void)
{
- struct bitmap __arena *big = NULL, *small = NULL;
+ struct arena_bitmap __arena *big = NULL, *small = NULL;
big = bmp_alloc(TEST_BITS);
small = bmp_alloc(TEST_BITS);
@@ -329,7 +329,7 @@ __weak int test_bitmap_subset(void)
SEC("syscall")
__weak int test_bitmap_intersects(void)
{
- struct bitmap __arena *arg1 = NULL, *arg2 = NULL;
+ struct arena_bitmap __arena *arg1 = NULL, *arg2 = NULL;
arg1 = bmp_alloc(TEST_BITS);
arg2 = bmp_alloc(TEST_BITS);
@@ -362,7 +362,7 @@ __weak int test_bitmap_intersects(void)
SEC("syscall")
__weak int test_bitmap_copy(void)
{
- struct bitmap __arena *arg1 = NULL, *arg2 = NULL;
+ struct arena_bitmap __arena *arg1 = NULL, *arg2 = NULL;
arg1 = bmp_alloc(TEST_BITS);
arg2 = bmp_alloc(TEST_BITS);
diff --git a/tools/testing/selftests/bpf/libarena/selftests/test_parallel_bitmap.bpf.c b/tools/testing/selftests/bpf/libarena/selftests/test_parallel_bitmap.bpf.c
index eec2871e2b0d..ea1fac95b461 100644
--- a/tools/testing/selftests/bpf/libarena/selftests/test_parallel_bitmap.bpf.c
+++ b/tools/testing/selftests/bpf/libarena/selftests/test_parallel_bitmap.bpf.c
@@ -12,7 +12,7 @@
#define TEST_BITMAP_SYNC_SPINS BPF_MAX_LOOPS
#define TEST_BITMAP_ITERS 10 * 1000 * 1000
-static struct bitmap __arena *bitmap;
+static struct arena_bitmap __arena *bitmap;
static volatile u64 started;
static volatile bool test_abort;
diff --git a/tools/testing/selftests/bpf/libarena/src/bitmap.bpf.c b/tools/testing/selftests/bpf/libarena/src/bitmap.bpf.c
index 80e814401fb9..5ff8e688ddc7 100644
--- a/tools/testing/selftests/bpf/libarena/src/bitmap.bpf.c
+++ b/tools/testing/selftests/bpf/libarena/src/bitmap.bpf.c
@@ -10,16 +10,16 @@
#include <libarena/bitmap.h>
__weak
-struct bitmap __arena *bmp_alloc(size_t bits)
+struct arena_bitmap __arena *bmp_alloc(size_t bits)
{
- struct bitmap __arena *bmp;
+ struct arena_bitmap __arena *bmp;
size_t size = BITS_TO_LONG_LONGS(bits) * sizeof(bmp->bits[0]);
/* Assume long-aligned masks. */
if (bits % BITS_PER_LONG_LONG)
return NULL;
- bmp = (struct bitmap __arena *)arena_malloc(size);
+ bmp = (struct arena_bitmap __arena *)arena_malloc(size);
if (!bmp)
return NULL;
@@ -29,31 +29,31 @@ struct bitmap __arena *bmp_alloc(size_t bits)
}
__weak
-void bmp_free(struct bitmap __arena *bmp)
+void bmp_free(struct arena_bitmap __arena *bmp)
{
arena_free(bmp);
}
__weak
-void __bmp_set_bit(u32 bit, struct bitmap __arena *bmp)
+void __bmp_set_bit(u32 bit, struct arena_bitmap __arena *bmp)
{
bmp->bits[BIT_WORD(bit)] |= BIT_MASK(bit);
}
__weak
-void __bmp_clear_bit(u32 bit, struct bitmap __arena *bmp)
+void __bmp_clear_bit(u32 bit, struct arena_bitmap __arena *bmp)
{
bmp->bits[BIT_WORD(bit)] &= ~BIT_MASK(bit);
}
__weak
-bool bmp_test_bit(u32 bit, struct bitmap __arena *bmp)
+bool bmp_test_bit(u32 bit, struct arena_bitmap __arena *bmp)
{
return bmp->bits[BIT_WORD(bit)] & BIT_MASK(bit);
}
__weak
-bool bmp_test_and_clear_bit(u32 bit, struct bitmap __arena *bmp)
+bool bmp_test_and_clear_bit(u32 bit, struct arena_bitmap __arena *bmp)
{
u64 val = BIT_MASK(bit);
u32 idx = BIT_WORD(bit);
@@ -77,7 +77,7 @@ bool bmp_test_and_clear_bit(u32 bit, struct bitmap __arena *bmp)
}
__weak
-bool bmp_test_and_set_bit(u32 bit, struct bitmap __arena *bmp)
+bool bmp_test_and_set_bit(u32 bit, struct arena_bitmap __arena *bmp)
{
u64 val = BIT_MASK(bit);
u32 idx = BIT_WORD(bit);
@@ -101,7 +101,7 @@ bool bmp_test_and_set_bit(u32 bit, struct bitmap __arena *bmp)
}
__weak
-void bmp_clear_bit(u32 bit, struct bitmap __arena *bmp)
+void bmp_clear_bit(u32 bit, struct arena_bitmap __arena *bmp)
{
u64 val = BIT_MASK(bit);
u32 idx = BIT_WORD(bit);
@@ -116,7 +116,7 @@ void bmp_clear_bit(u32 bit, struct bitmap __arena *bmp)
}
__weak
-void bmp_set_bit(u32 bit, struct bitmap __arena *bmp)
+void bmp_set_bit(u32 bit, struct arena_bitmap __arena *bmp)
{
u64 val = BIT_MASK(bit);
u32 idx = BIT_WORD(bit);
@@ -131,7 +131,7 @@ void bmp_set_bit(u32 bit, struct bitmap __arena *bmp)
}
__weak
-void bmp_clear(size_t bits, struct bitmap __arena *bmp)
+void bmp_clear(size_t bits, struct arena_bitmap __arena *bmp)
{
size_t nwords = BITS_TO_LONG_LONGS(bits);
volatile u32 i;
@@ -148,7 +148,7 @@ static __always_inline u64 bmp_last_word_mask(size_t bits)
}
__weak
-void bmp_and(size_t bits, struct bitmap __arena *dst, struct bitmap __arena *src1, struct bitmap __arena *src2)
+void bmp_and(size_t bits, struct arena_bitmap __arena *dst, struct arena_bitmap __arena *src1, struct arena_bitmap __arena *src2)
{
size_t nwords = BITS_TO_LONG_LONGS(bits);
volatile u32 i;
@@ -161,7 +161,7 @@ void bmp_and(size_t bits, struct bitmap __arena *dst, struct bitmap __arena *src
}
__weak
-void bmp_or(size_t bits, struct bitmap __arena *dst, struct bitmap __arena *src1, struct bitmap __arena *src2)
+void bmp_or(size_t bits, struct arena_bitmap __arena *dst, struct arena_bitmap __arena *src1, struct arena_bitmap __arena *src2)
{
size_t nwords = BITS_TO_LONG_LONGS(bits);
volatile u32 i;
@@ -174,7 +174,7 @@ void bmp_or(size_t bits, struct bitmap __arena *dst, struct bitmap __arena *src1
}
__weak
-bool bmp_empty(size_t bits, struct bitmap __arena *bmp)
+bool bmp_empty(size_t bits, struct arena_bitmap __arena *bmp)
{
size_t nwords = BITS_TO_LONG_LONGS(bits);
volatile u32 i;
@@ -190,7 +190,7 @@ bool bmp_empty(size_t bits, struct bitmap __arena *bmp)
}
__weak
-void bmp_copy(size_t bits, struct bitmap __arena *dst, struct bitmap __arena *src)
+void bmp_copy(size_t bits, struct arena_bitmap __arena *dst, struct arena_bitmap __arena *src)
{
size_t nwords = BITS_TO_LONG_LONGS(bits);
volatile u32 i;
@@ -203,7 +203,7 @@ void bmp_copy(size_t bits, struct bitmap __arena *dst, struct bitmap __arena *sr
}
__weak
-bool bmp_subset(size_t bits, struct bitmap __arena *big, struct bitmap __arena *small)
+bool bmp_subset(size_t bits, struct arena_bitmap __arena *big, struct arena_bitmap __arena *small)
{
size_t nwords = BITS_TO_LONG_LONGS(bits);
volatile u32 i;
@@ -219,7 +219,7 @@ bool bmp_subset(size_t bits, struct bitmap __arena *big, struct bitmap __arena *
}
__weak
-bool bmp_intersects(size_t bits, struct bitmap __arena *arg1, struct bitmap __arena *arg2)
+bool bmp_intersects(size_t bits, struct arena_bitmap __arena *arg1, struct arena_bitmap __arena *arg2)
{
size_t nwords = BITS_TO_LONG_LONGS(bits);
volatile u32 i;
@@ -235,7 +235,7 @@ bool bmp_intersects(size_t bits, struct bitmap __arena *arg1, struct bitmap __ar
}
__weak
-void bmp_print(size_t bits, struct bitmap __arena *bmp)
+void bmp_print(size_t bits, struct arena_bitmap __arena *bmp)
{
size_t nwords = BITS_TO_LONG_LONGS(bits);
volatile u32 i;
--
2.53.0-Meta
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH bpf-next] selftests/bpf: Rename libarena struct bitmap to struct arena_bitmap
2026-07-07 22:01 [PATCH bpf-next] selftests/bpf: Rename libarena struct bitmap to struct arena_bitmap Yonghong Song
@ 2026-07-07 22:14 ` Emil Tsalapatis
2026-07-08 3:20 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Emil Tsalapatis @ 2026-07-07 22:14 UTC (permalink / raw)
To: Yonghong Song, bpf
Cc: Alexei Starovoitov, Andrii Nakryiko, Daniel Borkmann, kernel-team,
Martin KaFai Lau, Emil Tsalapatis
On Tue Jul 7, 2026 at 6:01 PM EDT, Yonghong Song wrote:
> When building bpf selftest with latest bpf-next, I got the following failure:
>
> In file included from /home/yhs/work/bpf-next/tools/testing/selftests/bpf/libarena/selftests/test_parallel_bitmap.bpf.c:8:
> /home/yhs/work/bpf-next/tools/testing/selftests/bpf/libarena/include/libarena/bitmap.h:11:8: error: redefinition of
> 'bitmap'
> 11 | struct bitmap {
> | ^
> /home/yhs/work/bpf-next/tools/testing/selftests/bpf/tools/include/vmlinux.h:51320:8: note: previous definition is here
> 51320 | struct bitmap {
> | ^
>
> The vmlinux.h struct bitmap comes from drivers/md/md-bitmap.c:
> struct bitmap {
> struct bitmap_counts { ... }
> ...
> }
>
> To fix the issue, I renamed libarena struct bitmap to arena_bitmap to avoid the conflict.
>
> Cc: Emil Tsalapatis <emil@etsalapatis.com>
> Signed-off-by: Yonghong Song <yonghong.song@linux.dev>
Reviewed-by: Emil Tsalapatis <emil@etsalapatis.com>
The arena_bitmap name is a bit longer but truncating it would be more
confusing.
> ---
> .../bpf/libarena/include/libarena/bitmap.h | 36 +++++++++---------
> .../bpf/libarena/selftests/test_bitmap.bpf.c | 24 ++++++------
> .../selftests/test_parallel_bitmap.bpf.c | 2 +-
> .../selftests/bpf/libarena/src/bitmap.bpf.c | 38 +++++++++----------
> 4 files changed, 50 insertions(+), 50 deletions(-)
>
> diff --git a/tools/testing/selftests/bpf/libarena/include/libarena/bitmap.h b/tools/testing/selftests/bpf/libarena/include/libarena/bitmap.h
> index cf6b63f5d9a4..e2431ea6fdd6 100644
> --- a/tools/testing/selftests/bpf/libarena/include/libarena/bitmap.h
> +++ b/tools/testing/selftests/bpf/libarena/include/libarena/bitmap.h
> @@ -8,27 +8,27 @@
> #define BIT_MASK(nr) (1ULL << ((nr) % BITS_PER_LONG_LONG))
> #define BIT_WORD(nr) ((nr) / BITS_PER_LONG_LONG)
>
> -struct bitmap {
> +struct arena_bitmap {
> u64 bits[0];
> };
>
> -struct bitmap __arena *bmp_alloc(size_t bits);
> -void bmp_free(struct bitmap __arena *bmp);
> +struct arena_bitmap __arena *bmp_alloc(size_t bits);
> +void bmp_free(struct arena_bitmap __arena *bmp);
>
> -void __bmp_set_bit(u32 bit, struct bitmap __arena *bmp);
> -void __bmp_clear_bit(u32 bit, struct bitmap __arena *bmp);
> -void bmp_set_bit(u32 bit, struct bitmap __arena *bmp);
> -void bmp_clear_bit(u32 bit, struct bitmap __arena *bmp);
> -bool bmp_test_bit(u32 bit, struct bitmap __arena *bmp);
> -bool bmp_test_and_clear_bit(u32 bit, struct bitmap __arena *bmp);
> -bool bmp_test_and_set_bit(u32 bit, struct bitmap __arena *bmp);
> +void __bmp_set_bit(u32 bit, struct arena_bitmap __arena *bmp);
> +void __bmp_clear_bit(u32 bit, struct arena_bitmap __arena *bmp);
> +void bmp_set_bit(u32 bit, struct arena_bitmap __arena *bmp);
> +void bmp_clear_bit(u32 bit, struct arena_bitmap __arena *bmp);
> +bool bmp_test_bit(u32 bit, struct arena_bitmap __arena *bmp);
> +bool bmp_test_and_clear_bit(u32 bit, struct arena_bitmap __arena *bmp);
> +bool bmp_test_and_set_bit(u32 bit, struct arena_bitmap __arena *bmp);
>
> -void bmp_clear(size_t bits, struct bitmap __arena *bmp);
> -void bmp_and(size_t bits, struct bitmap __arena *dst, struct bitmap __arena *src1, struct bitmap __arena *src2);
> -void bmp_or(size_t bits, struct bitmap __arena *dst, struct bitmap __arena *src1, struct bitmap __arena *src2);
> -bool bmp_empty(size_t bits, struct bitmap __arena *bmp);
> -void bmp_copy(size_t bits, struct bitmap __arena *dst, struct bitmap __arena *src);
> +void bmp_clear(size_t bits, struct arena_bitmap __arena *bmp);
> +void bmp_and(size_t bits, struct arena_bitmap __arena *dst, struct arena_bitmap __arena *src1, struct arena_bitmap __arena *src2);
> +void bmp_or(size_t bits, struct arena_bitmap __arena *dst, struct arena_bitmap __arena *src1, struct arena_bitmap __arena *src2);
> +bool bmp_empty(size_t bits, struct arena_bitmap __arena *bmp);
> +void bmp_copy(size_t bits, struct arena_bitmap __arena *dst, struct arena_bitmap __arena *src);
>
> -bool bmp_intersects(size_t bits, struct bitmap __arena *arg1, struct bitmap __arena *arg2);
> -bool bmp_subset(size_t bits, struct bitmap __arena *big, struct bitmap __arena *small);
> -void bmp_print(size_t bits, struct bitmap __arena *bmp);
> +bool bmp_intersects(size_t bits, struct arena_bitmap __arena *arg1, struct arena_bitmap __arena *arg2);
> +bool bmp_subset(size_t bits, struct arena_bitmap __arena *big, struct arena_bitmap __arena *small);
> +void bmp_print(size_t bits, struct arena_bitmap __arena *bmp);
> diff --git a/tools/testing/selftests/bpf/libarena/selftests/test_bitmap.bpf.c b/tools/testing/selftests/bpf/libarena/selftests/test_bitmap.bpf.c
> index e7d32f44d687..76319a529f02 100644
> --- a/tools/testing/selftests/bpf/libarena/selftests/test_bitmap.bpf.c
> +++ b/tools/testing/selftests/bpf/libarena/selftests/test_bitmap.bpf.c
> @@ -8,7 +8,7 @@
> #define MID_BIT (BITS_PER_LONG_LONG + 1)
> #define LAST_BIT (TEST_BITS - 1)
>
> -static void test_bmp_setall(struct bitmap __arena *bmp)
> +static void test_bmp_setall(struct arena_bitmap __arena *bmp)
> {
> volatile u32 i;
>
> @@ -19,7 +19,7 @@ static void test_bmp_setall(struct bitmap __arena *bmp)
> SEC("syscall")
> __weak int test_bitmap_alloc_free(void)
> {
> - struct bitmap __arena *bmp;
> + struct arena_bitmap __arena *bmp;
>
> bmp = bmp_alloc(TEST_BITS);
> if (!bmp)
> @@ -47,7 +47,7 @@ __weak int test_bitmap_alloc_free(void)
> SEC("syscall")
> __weak int test_bitmap_bit_ops(void)
> {
> - struct bitmap __arena *bmp;
> + struct arena_bitmap __arena *bmp;
>
> bmp = bmp_alloc(TEST_BITS);
> if (!bmp)
> @@ -97,7 +97,7 @@ __weak int test_bitmap_bit_ops(void)
> return -EINVAL;
> }
>
> -static bool test_bitmap_test_and_clear_single(struct bitmap __arena *bmp, size_t ind)
> +static bool test_bitmap_test_and_clear_single(struct arena_bitmap __arena *bmp, size_t ind)
> {
> if (bmp_test_and_clear_bit(ind, bmp))
> return false;
> @@ -116,7 +116,7 @@ static bool test_bitmap_test_and_clear_single(struct bitmap __arena *bmp, size_t
> return true;
> }
>
> -static bool test_bitmap_test_and_set_single(struct bitmap __arena *bmp, size_t ind)
> +static bool test_bitmap_test_and_set_single(struct arena_bitmap __arena *bmp, size_t ind)
> {
> if (bmp_test_and_set_bit(ind, bmp))
> return false;
> @@ -138,7 +138,7 @@ static bool test_bitmap_test_and_set_single(struct bitmap __arena *bmp, size_t i
> SEC("syscall")
> __weak int test_bitmap_test_and_clear_bit(void)
> {
> - struct bitmap __arena *bmp;
> + struct arena_bitmap __arena *bmp;
>
> bmp = bmp_alloc(TEST_BITS);
> if (!bmp)
> @@ -167,7 +167,7 @@ __weak int test_bitmap_test_and_clear_bit(void)
> SEC("syscall")
> __weak int test_bitmap_test_and_set_bit(void)
> {
> - struct bitmap __arena *bmp;
> + struct arena_bitmap __arena *bmp;
>
> bmp = bmp_alloc(TEST_BITS);
> if (!bmp)
> @@ -194,7 +194,7 @@ __weak int test_bitmap_test_and_set_bit(void)
> SEC("syscall")
> __weak int test_bitmap_and(void)
> {
> - struct bitmap __arena *src1 = NULL, *src2 = NULL, *dst = NULL;
> + struct arena_bitmap __arena *src1 = NULL, *src2 = NULL, *dst = NULL;
>
> src1 = bmp_alloc(TEST_BITS);
> src2 = bmp_alloc(TEST_BITS);
> @@ -240,7 +240,7 @@ __weak int test_bitmap_and(void)
> SEC("syscall")
> __weak int test_bitmap_or(void)
> {
> - struct bitmap __arena *src1 = NULL, *src2 = NULL, *dst = NULL;
> + struct arena_bitmap __arena *src1 = NULL, *src2 = NULL, *dst = NULL;
>
> src1 = bmp_alloc(TEST_BITS);
> src2 = bmp_alloc(TEST_BITS);
> @@ -285,7 +285,7 @@ __weak int test_bitmap_or(void)
> SEC("syscall")
> __weak int test_bitmap_subset(void)
> {
> - struct bitmap __arena *big = NULL, *small = NULL;
> + struct arena_bitmap __arena *big = NULL, *small = NULL;
>
> big = bmp_alloc(TEST_BITS);
> small = bmp_alloc(TEST_BITS);
> @@ -329,7 +329,7 @@ __weak int test_bitmap_subset(void)
> SEC("syscall")
> __weak int test_bitmap_intersects(void)
> {
> - struct bitmap __arena *arg1 = NULL, *arg2 = NULL;
> + struct arena_bitmap __arena *arg1 = NULL, *arg2 = NULL;
>
> arg1 = bmp_alloc(TEST_BITS);
> arg2 = bmp_alloc(TEST_BITS);
> @@ -362,7 +362,7 @@ __weak int test_bitmap_intersects(void)
> SEC("syscall")
> __weak int test_bitmap_copy(void)
> {
> - struct bitmap __arena *arg1 = NULL, *arg2 = NULL;
> + struct arena_bitmap __arena *arg1 = NULL, *arg2 = NULL;
>
> arg1 = bmp_alloc(TEST_BITS);
> arg2 = bmp_alloc(TEST_BITS);
> diff --git a/tools/testing/selftests/bpf/libarena/selftests/test_parallel_bitmap.bpf.c b/tools/testing/selftests/bpf/libarena/selftests/test_parallel_bitmap.bpf.c
> index eec2871e2b0d..ea1fac95b461 100644
> --- a/tools/testing/selftests/bpf/libarena/selftests/test_parallel_bitmap.bpf.c
> +++ b/tools/testing/selftests/bpf/libarena/selftests/test_parallel_bitmap.bpf.c
> @@ -12,7 +12,7 @@
> #define TEST_BITMAP_SYNC_SPINS BPF_MAX_LOOPS
> #define TEST_BITMAP_ITERS 10 * 1000 * 1000
>
> -static struct bitmap __arena *bitmap;
> +static struct arena_bitmap __arena *bitmap;
> static volatile u64 started;
> static volatile bool test_abort;
>
> diff --git a/tools/testing/selftests/bpf/libarena/src/bitmap.bpf.c b/tools/testing/selftests/bpf/libarena/src/bitmap.bpf.c
> index 80e814401fb9..5ff8e688ddc7 100644
> --- a/tools/testing/selftests/bpf/libarena/src/bitmap.bpf.c
> +++ b/tools/testing/selftests/bpf/libarena/src/bitmap.bpf.c
> @@ -10,16 +10,16 @@
> #include <libarena/bitmap.h>
>
> __weak
> -struct bitmap __arena *bmp_alloc(size_t bits)
> +struct arena_bitmap __arena *bmp_alloc(size_t bits)
> {
> - struct bitmap __arena *bmp;
> + struct arena_bitmap __arena *bmp;
> size_t size = BITS_TO_LONG_LONGS(bits) * sizeof(bmp->bits[0]);
>
> /* Assume long-aligned masks. */
> if (bits % BITS_PER_LONG_LONG)
> return NULL;
>
> - bmp = (struct bitmap __arena *)arena_malloc(size);
> + bmp = (struct arena_bitmap __arena *)arena_malloc(size);
> if (!bmp)
> return NULL;
>
> @@ -29,31 +29,31 @@ struct bitmap __arena *bmp_alloc(size_t bits)
> }
>
> __weak
> -void bmp_free(struct bitmap __arena *bmp)
> +void bmp_free(struct arena_bitmap __arena *bmp)
> {
> arena_free(bmp);
> }
>
> __weak
> -void __bmp_set_bit(u32 bit, struct bitmap __arena *bmp)
> +void __bmp_set_bit(u32 bit, struct arena_bitmap __arena *bmp)
> {
> bmp->bits[BIT_WORD(bit)] |= BIT_MASK(bit);
> }
>
> __weak
> -void __bmp_clear_bit(u32 bit, struct bitmap __arena *bmp)
> +void __bmp_clear_bit(u32 bit, struct arena_bitmap __arena *bmp)
> {
> bmp->bits[BIT_WORD(bit)] &= ~BIT_MASK(bit);
> }
>
> __weak
> -bool bmp_test_bit(u32 bit, struct bitmap __arena *bmp)
> +bool bmp_test_bit(u32 bit, struct arena_bitmap __arena *bmp)
> {
> return bmp->bits[BIT_WORD(bit)] & BIT_MASK(bit);
> }
>
> __weak
> -bool bmp_test_and_clear_bit(u32 bit, struct bitmap __arena *bmp)
> +bool bmp_test_and_clear_bit(u32 bit, struct arena_bitmap __arena *bmp)
> {
> u64 val = BIT_MASK(bit);
> u32 idx = BIT_WORD(bit);
> @@ -77,7 +77,7 @@ bool bmp_test_and_clear_bit(u32 bit, struct bitmap __arena *bmp)
> }
>
> __weak
> -bool bmp_test_and_set_bit(u32 bit, struct bitmap __arena *bmp)
> +bool bmp_test_and_set_bit(u32 bit, struct arena_bitmap __arena *bmp)
> {
> u64 val = BIT_MASK(bit);
> u32 idx = BIT_WORD(bit);
> @@ -101,7 +101,7 @@ bool bmp_test_and_set_bit(u32 bit, struct bitmap __arena *bmp)
> }
>
> __weak
> -void bmp_clear_bit(u32 bit, struct bitmap __arena *bmp)
> +void bmp_clear_bit(u32 bit, struct arena_bitmap __arena *bmp)
> {
> u64 val = BIT_MASK(bit);
> u32 idx = BIT_WORD(bit);
> @@ -116,7 +116,7 @@ void bmp_clear_bit(u32 bit, struct bitmap __arena *bmp)
> }
>
> __weak
> -void bmp_set_bit(u32 bit, struct bitmap __arena *bmp)
> +void bmp_set_bit(u32 bit, struct arena_bitmap __arena *bmp)
> {
> u64 val = BIT_MASK(bit);
> u32 idx = BIT_WORD(bit);
> @@ -131,7 +131,7 @@ void bmp_set_bit(u32 bit, struct bitmap __arena *bmp)
> }
>
> __weak
> -void bmp_clear(size_t bits, struct bitmap __arena *bmp)
> +void bmp_clear(size_t bits, struct arena_bitmap __arena *bmp)
> {
> size_t nwords = BITS_TO_LONG_LONGS(bits);
> volatile u32 i;
> @@ -148,7 +148,7 @@ static __always_inline u64 bmp_last_word_mask(size_t bits)
> }
>
> __weak
> -void bmp_and(size_t bits, struct bitmap __arena *dst, struct bitmap __arena *src1, struct bitmap __arena *src2)
> +void bmp_and(size_t bits, struct arena_bitmap __arena *dst, struct arena_bitmap __arena *src1, struct arena_bitmap __arena *src2)
> {
> size_t nwords = BITS_TO_LONG_LONGS(bits);
> volatile u32 i;
> @@ -161,7 +161,7 @@ void bmp_and(size_t bits, struct bitmap __arena *dst, struct bitmap __arena *src
> }
>
> __weak
> -void bmp_or(size_t bits, struct bitmap __arena *dst, struct bitmap __arena *src1, struct bitmap __arena *src2)
> +void bmp_or(size_t bits, struct arena_bitmap __arena *dst, struct arena_bitmap __arena *src1, struct arena_bitmap __arena *src2)
> {
> size_t nwords = BITS_TO_LONG_LONGS(bits);
> volatile u32 i;
> @@ -174,7 +174,7 @@ void bmp_or(size_t bits, struct bitmap __arena *dst, struct bitmap __arena *src1
> }
>
> __weak
> -bool bmp_empty(size_t bits, struct bitmap __arena *bmp)
> +bool bmp_empty(size_t bits, struct arena_bitmap __arena *bmp)
> {
> size_t nwords = BITS_TO_LONG_LONGS(bits);
> volatile u32 i;
> @@ -190,7 +190,7 @@ bool bmp_empty(size_t bits, struct bitmap __arena *bmp)
> }
>
> __weak
> -void bmp_copy(size_t bits, struct bitmap __arena *dst, struct bitmap __arena *src)
> +void bmp_copy(size_t bits, struct arena_bitmap __arena *dst, struct arena_bitmap __arena *src)
> {
> size_t nwords = BITS_TO_LONG_LONGS(bits);
> volatile u32 i;
> @@ -203,7 +203,7 @@ void bmp_copy(size_t bits, struct bitmap __arena *dst, struct bitmap __arena *sr
> }
>
> __weak
> -bool bmp_subset(size_t bits, struct bitmap __arena *big, struct bitmap __arena *small)
> +bool bmp_subset(size_t bits, struct arena_bitmap __arena *big, struct arena_bitmap __arena *small)
> {
> size_t nwords = BITS_TO_LONG_LONGS(bits);
> volatile u32 i;
> @@ -219,7 +219,7 @@ bool bmp_subset(size_t bits, struct bitmap __arena *big, struct bitmap __arena *
> }
>
> __weak
> -bool bmp_intersects(size_t bits, struct bitmap __arena *arg1, struct bitmap __arena *arg2)
> +bool bmp_intersects(size_t bits, struct arena_bitmap __arena *arg1, struct arena_bitmap __arena *arg2)
> {
> size_t nwords = BITS_TO_LONG_LONGS(bits);
> volatile u32 i;
> @@ -235,7 +235,7 @@ bool bmp_intersects(size_t bits, struct bitmap __arena *arg1, struct bitmap __ar
> }
>
> __weak
> -void bmp_print(size_t bits, struct bitmap __arena *bmp)
> +void bmp_print(size_t bits, struct arena_bitmap __arena *bmp)
> {
> size_t nwords = BITS_TO_LONG_LONGS(bits);
> volatile u32 i;
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH bpf-next] selftests/bpf: Rename libarena struct bitmap to struct arena_bitmap
2026-07-07 22:01 [PATCH bpf-next] selftests/bpf: Rename libarena struct bitmap to struct arena_bitmap Yonghong Song
2026-07-07 22:14 ` Emil Tsalapatis
@ 2026-07-08 3:20 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-07-08 3:20 UTC (permalink / raw)
To: Yonghong Song; +Cc: bpf, ast, andrii, daniel, kernel-team, martin.lau, emil
Hello:
This patch was applied to bpf/bpf-next.git (master)
by Kumar Kartikeya Dwivedi <memxor@gmail.com>:
On Tue, 7 Jul 2026 15:01:36 -0700 you wrote:
> When building bpf selftest with latest bpf-next, I got the following failure:
>
> In file included from /home/yhs/work/bpf-next/tools/testing/selftests/bpf/libarena/selftests/test_parallel_bitmap.bpf.c:8:
> /home/yhs/work/bpf-next/tools/testing/selftests/bpf/libarena/include/libarena/bitmap.h:11:8: error: redefinition of
> 'bitmap'
> 11 | struct bitmap {
> | ^
> /home/yhs/work/bpf-next/tools/testing/selftests/bpf/tools/include/vmlinux.h:51320:8: note: previous definition is here
> 51320 | struct bitmap {
> | ^
>
> [...]
Here is the summary with links:
- [bpf-next] selftests/bpf: Rename libarena struct bitmap to struct arena_bitmap
https://git.kernel.org/bpf/bpf-next/c/ee1bcf8271eb
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-07-08 3:20 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-07 22:01 [PATCH bpf-next] selftests/bpf: Rename libarena struct bitmap to struct arena_bitmap Yonghong Song
2026-07-07 22:14 ` Emil Tsalapatis
2026-07-08 3:20 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox