summaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/bpf/prog_tests
diff options
context:
space:
mode:
authorAlexei Starovoitov <ast@kernel.org>2022-11-22 08:50:04 -0800
committerAlexei Starovoitov <ast@kernel.org>2022-11-22 13:33:56 -0800
commit0b2971a2703c015b5737d66688c2c7c81a5e391b (patch)
treeeabd27da9f6a31abf98853580aae8088559b50ca /tools/testing/selftests/bpf/prog_tests
parent68f8e3d4b916531ea3bb8b83e35138cf78f2fce5 (diff)
downloadlinux-0b2971a2703c015b5737d66688c2c7c81a5e391b.tar.bz2
Revert "selftests/bpf: Temporarily disable linked list tests"
This reverts commit 0a2f85a1be4328d29aefa54684d10c23a3298fef. Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests')
-rw-r--r--tools/testing/selftests/bpf/prog_tests/linked_list.c21
1 files changed, 7 insertions, 14 deletions
diff --git a/tools/testing/selftests/bpf/prog_tests/linked_list.c b/tools/testing/selftests/bpf/prog_tests/linked_list.c
index 6170d36fe5fc..dd73d0a62c6e 100644
--- a/tools/testing/selftests/bpf/prog_tests/linked_list.c
+++ b/tools/testing/selftests/bpf/prog_tests/linked_list.c
@@ -24,9 +24,7 @@ static struct {
{ #test "_missing_lock_pop_back", \
"bpf_spin_lock at off=" #off " must be held for bpf_list_head" },
TEST(kptr, 32)
-/* FIXME
TEST(global, 16)
-*/
TEST(map, 0)
TEST(inner_map, 0)
#undef TEST
@@ -34,6 +32,9 @@ static struct {
{ #test "_kptr_incorrect_lock_" #op, \
"held lock and object are not in the same allocation\n" \
"bpf_spin_lock at off=32 must be held for bpf_list_head" }, \
+ { #test "_global_incorrect_lock_" #op, \
+ "held lock and object are not in the same allocation\n" \
+ "bpf_spin_lock at off=16 must be held for bpf_list_head" }, \
{ #test "_map_incorrect_lock_" #op, \
"held lock and object are not in the same allocation\n" \
"bpf_spin_lock at off=0 must be held for bpf_list_head" }, \
@@ -44,6 +45,10 @@ static struct {
TEST(kptr, push_back)
TEST(kptr, pop_front)
TEST(kptr, pop_back)
+ TEST(global, push_front)
+ TEST(global, push_back)
+ TEST(global, pop_front)
+ TEST(global, pop_back)
TEST(map, push_front)
TEST(map, push_back)
TEST(map, pop_front)
@@ -53,14 +58,12 @@ static struct {
TEST(inner_map, pop_front)
TEST(inner_map, pop_back)
#undef TEST
-/* FIXME
{ "map_compat_kprobe", "tracing progs cannot use bpf_list_head yet" },
{ "map_compat_kretprobe", "tracing progs cannot use bpf_list_head yet" },
{ "map_compat_tp", "tracing progs cannot use bpf_list_head yet" },
{ "map_compat_perf", "tracing progs cannot use bpf_list_head yet" },
{ "map_compat_raw_tp", "tracing progs cannot use bpf_list_head yet" },
{ "map_compat_raw_tp_w", "tracing progs cannot use bpf_list_head yet" },
-*/
{ "obj_type_id_oor", "local type ID argument must be in range [0, U32_MAX]" },
{ "obj_new_no_composite", "bpf_obj_new type ID argument must be of a struct" },
{ "obj_new_no_struct", "bpf_obj_new type ID argument must be of a struct" },
@@ -75,7 +78,6 @@ static struct {
{ "direct_write_head", "direct access to bpf_list_head is disallowed" },
{ "direct_read_node", "direct access to bpf_list_node is disallowed" },
{ "direct_write_node", "direct access to bpf_list_node is disallowed" },
-/* FIXME
{ "write_after_push_front", "only read is supported" },
{ "write_after_push_back", "only read is supported" },
{ "use_after_unlock_push_front", "invalid mem access 'scalar'" },
@@ -92,11 +94,8 @@ static struct {
{ "no_head_type", "bpf_list_head not found at offset=0" },
{ "incorrect_head_var_off1", "R1 doesn't have constant offset" },
{ "incorrect_head_var_off2", "variable ptr_ access var_off=(0x0; 0xffffffff) disallowed" },
-*/
{ "incorrect_head_off1", "bpf_list_head not found at offset=17" },
-/* FIXME
{ "incorrect_head_off2", "bpf_list_head not found at offset=1" },
-*/
{ "pop_front_off",
"15: (bf) r1 = r6 ; R1_w=ptr_or_null_foo(id=4,ref_obj_id=4,off=40,imm=0) "
"R6_w=ptr_or_null_foo(id=4,ref_obj_id=4,off=40,imm=0) refs=2,4\n"
@@ -189,10 +188,8 @@ static void test_linked_list_success(int mode, bool leave_in_map)
ret = bpf_prog_test_run_opts(bpf_program__fd(skel->progs.global_list_push_pop), &opts);
ASSERT_OK(ret, "global_list_push_pop");
ASSERT_OK(opts.retval, "global_list_push_pop retval");
- /* FIXME:
if (!leave_in_map)
clear_fields(skel->maps.data_A);
- */
if (mode == PUSH_POP)
goto end;
@@ -213,10 +210,8 @@ ppm:
ret = bpf_prog_test_run_opts(bpf_program__fd(skel->progs.global_list_push_pop_multiple), &opts);
ASSERT_OK(ret, "global_list_push_pop_multiple");
ASSERT_OK(opts.retval, "global_list_push_pop_multiple retval");
- /* FIXME:
if (!leave_in_map)
clear_fields(skel->maps.data_A);
- */
if (mode == PUSH_POP_MULT)
goto end;
@@ -237,10 +232,8 @@ lil:
ret = bpf_prog_test_run_opts(bpf_program__fd(skel->progs.global_list_in_list), &opts);
ASSERT_OK(ret, "global_list_in_list");
ASSERT_OK(opts.retval, "global_list_in_list retval");
- /* FIXME:
if (!leave_in_map)
clear_fields(skel->maps.data_A);
- */
end:
linked_list__destroy(skel);
}