]> www.infradead.org Git - users/jedix/linux-maple.git/commit
selftests/bpf: Test kptr arrays and kptrs in nested struct fields.
authorKui-Feng Lee <thinker.li@gmail.com>
Thu, 23 May 2024 17:42:00 +0000 (10:42 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Tue, 4 Jun 2024 03:52:42 +0000 (20:52 -0700)
commitc4c6c3b785a0b1426add15d078da61f899abeaac
treebdf978cfc78a73d41542df82a794c3b069184d61
parentf19caf57d80f4432acea61d858d45ce194444389
selftests/bpf: Test kptr arrays and kptrs in nested struct fields.

Make sure that BPF programs can declare global kptr arrays and kptr fields
in struct types that is the type of a global variable or the type of a
nested descendant field in a global variable.

An array with only one element is special case, that it treats the element
like a non-array kptr field. Nested arrays are also tested to ensure they
are handled properly.

Acked-by: Eduard Zingerman <eddyz87@gmail.com>
Signed-off-by: Kui-Feng Lee <thinker.li@gmail.com>
Link: https://lore.kernel.org/r/20240523174202.461236-8-thinker.li@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/prog_tests/cpumask.c
tools/testing/selftests/bpf/progs/cpumask_success.c