bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH bpf-next 0/2] bpf: Add kfuncs for read-only string operations
@ 2024-09-26  6:18 Viktor Malik
  2024-09-26  6:18 ` [PATCH bpf-next 1/2] " Viktor Malik
  2024-09-26  6:18 ` [PATCH bpf-next 2/2] selftests/bpf: Add tests for string kfuncs Viktor Malik
  0 siblings, 2 replies; 18+ messages in thread
From: Viktor Malik @ 2024-09-26  6:18 UTC (permalink / raw)
  To: bpf
  Cc: 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,
	Viktor Malik

Kernel contains highly optimised implementation of traditional string
operations. Expose them as kfuncs to allow BPF programs leverage the
kernel implementation instead of needing to reimplement the operations.

These will be very helpful to bpftrace as it now needs to implement all
the string operations in LLVM IR.

Viktor Malik (2):
  bpf: Add kfuncs for read-only string operations
  selftests/bpf: Add tests for string kfuncs

 kernel/bpf/helpers.c                          |  66 ++++++
 .../selftests/bpf/prog_tests/string_kfuncs.c  |  37 +++
 .../selftests/bpf/progs/test_string_kfuncs.c  | 215 ++++++++++++++++++
 3 files changed, 318 insertions(+)
 create mode 100644 tools/testing/selftests/bpf/prog_tests/string_kfuncs.c
 create mode 100644 tools/testing/selftests/bpf/progs/test_string_kfuncs.c

-- 
2.46.0


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

end of thread, other threads:[~2025-02-27 17:18 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-26  6:18 [PATCH bpf-next 0/2] bpf: Add kfuncs for read-only string operations Viktor Malik
2024-09-26  6:18 ` [PATCH bpf-next 1/2] " Viktor Malik
2024-09-30 22:00   ` Andrii Nakryiko
2024-10-01 11:26     ` Eduard Zingerman
2024-10-01 14:48       ` Alexei Starovoitov
2024-10-01 17:03         ` Andrii Nakryiko
2024-10-01 17:34           ` Alexei Starovoitov
2024-10-01 17:40             ` Andrii Nakryiko
2024-10-02  6:12               ` Viktor Malik
2024-10-02 16:55                 ` Alexei Starovoitov
2024-10-03  4:51                   ` Viktor Malik
2024-10-03 17:02                     ` Alexei Starovoitov
2024-10-03 19:37                       ` Viktor Malik
2024-10-10  2:03                         ` Alexei Starovoitov
2025-02-27 16:24                           ` Alexei Starovoitov
2025-02-27 16:36                             ` Viktor Malik
2025-02-27 17:17                               ` Alexei Starovoitov
2024-09-26  6:18 ` [PATCH bpf-next 2/2] selftests/bpf: Add tests for string kfuncs Viktor Malik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).