Linux Kernel Selftest development
 help / color / mirror / Atom feed
* [PATCH bpf-next 0/2] selftests: bpf: Migrate test_xdp_meta.sh to test_progs
@ 2024-12-06  8:12 Bastien Curutchet
  2024-12-06  8:12 ` [PATCH bpf-next 1/2] selftests/bpf: test_xdp_meta: Rename BPF sections Bastien Curutchet
  2024-12-06  8:12 ` [PATCH bpf-next 2/2] selftests/bpf: Migrate test_xdp_meta.sh into xdp_context_test_run.c Bastien Curutchet
  0 siblings, 2 replies; 4+ messages in thread
From: Bastien Curutchet @ 2024-12-06  8:12 UTC (permalink / raw)
  To: Alexei Starovoitov, Daniel Borkmann, David S. Miller,
	Jakub Kicinski, Jesper Dangaard Brouer, John Fastabend,
	Andrii Nakryiko, Martin KaFai Lau, Eduard Zingerman, Song Liu,
	Yonghong Song, KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa,
	Mykola Lysenko, Shuah Khan
  Cc: Alexis Lothore, Thomas Petazzoni, netdev, bpf, linux-kselftest,
	linux-kernel, Bastien Curutchet

Hi all,

This patch series continues the work to migrate the script tests into
prog_tests.

test_xdp_meta.sh uses the BPF programs defined in progs/test_xdp_meta.c
to do a simple XDP/TC functional test that checks the metadata
allocation performed by the bpf_xdp_adjust_meta() helper.

This is already partly covered by two tests under prog_tests/:
- xdp_context_test_run.c uses bpf_prog_test_run_opts() to verify the
validity of the xdp_md context after a call to bpf_xdp_adjust_meta()
- xdp_metadata.c ensures that these meta-data can be exchanged through
an AF_XDP socket.

However test_xdp_meta.sh also verifies that the meta-data initialized
in the struct xdp_md is forwarded to the struct __sk_buff used by BPF
programs at 'TC level'. To cover this, I add a test case in
xdp_context_test_run.c that uses the same BPF programs from
progs/test_xdp_meta.c.

---
Bastien Curutchet (2):
      selftests/bpf: test_xdp_meta: Rename BPF sections
      selftests/bpf: Migrate test_xdp_meta.sh into xdp_context_test_run.c

 tools/testing/selftests/bpf/Makefile               |  1 -
 .../bpf/prog_tests/xdp_context_test_run.c          | 86 ++++++++++++++++++++++
 tools/testing/selftests/bpf/progs/test_xdp_meta.c  |  4 +-
 tools/testing/selftests/bpf/test_xdp_meta.sh       | 58 ---------------
 4 files changed, 88 insertions(+), 61 deletions(-)
---
base-commit: 6849a3de3507a490fb0788c9bafbb2f29a904f05
change-id: 20241203-xdp_meta-868307cd0e03

Best regards,
-- 
Bastien Curutchet (eBPF Foundation) <bastien.curutchet@bootlin.com>


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

end of thread, other threads:[~2024-12-07  1:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-06  8:12 [PATCH bpf-next 0/2] selftests: bpf: Migrate test_xdp_meta.sh to test_progs Bastien Curutchet
2024-12-06  8:12 ` [PATCH bpf-next 1/2] selftests/bpf: test_xdp_meta: Rename BPF sections Bastien Curutchet
2024-12-06  8:12 ` [PATCH bpf-next 2/2] selftests/bpf: Migrate test_xdp_meta.sh into xdp_context_test_run.c Bastien Curutchet
2024-12-07  1:19   ` Martin KaFai Lau

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