public inbox for bpf@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH bpf-next 0/5] bpf: Move kernel test kfuncs into bpf_testmod
@ 2023-01-24 14:36 Jiri Olsa
  2023-01-24 14:36 ` [PATCH bpf-next 1/5] selftests/bpf: Move kfunc exports to bpf_testmod/bpf_testmod_kfunc.h Jiri Olsa
                   ` (5 more replies)
  0 siblings, 6 replies; 11+ messages in thread
From: Jiri Olsa @ 2023-01-24 14:36 UTC (permalink / raw)
  To: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko
  Cc: bpf, Martin KaFai Lau, Song Liu, Yonghong Song, John Fastabend,
	KP Singh, Stanislav Fomichev, Hao Luo

hi,
I noticed several times in discussions that we should move test kfuncs
into kernel module, now perhaps even more pressing with all the kfunc
effort. This patchset moves all the test kfuncs into bpf_testmod.

I added bpf_testmod/bpf_testmod_kfunc.h header that is shared between
bpf_testmod kernel module and BPF programs, which brings some difficulties
with __ksym define. But I'm not sure having separate headers for BPF
programs and for kernel module would be better.

This patchset also needs:
  74bc3a5acc82 bpf: Add missing btf_put to register_btf_id_dtor_kfuncs
which is only in bpf/master now.

thanks,
jirka

---
Jiri Olsa (5):
      selftests/bpf: Move kfunc exports to bpf_testmod/bpf_testmod_kfunc.h
      selftests/bpf: Move test_progs helpers to testing_helpers object
      selftests/bpf: Load bpf_testmod for verifier test
      selftests/bpf: Allow to use kfunc from testmod.ko in test_verifier
      bpf: Move kernel test kfuncs to bpf_testmod

 net/bpf/test_run.c                                          | 253 +------------------------------------------------------------------------------------------
 tools/testing/selftests/bpf/bpf_testmod/bpf_testmod.c       | 191 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 tools/testing/selftests/bpf/bpf_testmod/bpf_testmod_kfunc.h |  89 ++++++++++++++++++++++++++++++++
 tools/testing/selftests/bpf/progs/cb_refs.c                 |   1 +
 tools/testing/selftests/bpf/progs/jit_probe_mem.c           |   3 +-
 tools/testing/selftests/bpf/progs/kfunc_call_destructive.c  |   3 +-
 tools/testing/selftests/bpf/progs/kfunc_call_fail.c         |   9 +---
 tools/testing/selftests/bpf/progs/kfunc_call_race.c         |   3 +-
 tools/testing/selftests/bpf/progs/kfunc_call_test.c         |  15 +-----
 tools/testing/selftests/bpf/progs/kfunc_call_test_subprog.c |  17 +++++--
 tools/testing/selftests/bpf/progs/map_kptr.c                |   1 +
 tools/testing/selftests/bpf/progs/map_kptr_fail.c           |   1 +
 tools/testing/selftests/bpf/test_progs.c                    |  67 +-----------------------
 tools/testing/selftests/bpf/test_verifier.c                 | 165 +++++++++++++++++++++++++++++++++++++++++++++++++++--------
 tools/testing/selftests/bpf/testing_helpers.c               |  63 +++++++++++++++++++++++
 tools/testing/selftests/bpf/testing_helpers.h               |  10 ++++
 16 files changed, 520 insertions(+), 371 deletions(-)
 create mode 100644 tools/testing/selftests/bpf/bpf_testmod/bpf_testmod_kfunc.h

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

end of thread, other threads:[~2023-01-26 14:45 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-24 14:36 [PATCH bpf-next 0/5] bpf: Move kernel test kfuncs into bpf_testmod Jiri Olsa
2023-01-24 14:36 ` [PATCH bpf-next 1/5] selftests/bpf: Move kfunc exports to bpf_testmod/bpf_testmod_kfunc.h Jiri Olsa
2023-01-25 10:31   ` Artem Savkov
2023-01-25 21:33     ` Jiri Olsa
2023-01-24 14:36 ` [PATCH bpf-next 2/5] selftests/bpf: Move test_progs helpers to testing_helpers object Jiri Olsa
2023-01-24 14:36 ` [PATCH bpf-next 3/5] selftests/bpf: Load bpf_testmod for verifier test Jiri Olsa
2023-01-24 14:36 ` [PATCH bpf-next 4/5] selftests/bpf: Allow to use kfunc from testmod.ko in test_verifier Jiri Olsa
2023-01-24 14:36 ` [PATCH bpf-next 5/5] bpf: Move kernel test kfuncs to bpf_testmod Jiri Olsa
2023-01-25  3:49 ` [PATCH bpf-next 0/5] bpf: Move kernel test kfuncs into bpf_testmod Alexei Starovoitov
2023-01-25  7:41   ` Jiri Olsa
2023-01-26 14:45     ` Jiri Olsa

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox