Skip to content

Commit

Permalink
selftests/bpf: Fix ringbuf test fetching map FD
Browse files Browse the repository at this point in the history
Seems like 4d1b629 ("selftests/bpf: Convert few tests to light skeleton.")
and 704e2be ("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: 704e2be ("selftests/bpf: Test ringbuf mmap read-only and read-write restrictions")
Fixes: 4d1b629 ("selftests/bpf: Convert few tests to light skeleton.")
Signed-off-by: Andrii Nakryiko <[email protected]>
Signed-off-by: Alexei Starovoitov <[email protected]>
Link: https://lore.kernel.org/bpf/[email protected]
  • Loading branch information
anakryiko authored and Alexei Starovoitov committed Jun 18, 2021
1 parent 8fe088b commit 0c38740
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/testing/selftests/bpf/prog_tests/ringbuf.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit 0c38740

Please sign in to comment.