diff options
author | Alexei Starovoitov | 2017-12-15 02:55:11 +0100 |
---|---|---|
committer | Daniel Borkmann | 2017-12-17 20:34:36 +0100 |
commit | 3bc35c63cb70466c78d3972ceaf8205aa463a192 (patch) | |
tree | 0ff4d6d6f950bdd224a919a02c6a2cbd7ad282dd /tools/testing/selftests/bpf/test_progs.c | |
parent | libbpf: add support for bpf_call (diff) | |
download | kernel-qcow2-linux-3bc35c63cb70466c78d3972ceaf8205aa463a192.tar.gz kernel-qcow2-linux-3bc35c63cb70466c78d3972ceaf8205aa463a192.tar.xz kernel-qcow2-linux-3bc35c63cb70466c78d3972ceaf8205aa463a192.zip |
selftests/bpf: add bpf_call test
strip always_inline from test_l4lb.c and compile it with -fno-inline
to let verifier go through 11 function with various function arguments
and return values
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'tools/testing/selftests/bpf/test_progs.c')
-rw-r--r-- | tools/testing/selftests/bpf/test_progs.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/tools/testing/selftests/bpf/test_progs.c b/tools/testing/selftests/bpf/test_progs.c index 1d7d2149163a..abff83bf8d40 100644 --- a/tools/testing/selftests/bpf/test_progs.c +++ b/tools/testing/selftests/bpf/test_progs.c @@ -169,10 +169,9 @@ out: #define NUM_ITER 100000 #define VIP_NUM 5 -static void test_l4lb(void) +static void test_l4lb(const char *file) { unsigned int nr_cpus = bpf_num_possible_cpus(); - const char *file = "./test_l4lb.o"; struct vip key = {.protocol = 6}; struct vip_meta { __u32 flags; @@ -249,6 +248,15 @@ out: bpf_object__close(obj); } +static void test_l4lb_all(void) +{ + const char *file1 = "./test_l4lb.o"; + const char *file2 = "./test_l4lb_noinline.o"; + + test_l4lb(file1); + test_l4lb(file2); +} + static void test_tcp_estats(void) { const char *file = "./test_tcp_estats.o"; @@ -757,7 +765,7 @@ int main(void) test_pkt_access(); test_xdp(); - test_l4lb(); + test_l4lb_all(); test_tcp_estats(); test_bpf_obj_id(); test_pkt_md_access(); |