summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/bpf/prog_tests
diff options
context:
space:
mode:
authorKui-Feng Lee <thinker.li@gmail.com>2024-02-25 01:34:17 +0300
committerMartin KaFai Lau <martin.lau@kernel.org>2024-03-05 01:09:20 +0300
commit187e2af05abe6bf80581490239c449456627d17a (patch)
tree573c922b888bd957230d958b50a0756ce457262b /tools/testing/selftests/bpf/prog_tests
parent73e4f9e615d7b99f39663d4722dc73e8fa5db5f9 (diff)
downloadlinux-187e2af05abe6bf80581490239c449456627d17a.tar.xz
bpf: struct_ops supports more than one page for trampolines.
The BPF struct_ops previously only allowed one page of trampolines. Each function pointer of a struct_ops is implemented by a struct_ops bpf program. Each struct_ops bpf program requires a trampoline. The following selftest patch shows each page can hold a little more than 20 trampolines. While one page is more than enough for the tcp-cc usecase, the sched_ext use case shows that one page is not always enough and hits the one page limit. This patch overcomes the one page limit by allocating another page when needed and it is limited to a total of MAX_IMAGE_PAGES (8) pages which is more than enough for reasonable usages. The variable st_map->image has been changed to st_map->image_pages, and its type has been changed to an array of pointers to pages. Signed-off-by: Kui-Feng Lee <thinker.li@gmail.com> Link: https://lore.kernel.org/r/20240224223418.526631-3-thinker.li@gmail.com Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests')
0 files changed, 0 insertions, 0 deletions