Linux Kernel Selftest development
 help / color / mirror / Atom feed
* [PATCH bpf-next 0/2] selftests: bpf: avoid duplicated UAPI headers
@ 2024-08-16 17:55 Matthieu Baerts (NGI0)
  2024-08-16 17:55 ` [PATCH bpf-next 1/2] selftests: bpf: use KHDR_INCLUDES for the " Matthieu Baerts (NGI0)
  2024-08-16 17:55 ` [PATCH bpf-next 2/2] selftests: bpf: remove duplicated UAPI if_xdp headers Matthieu Baerts (NGI0)
  0 siblings, 2 replies; 8+ messages in thread
From: Matthieu Baerts (NGI0) @ 2024-08-16 17:55 UTC (permalink / raw)
  To: mptcp, Andrii Nakryiko, Eduard Zingerman, Mykola Lysenko,
	Alexei Starovoitov, Daniel Borkmann, Martin KaFai Lau, Song Liu,
	Yonghong Song, John Fastabend, KP Singh, Stanislav Fomichev,
	Hao Luo, Jiri Olsa, Shuah Khan, David S. Miller, Jakub Kicinski,
	Jesper Dangaard Brouer
  Cc: bpf, linux-kselftest, linux-kernel, netdev,
	Matthieu Baerts (NGI0)

If a BPF selftest program requires (recent) UAPI headers [1], it is
currently needed to duplicate these header files into tools/include/uapi.
That's not a good solution, because it is a duplication that needs to be
kept up-to-date, while the required files are only a few directories
away.

A solution to avoid these duplicated files is to use the KHDR_INCLUDES
from the kselftest infrastructure. That is what is being done in the
first patch.

The second patch removes 'if_xdp.h', which is no longer needed, and was
causing a warning when building the libbpf required by the BPF
selftests. There could be more duplicated UAPI header files that could
be removed, but I didn't spend too much time checking which ones are not
used by anything else from the 'tools' directory.

Hopefully, these modifications should not cause any issues on the
different CIs, because it is using the recommended method for the kernel
selftests. If this causes issues on the CIs side, it should be easy to
fix by overriding the KHDR_INCLUDES variable, and it might be better to
do that, because it likely means the CI is not following the recommended
way to execute the kernel selftests. See patch 1/2 for more details
about that.

Link: https://lore.kernel.org/all/08f925cd-e267-4a6b-84b1-792515c4e199@kernel.org/T/#u [1]
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
Matthieu Baerts (NGI0) (2):
      selftests: bpf: use KHDR_INCLUDES for the UAPI headers
      selftests: bpf: remove duplicated UAPI if_xdp headers

 tools/include/uapi/linux/if_xdp.h                  | 173 ---------------------
 tools/lib/bpf/Makefile                             |   3 -
 tools/testing/selftests/bpf/Makefile               |   2 +-
 .../selftests/bpf/prog_tests/assign_reuse.c        |   2 +-
 tools/testing/selftests/bpf/prog_tests/tc_links.c  |   4 +-
 tools/testing/selftests/bpf/prog_tests/tc_netkit.c |   2 +-
 tools/testing/selftests/bpf/prog_tests/tc_opts.c   |   2 +-
 .../selftests/bpf/prog_tests/user_ringbuf.c        |   2 +-
 .../testing/selftests/bpf/prog_tests/xdp_bonding.c |   2 +-
 .../selftests/bpf/prog_tests/xdp_cpumap_attach.c   |   2 +-
 .../selftests/bpf/prog_tests/xdp_devmap_attach.c   |   2 +-
 .../selftests/bpf/prog_tests/xdp_do_redirect.c     |   2 +-
 tools/testing/selftests/bpf/prog_tests/xdp_link.c  |   2 +-
 tools/testing/selftests/bpf/xdp_features.c         |   4 +-
 14 files changed, 14 insertions(+), 190 deletions(-)
---
base-commit: fdf1c728fac541891ef1aa773bfd42728626769c
change-id: 20240816-ups-bpf-next-selftests-use-khdr-28f935c8848a

Best regards,
-- 
Matthieu Baerts (NGI0) <matttbe@kernel.org>


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

end of thread, other threads:[~2024-08-25 19:39 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-16 17:55 [PATCH bpf-next 0/2] selftests: bpf: avoid duplicated UAPI headers Matthieu Baerts (NGI0)
2024-08-16 17:55 ` [PATCH bpf-next 1/2] selftests: bpf: use KHDR_INCLUDES for the " Matthieu Baerts (NGI0)
2024-08-17  7:22   ` Alexei Starovoitov
2024-08-17 14:50     ` Matthieu Baerts
2024-08-23 22:28       ` Alexei Starovoitov
2024-08-24 10:37         ` Matthieu Baerts
2024-08-25 19:39           ` Alexei Starovoitov
2024-08-16 17:55 ` [PATCH bpf-next 2/2] selftests: bpf: remove duplicated UAPI if_xdp headers Matthieu Baerts (NGI0)

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