aboutsummaryrefslogtreecommitdiffstats
path: root/samples
diff options
context:
space:
mode:
authorDaniel Borkmann <daniel@iogearbox.net>2015-03-01 06:31:41 -0500
committerDavid S. Miller <davem@davemloft.net>2015-03-01 14:05:18 -0500
commitf91fe17e243d1f279d425071a35e3d41290758a0 (patch)
treebe27553798f8f3490487814275e09644e446c88f /samples
parentb656cc64cf815d8ff6e99883a531fafc48199bd0 (diff)
ebpf: remove kernel test stubs
Now that we have BPF_PROG_TYPE_SOCKET_FILTER up and running, we can remove the test stubs which were added to get the verifier suite up. We can just let the test cases probe under socket filter type instead. In the fill/spill test case, we cannot (yet) access fields from the context (skb), but we may adapt that test case in future. Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Acked-by: Alexei Starovoitov <ast@plumgrid.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'samples')
-rw-r--r--samples/bpf/test_verifier.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/samples/bpf/test_verifier.c b/samples/bpf/test_verifier.c
index b96175e90363..7b56b59fad8e 100644
--- a/samples/bpf/test_verifier.c
+++ b/samples/bpf/test_verifier.c
@@ -288,7 +288,8 @@ static struct bpf_test tests[] = {
288 BPF_LDX_MEM(BPF_DW, BPF_REG_2, BPF_REG_10, -8), 288 BPF_LDX_MEM(BPF_DW, BPF_REG_2, BPF_REG_10, -8),
289 289
290 /* should be able to access R0 = *(R2 + 8) */ 290 /* should be able to access R0 = *(R2 + 8) */
291 BPF_LDX_MEM(BPF_DW, BPF_REG_0, BPF_REG_2, 8), 291 /* BPF_LDX_MEM(BPF_DW, BPF_REG_0, BPF_REG_2, 8), */
292 BPF_MOV64_REG(BPF_REG_0, BPF_REG_2),
292 BPF_EXIT_INSN(), 293 BPF_EXIT_INSN(),
293 }, 294 },
294 .result = ACCEPT, 295 .result = ACCEPT,
@@ -687,7 +688,7 @@ static int test(void)
687 } 688 }
688 printf("#%d %s ", i, tests[i].descr); 689 printf("#%d %s ", i, tests[i].descr);
689 690
690 prog_fd = bpf_prog_load(BPF_PROG_TYPE_UNSPEC, prog, 691 prog_fd = bpf_prog_load(BPF_PROG_TYPE_SOCKET_FILTER, prog,
691 prog_len * sizeof(struct bpf_insn), 692 prog_len * sizeof(struct bpf_insn),
692 "GPL"); 693 "GPL");
693 694