From: David Vernet <void@manifault.com>
To: Jiri Olsa <jolsa@kernel.org>
Cc: Alexei Starovoitov <ast@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
Andrii Nakryiko <andrii@kernel.org>,
bpf@vger.kernel.org, Martin KaFai Lau <kafai@fb.com>,
Song Liu <songliubraving@fb.com>, Yonghong Song <yhs@fb.com>,
John Fastabend <john.fastabend@gmail.com>,
KP Singh <kpsingh@chromium.org>,
Stanislav Fomichev <sdf@google.com>, Hao Luo <haoluo@google.com>,
Kumar Kartikeya Dwivedi <memxor@gmail.com>
Subject: Re: [PATCHv4 bpf-next 10/10] bpf: Move kernel test kfuncs to bpf_testmod
Date: Mon, 15 May 2023 21:22:30 -0500 [thread overview]
Message-ID: <20230516022230.GA3834@maniforge> (raw)
In-Reply-To: <20230515133756.1658301-11-jolsa@kernel.org>
On Mon, May 15, 2023 at 03:37:56PM +0200, Jiri Olsa wrote:
> Moving kernel test kfuncs into bpf_testmod kernel module, and adding
> necessary init calls and BTF IDs records.
>
> We need to keep following structs in kernel:
> struct prog_test_ref_kfunc
> struct prog_test_member (embedded in prog_test_ref_kfunc)
>
> The reason is because they need to be marked as rcu safe (check test
> prog mark_ref_as_untrusted_or_null) and such objects are being required
> to be defined only in kernel at the moment (see rcu_safe_kptr check
> in kernel).
>
> We need to keep also dtor functions for both objects in kernel:
> bpf_kfunc_call_test_release
> bpf_kfunc_call_memb_release
>
> We also keep the copy of these struct in bpf_testmod_kfunc.h, because
> other test functions use them. This is unfortunate, but this is just
> temporary solution until we are able to these structs them to bpf_testmod
> completely.
>
> As suggested by David adding bpf_testmod.ko make dependency for
> bpf programs, so they are rebuilt if we change the bpf_testmod.ko
> module.
>
> Also adding missing __bpf_kfunc to bpf_kfunc_call_test4 functions.
>
> Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Acked-by: David Vernet <void@manifault.com>
next prev parent reply other threads:[~2023-05-16 2:22 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-15 13:37 [PATCHv4 bpf-next 00/10] bpf: Move kernel test kfuncs into bpf_testmod Jiri Olsa
2023-05-15 13:37 ` [PATCHv4 bpf-next 01/10] libbpf: Store zero fd to fd_array for loader kfunc relocation Jiri Olsa
2023-05-15 13:37 ` [PATCHv4 bpf-next 02/10] selftests/bpf: Move kfunc exports to bpf_testmod/bpf_testmod_kfunc.h Jiri Olsa
2023-05-15 13:37 ` [PATCHv4 bpf-next 03/10] selftests/bpf: Move test_progs helpers to testing_helpers object Jiri Olsa
2023-05-15 13:37 ` [PATCHv4 bpf-next 04/10] selftests/bpf: Use only stdout in un/load_bpf_testmod functions Jiri Olsa
2023-05-15 13:37 ` [PATCHv4 bpf-next 05/10] selftests/bpf: Do not unload bpf_testmod in load_bpf_testmod Jiri Olsa
2023-05-15 13:37 ` [PATCHv4 bpf-next 06/10] selftests/bpf: Use un/load_bpf_testmod functions in tests Jiri Olsa
2023-05-15 13:37 ` [PATCHv4 bpf-next 07/10] selftests/bpf: Load bpf_testmod for verifier test Jiri Olsa
2023-05-15 13:37 ` [PATCHv4 bpf-next 08/10] selftests/bpf: Allow to use kfunc from testmod.ko in test_verifier Jiri Olsa
2023-05-16 21:45 ` Andrii Nakryiko
2023-05-17 5:17 ` Alexei Starovoitov
2023-05-17 14:27 ` Eduard Zingerman
2023-05-17 16:51 ` Andrii Nakryiko
2023-05-15 13:37 ` [PATCHv4 bpf-next 09/10] selftests/bpf: Remove extern from kfuncs declarations Jiri Olsa
2023-05-15 13:37 ` [PATCHv4 bpf-next 10/10] bpf: Move kernel test kfuncs to bpf_testmod Jiri Olsa
2023-05-16 2:22 ` David Vernet [this message]
2023-05-17 5:20 ` [PATCHv4 bpf-next 00/10] bpf: Move kernel test kfuncs into bpf_testmod patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230516022230.GA3834@maniforge \
--to=void@manifault.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=haoluo@google.com \
--cc=john.fastabend@gmail.com \
--cc=jolsa@kernel.org \
--cc=kafai@fb.com \
--cc=kpsingh@chromium.org \
--cc=memxor@gmail.com \
--cc=sdf@google.com \
--cc=songliubraving@fb.com \
--cc=yhs@fb.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox