aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/bpf/verifier/scale.c
diff options
context:
space:
mode:
authorAlexei Starovoitov <ast@kernel.org>2019-04-12 14:41:32 -0700
committerDaniel Borkmann <daniel@iogearbox.net>2019-04-16 10:18:15 +0200
commit08de198c95438fcbfad7bc06121176794ec92c6e (patch)
treeb45d78fdab0f19b90a9a95dc6b1519d61e1dbc62 /tools/testing/selftests/bpf/verifier/scale.c
parentbpftool: Improve handling of ENOSPC on reuseport_array map dumps (diff)
downloadlinux-dev-08de198c95438fcbfad7bc06121176794ec92c6e.tar.xz
linux-dev-08de198c95438fcbfad7bc06121176794ec92c6e.zip
selftests/bpf: two scale tests
Add two tests to check that sequence of 1024 jumps is verifiable. Signed-off-by: Alexei Starovoitov <ast@kernel.org> Acked-by: Song Liu <songliubraving@fb.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to '')
-rw-r--r--tools/testing/selftests/bpf/verifier/scale.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/tools/testing/selftests/bpf/verifier/scale.c b/tools/testing/selftests/bpf/verifier/scale.c
new file mode 100644
index 000000000000..7f868d4802e0
--- /dev/null
+++ b/tools/testing/selftests/bpf/verifier/scale.c
@@ -0,0 +1,18 @@
+{
+ "scale: scale test 1",
+ .insns = { },
+ .data = { },
+ .fill_helper = bpf_fill_scale,
+ .prog_type = BPF_PROG_TYPE_SCHED_CLS,
+ .result = ACCEPT,
+ .retval = 1,
+},
+{
+ "scale: scale test 2",
+ .insns = { },
+ .data = { },
+ .fill_helper = bpf_fill_scale,
+ .prog_type = BPF_PROG_TYPE_SCHED_CLS,
+ .result = ACCEPT,
+ .retval = 2,
+},