summaryrefslogtreecommitdiff
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
parent3da6e7e408b9c229e5e5cc1ddab7445c7561afc3 (diff)
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 'tools/testing/selftests/bpf/verifier/scale.c')
-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,
+},