summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/bpf/verifier/xdp.c
diff options
context:
space:
mode:
authorJakub Kicinski <jakub.kicinski@netronome.com>2019-01-25 15:24:44 -0800
committerAlexei Starovoitov <ast@kernel.org>2019-01-27 21:37:45 -0800
commit48729226238d4d56bdb8de9d54b911f179dd54b7 (patch)
treee90c7ee9b0cdb7eb51de8544f2ee80ddc4715aae /tools/testing/selftests/bpf/verifier/xdp.c
parent40f2fbd5a5e9c6d0799632fcba174a7b45c471da (diff)
selftests: bpf: break up the rest of test_verifier
Break up the rest of test_verifier tests into separate files. Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com> Acked-by: Jiong Wang <jiong.wang@netronome.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'tools/testing/selftests/bpf/verifier/xdp.c')
-rw-r--r--tools/testing/selftests/bpf/verifier/xdp.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/tools/testing/selftests/bpf/verifier/xdp.c b/tools/testing/selftests/bpf/verifier/xdp.c
new file mode 100644
index 000000000000..5ac390508139
--- /dev/null
+++ b/tools/testing/selftests/bpf/verifier/xdp.c
@@ -0,0 +1,14 @@
+{
+ "XDP, using ifindex from netdev",
+ .insns = {
+ BPF_MOV64_IMM(BPF_REG_0, 0),
+ BPF_LDX_MEM(BPF_W, BPF_REG_2, BPF_REG_1,
+ offsetof(struct xdp_md, ingress_ifindex)),
+ BPF_JMP_IMM(BPF_JLT, BPF_REG_2, 1, 1),
+ BPF_MOV64_IMM(BPF_REG_0, 1),
+ BPF_EXIT_INSN(),
+ },
+ .result = ACCEPT,
+ .prog_type = BPF_PROG_TYPE_XDP,
+ .retval = 1,
+},