Skip to contentSkip to conversation

Add kfuncs bpf_strcasestr and bpf_strncasestr

PATCH Applied Rong Tao 2 participants 2 messages Oct 9, 2025 – Oct 10, 2025

Subsystems (2)
lore
Share & tools
lore

Rong Tao

author
#0 lore raw

v4 cover Add kfuncs bpf_strcasestr and bpf_strncasestr

From: Rong Tao <[email protected]>

Add kfuncs bpf_strcasestr and bpf_strncasestr, which are extensions of bpf_strstr and bpf_strnstr, suitable for more scenarios.

Rong Tao (2):
bpf: add bpf_strcasestr,bpf_strncasestr kfuncs selftests/bpf: Test bpf_strcasestr,bpf_strncasestr kfuncs

 kernel/bpf/helpers.c                          | 98 +++++++++++++++----
 .../selftests/bpf/prog_tests/string_kfuncs.c  |  2 +
 .../bpf/progs/string_kfuncs_failure1.c        | 12 +++
 .../bpf/progs/string_kfuncs_failure2.c        |  2 +
 .../bpf/progs/string_kfuncs_success.c         | 10 ++
 5 files changed, 103 insertions(+), 21 deletions(-)

---
v4: Fix wrong comment.
v3: keep __bpf_strnstr() static and compress some tests.

    https://lore.kernel.org/lkml/[email protected]/
v2: remove extra __bpf_kfunc and fix comment of bpf_strncasestr().
    https://lore.kernel.org/all/[email protected]/

v1: https://lore.kernel.org/all/[email protected]/

Signature · 1 line
2.51.0
#1 lore raw
This series was applied to bpf/bpf-next.git (master) by Alexei Starovoitov <[email protected]>:

Hello:

This series was applied to bpf/bpf-next.git (master) by Alexei Starovoitov <[email protected]>:

Quoted 10 lines · On Thu, 9 Oct 2025 09:20:14 +0800 you wrote:

From: Rong Tao <[email protected]>

Add kfuncs bpf_strcasestr and bpf_strncasestr, which are extensions of bpf_strstr and bpf_strnstr, suitable for more scenarios.

Rong Tao (2):
bpf: add bpf_strcasestr,bpf_strncasestr kfuncs selftests/bpf: Test bpf_strcasestr,bpf_strncasestr kfuncs

[...]

Here is the summary with links:
- [bpf-next,v4,1/2] bpf: add bpf_strcasestr,bpf_strncasestr kfuncs

    https://git.kernel.org/bpf/bpf-next/c/b5b693f73589
  - [bpf-next,v4,2/2] selftests/bpf: Test bpf_strcasestr,bpf_strncasestr kfuncs
    https://git.kernel.org/bpf/bpf-next/c/eca0b643efc9

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html