diff options
| author | David S. Miller <[email protected]> | 2021-04-26 01:02:32 +0000 |
|---|---|---|
| committer | David S. Miller <[email protected]> | 2021-04-26 01:02:32 +0000 |
| commit | 5f6c2f536de648ac31564d8c413337ff4f7af93a (patch) | |
| tree | 37360317224f4d60619976d284b66aa7a9ddf08a /tools/testing/selftests/bpf/prog_tests/map_ptr.c | |
| parent | phy: nxp-c45-tja11xx: add interrupt support (diff) | |
| parent | bpf: Document the pahole release info related to libbpf in bpf_devel_QA.rst (diff) | |
| download | kernel-5f6c2f536de648ac31564d8c413337ff4f7af93a.tar.gz kernel-5f6c2f536de648ac31564d8c413337ff4f7af93a.zip | |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next
Alexei Starovoitov says:
====================
pull-request: bpf-next 2021-04-23
The following pull-request contains BPF updates for your *net-next* tree.
We've added 69 non-merge commits during the last 22 day(s) which contain
a total of 69 files changed, 3141 insertions(+), 866 deletions(-).
The main changes are:
1) Add BPF static linker support for extern resolution of global, from Andrii.
2) Refine retval for bpf_get_task_stack helper, from Dave.
3) Add a bpf_snprintf helper, from Florent.
4) A bunch of miscellaneous improvements from many developers.
====================
Signed-off-by: David S. Miller <[email protected]>
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests/map_ptr.c')
| -rw-r--r-- | tools/testing/selftests/bpf/prog_tests/map_ptr.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/tools/testing/selftests/bpf/prog_tests/map_ptr.c b/tools/testing/selftests/bpf/prog_tests/map_ptr.c index c230a573c373..4972f92205c7 100644 --- a/tools/testing/selftests/bpf/prog_tests/map_ptr.c +++ b/tools/testing/selftests/bpf/prog_tests/map_ptr.c @@ -12,11 +12,22 @@ void test_map_ptr(void) __u32 duration = 0, retval; char buf[128]; int err; + int page_size = getpagesize(); - skel = map_ptr_kern__open_and_load(); - if (CHECK(!skel, "skel_open_load", "open_load failed\n")) + skel = map_ptr_kern__open(); + if (!ASSERT_OK_PTR(skel, "skel_open")) return; + err = bpf_map__set_max_entries(skel->maps.m_ringbuf, page_size); + if (!ASSERT_OK(err, "bpf_map__set_max_entries")) + goto cleanup; + + err = map_ptr_kern__load(skel); + if (!ASSERT_OK(err, "skel_load")) + goto cleanup; + + skel->bss->page_size = page_size; + err = bpf_prog_test_run(bpf_program__fd(skel->progs.cg_skb), 1, &pkt_v4, sizeof(pkt_v4), buf, NULL, &retval, NULL); |
