Re: [PATCH bpf-next v5 5/9] selftests/bpf: Add basic libarena scaffolding

Song Liu
2026-04-10T18:39:48Z

On Fri, Apr 10, 2026 at 9:31 AM Emil Tsalapatis <emil@etsalapatis.com> wrote:
[...]
> diff --git a/tools/testing/selftests/bpf/libarena/include/common.h b/tools/testing/selftests/bpf/libarena/include/common.h
> new file mode 100644
> index 000000000000..5acf9b994943
> --- /dev/null
> +++ b/tools/testing/selftests/bpf/libarena/include/common.h
> @@ -0,0 +1,67 @@
> +// SPDX-License-Identifier: LGPL-2.1 OR BSD-2-Clause
> +/* Copyright (c) 2026 Meta Platforms, Inc. and affiliates. */
> +#pragma once
> +
> +#ifdef __BPF__
> +
> +#include <vmlinux.h>
> +
> +#include "bpf_experimental.h"

bpf_experimental.h is not needed here.

> +#include "bpf_arena_common.h"
> +#include "bpf_arena_spin_lock.h"

These two headers are indeed needed. However, what's the plan
with them? They are not part of libarena at the moment. How should
we include them in the future?

Thanks,
Song

> +#include <asm-generic/errno.h>
> +
> +#ifndef __BPF_FEATURE_ADDR_SPACE_CAST
> +#error "Arena allocators require bpf_addr_space_cast feature"
> +#endif
> + …