public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH bpf-next 0/2] Fixes for kfunc prototype generation
@ 2024-06-13 16:19 Daniel Xu
  2024-06-13 16:19 ` [PATCH bpf-next 1/2] bpf: Fix bpf_dynptr documentation comments Daniel Xu
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Daniel Xu @ 2024-06-13 16:19 UTC (permalink / raw)
  To: ast, bpf, linux-kselftest, dxu, llvm, linux-kernel; +Cc: sfr

This patchset fixes new warnings and errors that kfunc prototype
generation caused.

Daniel Xu (2):
  bpf: Fix bpf_dynptr documentation comments
  bpf: selftests: Do not use generated kfunc prototypes for arena progs

 kernel/bpf/helpers.c                                     | 4 ++--
 tools/testing/selftests/bpf/progs/arena_htab.c           | 1 +
 tools/testing/selftests/bpf/progs/arena_list.c           | 1 +
 tools/testing/selftests/bpf/progs/verifier_arena.c       | 1 +
 tools/testing/selftests/bpf/progs/verifier_arena_large.c | 1 +
 5 files changed, 6 insertions(+), 2 deletions(-)

-- 
2.44.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH bpf-next 1/2] bpf: Fix bpf_dynptr documentation comments
  2024-06-13 16:19 [PATCH bpf-next 0/2] Fixes for kfunc prototype generation Daniel Xu
@ 2024-06-13 16:19 ` Daniel Xu
  2024-06-13 16:19 ` [PATCH bpf-next 2/2] bpf: selftests: Do not use generated kfunc prototypes for arena progs Daniel Xu
  2024-06-13 18:20 ` [PATCH bpf-next 0/2] Fixes for kfunc prototype generation patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: Daniel Xu @ 2024-06-13 16:19 UTC (permalink / raw)
  To: daniel, andrii, dxu, ast
  Cc: martin.lau, eddyz87, song, yonghong.song, john.fastabend, kpsingh,
	sdf, haoluo, jolsa, bpf, linux-kernel, sfr

The function argument names were changed but the doc comment was not.
Fix htmldocs build warning by updating doc comments.

Fixes: cce4c40b9606 ("bpf: treewide: Align kfunc signatures to prog point-of-view")
Signed-off-by: Daniel Xu <dxu@dxuuu.xyz>
---
 kernel/bpf/helpers.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/bpf/helpers.c b/kernel/bpf/helpers.c
index 3ac521c48bba..229396172026 100644
--- a/kernel/bpf/helpers.c
+++ b/kernel/bpf/helpers.c
@@ -2433,7 +2433,7 @@ __bpf_kfunc struct task_struct *bpf_task_from_pid(s32 pid)
 
 /**
  * bpf_dynptr_slice() - Obtain a read-only pointer to the dynptr data.
- * @ptr: The dynptr whose data slice to retrieve
+ * @p: The dynptr whose data slice to retrieve
  * @offset: Offset into the dynptr
  * @buffer__opt: User-provided buffer to copy contents into.  May be NULL
  * @buffer__szk: Size (in bytes) of the buffer if present. This is the
@@ -2504,7 +2504,7 @@ __bpf_kfunc void *bpf_dynptr_slice(const struct bpf_dynptr *p, u32 offset,
 
 /**
  * bpf_dynptr_slice_rdwr() - Obtain a writable pointer to the dynptr data.
- * @ptr: The dynptr whose data slice to retrieve
+ * @p: The dynptr whose data slice to retrieve
  * @offset: Offset into the dynptr
  * @buffer__opt: User-provided buffer to copy contents into. May be NULL
  * @buffer__szk: Size (in bytes) of the buffer if present. This is the
-- 
2.44.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH bpf-next 2/2] bpf: selftests: Do not use generated kfunc prototypes for arena progs
  2024-06-13 16:19 [PATCH bpf-next 0/2] Fixes for kfunc prototype generation Daniel Xu
  2024-06-13 16:19 ` [PATCH bpf-next 1/2] bpf: Fix bpf_dynptr documentation comments Daniel Xu
@ 2024-06-13 16:19 ` Daniel Xu
  2024-06-13 18:20 ` [PATCH bpf-next 0/2] Fixes for kfunc prototype generation patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: Daniel Xu @ 2024-06-13 16:19 UTC (permalink / raw)
  To: daniel, andrii, shuah, ast, nathan, dxu, eddyz87
  Cc: martin.lau, song, yonghong.song, john.fastabend, kpsingh, sdf,
	haoluo, jolsa, mykolal, ndesaulniers, morbo, justinstitt, bpf,
	linux-kselftest, linux-kernel, llvm, sfr

When selftests are built with a new enough clang, the arena selftests
opt-in to use LLVM address_space attribute annotations for arena
pointers.

These annotations are not emitted by kfunc prototype generation. This
causes compilation errors when clang sees conflicting prototypes.

Fix by opting arena selftests out of using generated kfunc prototypes.

Fixes: 770abbb5a25a ("bpftool: Support dumping kfunc prototypes from BTF")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/r/202406131810.c1B8hTm8-lkp@intel.com/
Signed-off-by: Daniel Xu <dxu@dxuuu.xyz>
---
 tools/testing/selftests/bpf/progs/arena_htab.c           | 1 +
 tools/testing/selftests/bpf/progs/arena_list.c           | 1 +
 tools/testing/selftests/bpf/progs/verifier_arena.c       | 1 +
 tools/testing/selftests/bpf/progs/verifier_arena_large.c | 1 +
 4 files changed, 4 insertions(+)

diff --git a/tools/testing/selftests/bpf/progs/arena_htab.c b/tools/testing/selftests/bpf/progs/arena_htab.c
index 1e6ac187a6a0..cf938cf8c11e 100644
--- a/tools/testing/selftests/bpf/progs/arena_htab.c
+++ b/tools/testing/selftests/bpf/progs/arena_htab.c
@@ -1,5 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0
 /* Copyright (c) 2024 Meta Platforms, Inc. and affiliates. */
+#define BPF_NO_KFUNC_PROTOTYPES
 #include <vmlinux.h>
 #include <bpf/bpf_helpers.h>
 #include <bpf/bpf_tracing.h>
diff --git a/tools/testing/selftests/bpf/progs/arena_list.c b/tools/testing/selftests/bpf/progs/arena_list.c
index 93bd0600eba0..3a2ddcacbea6 100644
--- a/tools/testing/selftests/bpf/progs/arena_list.c
+++ b/tools/testing/selftests/bpf/progs/arena_list.c
@@ -1,5 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0
 /* Copyright (c) 2024 Meta Platforms, Inc. and affiliates. */
+#define BPF_NO_KFUNC_PROTOTYPES
 #include <vmlinux.h>
 #include <bpf/bpf_helpers.h>
 #include <bpf/bpf_tracing.h>
diff --git a/tools/testing/selftests/bpf/progs/verifier_arena.c b/tools/testing/selftests/bpf/progs/verifier_arena.c
index 93144ae6df74..67509c5d3982 100644
--- a/tools/testing/selftests/bpf/progs/verifier_arena.c
+++ b/tools/testing/selftests/bpf/progs/verifier_arena.c
@@ -1,6 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0
 /* Copyright (c) 2024 Meta Platforms, Inc. and affiliates. */
 
+#define BPF_NO_KFUNC_PROTOTYPES
 #include <vmlinux.h>
 #include <bpf/bpf_helpers.h>
 #include <bpf/bpf_tracing.h>
diff --git a/tools/testing/selftests/bpf/progs/verifier_arena_large.c b/tools/testing/selftests/bpf/progs/verifier_arena_large.c
index ef66ea460264..6065f862d964 100644
--- a/tools/testing/selftests/bpf/progs/verifier_arena_large.c
+++ b/tools/testing/selftests/bpf/progs/verifier_arena_large.c
@@ -1,6 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0
 /* Copyright (c) 2024 Meta Platforms, Inc. and affiliates. */
 
+#define BPF_NO_KFUNC_PROTOTYPES
 #include <vmlinux.h>
 #include <bpf/bpf_helpers.h>
 #include <bpf/bpf_tracing.h>
-- 
2.44.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH bpf-next 0/2] Fixes for kfunc prototype generation
  2024-06-13 16:19 [PATCH bpf-next 0/2] Fixes for kfunc prototype generation Daniel Xu
  2024-06-13 16:19 ` [PATCH bpf-next 1/2] bpf: Fix bpf_dynptr documentation comments Daniel Xu
  2024-06-13 16:19 ` [PATCH bpf-next 2/2] bpf: selftests: Do not use generated kfunc prototypes for arena progs Daniel Xu
@ 2024-06-13 18:20 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-06-13 18:20 UTC (permalink / raw)
  To: Daniel Xu
  Cc: ast, bpf, linux-kselftest, llvm, linux-kernel, ,
	""@meta.com

Hello:

This series was applied to bpf/bpf-next.git (master)
by Alexei Starovoitov <ast@kernel.org>:

On Thu, 13 Jun 2024 10:19:24 -0600 you wrote:
> This patchset fixes new warnings and errors that kfunc prototype
> generation caused.
> 
> Daniel Xu (2):
>   bpf: Fix bpf_dynptr documentation comments
>   bpf: selftests: Do not use generated kfunc prototypes for arena progs
> 
> [...]

Here is the summary with links:
  - [bpf-next,1/2] bpf: Fix bpf_dynptr documentation comments
    https://git.kernel.org/bpf/bpf-next/c/78746f93e903
  - [bpf-next,2/2] bpf: selftests: Do not use generated kfunc prototypes for arena progs
    https://git.kernel.org/bpf/bpf-next/c/6a8260147745

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] 4+ messages in thread

end of thread, other threads:[~2024-06-13 18:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-13 16:19 [PATCH bpf-next 0/2] Fixes for kfunc prototype generation Daniel Xu
2024-06-13 16:19 ` [PATCH bpf-next 1/2] bpf: Fix bpf_dynptr documentation comments Daniel Xu
2024-06-13 16:19 ` [PATCH bpf-next 2/2] bpf: selftests: Do not use generated kfunc prototypes for arena progs Daniel Xu
2024-06-13 18:20 ` [PATCH bpf-next 0/2] Fixes for kfunc prototype generation 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