diff options
author | Andrii Nakryiko <andrii@kernel.org> | 2021-06-17 17:28:24 -0700 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2021-06-17 18:23:55 -0700 |
commit | 0c38740c08962ab109267cb23f4a40df2ccf2bbf (patch) | |
tree | bb3252a57e3dedf3c0255ce2bd9a680684953e48 /tools/testing/selftests/bpf/prog_tests/ringbuf.c | |
parent | 8fe088bd4fd12f4c8899b51d5bc3daad98767d49 (diff) | |
download | linux-0c38740c08962ab109267cb23f4a40df2ccf2bbf.tar.gz linux-0c38740c08962ab109267cb23f4a40df2ccf2bbf.tar.bz2 linux-0c38740c08962ab109267cb23f4a40df2ccf2bbf.zip |
selftests/bpf: Fix ringbuf test fetching map FD
Seems like 4d1b62986125 ("selftests/bpf: Convert few tests to light skeleton.")
and 704e2beba23c ("selftests/bpf: Test ringbuf mmap read-only and read-write
restrictions") were done independently on bpf and bpf-next trees and are in
conflict with each other, despite a clean merge. Fix fetching of ringbuf's
map_fd to use light skeleton properly.
Fixes: 704e2beba23c ("selftests/bpf: Test ringbuf mmap read-only and read-write restrictions")
Fixes: 4d1b62986125 ("selftests/bpf: Convert few tests to light skeleton.")
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20210618002824.2081922-1-andrii@kernel.org
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests/ringbuf.c')
-rw-r--r-- | tools/testing/selftests/bpf/prog_tests/ringbuf.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/testing/selftests/bpf/prog_tests/ringbuf.c b/tools/testing/selftests/bpf/prog_tests/ringbuf.c index a01788090c31..4706cee84360 100644 --- a/tools/testing/selftests/bpf/prog_tests/ringbuf.c +++ b/tools/testing/selftests/bpf/prog_tests/ringbuf.c @@ -100,7 +100,7 @@ void test_ringbuf(void) if (CHECK(err != 0, "skel_load", "skeleton load failed\n")) goto cleanup; - rb_fd = bpf_map__fd(skel->maps.ringbuf); + rb_fd = skel->maps.ringbuf.map_fd; /* good read/write cons_pos */ mmap_ptr = mmap(NULL, page_size, PROT_READ | PROT_WRITE, MAP_SHARED, rb_fd, 0); ASSERT_OK_PTR(mmap_ptr, "rw_cons_pos"); |