public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH bpf-next 0/5] selftests/bpf: Extend sockmap_redir to test no-redir SK_DROP/SK_PASS
@ 2025-09-05 11:11 Michal Luczaj
  2025-09-05 11:11 ` [PATCH bpf-next 1/5] selftests/bpf: sockmap_redir: Simplify try_recv() Michal Luczaj
                   ` (4 more replies)
  0 siblings, 5 replies; 16+ messages in thread
From: Michal Luczaj @ 2025-09-05 11:11 UTC (permalink / raw)
  To: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko,
	Martin KaFai Lau, Eduard Zingerman, Song Liu, Yonghong Song,
	John Fastabend, KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa,
	Mykola Lysenko, Shuah Khan
  Cc: bpf, linux-kselftest, linux-kernel, Michal Luczaj, Jiayuan Chen

sockmap_redir was introduced to comprehensively test the BPF redirection.
This series strives to increase the tested sockmap/sockhash code coverage;
adds support for skipping the actual redirect part, allowing to simply
SK_DROP or SK_PASS the packet.

BPF_MAP_TYPE_SOCKMAP
BPF_MAP_TYPE_SOCKHASH
	x
sk_msg-to-egress
sk_msg-to-ingress
sk_skb-to-egress
sk_skb-to-ingress
	x
AF_INET, SOCK_STREAM
AF_INET6, SOCK_STREAM
AF_INET, SOCK_DGRAM
AF_INET6, SOCK_DGRAM
AF_UNIX, SOCK_STREAM
AF_UNIX, SOCK_DGRAM
AF_VSOCK, SOCK_STREAM
AF_VSOCK, SOCK_SEQPACKET
	x
SK_REDIRECT
SK_DROP
SK_PASS

Patch 5 ("Support no-redirect SK_DROP/SK_PASS") implements the feature.
Patches 3 ("Rename functions") and 4 ("Let test specify skel's
redirect_type") make preparatory changes.

I also took the opportunity to clean up (Patch 1, "Simplify try_recv()")
and improve a bit (Patch 2, "Fix OOB handling").

$ cd tools/testing/selftests/bpf
$ make
$ sudo ./test_progs -t sockmap_redir
...
Summary: 1/720 PASSED, 0 SKIPPED, 0 FAILED

Signed-off-by: Michal Luczaj <mhal@rbox.co>
---
Michal Luczaj (5):
      selftests/bpf: sockmap_redir: Simplify try_recv()
      selftests/bpf: sockmap_redir: Fix OOB handling
      selftests/bpf: sockmap_redir: Rename functions
      selftests/bpf: sockmap_redir: Let test specify skel's redirect_type
      selftests/bpf: sockmap_redir: Support no-redirect SK_DROP/SK_PASS

 .../selftests/bpf/prog_tests/sockmap_redir.c       | 143 +++++++++++++++------
 1 file changed, 105 insertions(+), 38 deletions(-)
---
base-commit: e8a6a9d3e8cc539d281e77b9df2439f223ec8153
change-id: 20250523-redir-test-pass-drop-2f2a5edca6e1

Best regards,
-- 
Michal Luczaj <mhal@rbox.co>


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

end of thread, other threads:[~2025-09-19 11:29 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-05 11:11 [PATCH bpf-next 0/5] selftests/bpf: Extend sockmap_redir to test no-redir SK_DROP/SK_PASS Michal Luczaj
2025-09-05 11:11 ` [PATCH bpf-next 1/5] selftests/bpf: sockmap_redir: Simplify try_recv() Michal Luczaj
2025-09-09  9:51   ` Jakub Sitnicki
2025-09-09 10:15     ` Jakub Sitnicki
2025-09-09 21:25       ` Michal Luczaj
2025-09-10  9:43         ` Jakub Sitnicki
2025-09-05 11:11 ` [PATCH bpf-next 2/5] selftests/bpf: sockmap_redir: Fix OOB handling Michal Luczaj
2025-09-05 11:19   ` Michal Luczaj
2025-09-19 11:29     ` Jakub Sitnicki
2025-09-19  9:49   ` Jakub Sitnicki
2025-09-05 11:11 ` [PATCH bpf-next 3/5] selftests/bpf: sockmap_redir: Rename functions Michal Luczaj
2025-09-19  9:54   ` Jakub Sitnicki
2025-09-05 11:11 ` [PATCH bpf-next 4/5] selftests/bpf: sockmap_redir: Let test specify skel's redirect_type Michal Luczaj
2025-09-19  9:55   ` Jakub Sitnicki
2025-09-05 11:11 ` [PATCH bpf-next 5/5] selftests/bpf: sockmap_redir: Support no-redirect SK_DROP/SK_PASS Michal Luczaj
2025-09-19 11:28   ` Jakub Sitnicki

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