]> git.baikalelectronics.ru Git - kernel.git/commit
selftests/bpf: Add __noinline variant of cls_redirect selftest
authorAndrii Nakryiko <andriin@fb.com>
Thu, 3 Sep 2020 20:35:42 +0000 (13:35 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 4 Sep 2020 00:14:40 +0000 (17:14 -0700)
commitee333df50bff22956ad37f3784cf120028f343a8
treeb6954a3ab16ff31e04dde36a09213c587ad99a57
parentbaaf680e089f34468f26e86f76af712105f6019b
selftests/bpf: Add __noinline variant of cls_redirect selftest

As one of the most complicated and close-to-real-world programs, cls_redirect
is a good candidate to exercise libbpf's logic of handling bpf2bpf calls. So
add variant with using explicit __noinline for majority of functions except
few most basic ones. If those few functions are inlined, verifier starts to
complain about program instruction limit of 1mln instructions being exceeded,
most probably due to instruction overhead of doing a sub-program call.
Convert user-space part of selftest to have to sub-tests: with and without
inlining.

Signed-off-by: Andrii Nakryiko <andriin@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Cc: Lorenz Bauer <lmb@cloudflare.com>
Link: https://lore.kernel.org/bpf/20200903203542.15944-15-andriin@fb.com
tools/testing/selftests/bpf/prog_tests/cls_redirect.c
tools/testing/selftests/bpf/progs/test_cls_redirect.c
tools/testing/selftests/bpf/progs/test_cls_redirect_subprogs.c [new file with mode: 0644]