diff options
author | David S. Miller <davem@davemloft.net> | 2015-03-01 14:05:24 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-03-01 14:05:24 -0500 |
commit | 68932f7188f84673fdb0de14a00c2f428869c6ed (patch) | |
tree | dd4de9c9faa662e188285fa5db20663859139f55 /samples | |
parent | b656cc64cf815d8ff6e99883a531fafc48199bd0 (diff) | |
parent | e2e9b6541dd4b31848079da80fe2253daaafb549 (diff) | |
download | op-kernel-dev-68932f7188f84673fdb0de14a00c2f428869c6ed.zip op-kernel-dev-68932f7188f84673fdb0de14a00c2f428869c6ed.tar.gz |
Merge branch 'ebpf_support_for_cls_bpf'
Daniel Borkmann says:
====================
eBPF support for cls_bpf
This is the non-RFC version of my patchset posted before netdev01 [1]
conference. It contains a couple of eBPF cleanups and preparation
patches to get eBPF support into cls_bpf. The last patch adds the
actual support. I'll post the iproute2 parts after the kernel bits
are merged, an initial preview link to the code is mentioned in the
last patch.
Patch 4 and 5 were originally one patch, but I've split them into
two parts upon request as patch 4 only is also needed for Alexei's
tracing patches that go via tip tree.
Tested with tc and all in-kernel available BPF test suites.
I have configured and built LLVM with --enable-experimental-targets=BPF
but as Alexei put it, the plan is to get rid of the experimental
status in future [2].
Thanks a lot!
v1 -> v2:
- Removed arch patches from this series
- x86 is already queued in tip tree, under x86/mm
- arm64 just reposted directly to arm folks
- Rest is unchanged
[1] http://thread.gmane.org/gmane.linux.network/350191
[2] http://article.gmane.org/gmane.linux.kernel/1874969
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'samples')
-rw-r--r-- | samples/bpf/libbpf.h | 4 | ||||
-rw-r--r-- | samples/bpf/test_verifier.c | 5 |
2 files changed, 6 insertions, 3 deletions
diff --git a/samples/bpf/libbpf.h b/samples/bpf/libbpf.h index 58c5fe1..a6bb7e9c 100644 --- a/samples/bpf/libbpf.h +++ b/samples/bpf/libbpf.h @@ -92,7 +92,9 @@ extern char bpf_log_buf[LOG_BUF_SIZE]; .off = 0, \ .imm = ((__u64) (IMM)) >> 32 }) -#define BPF_PSEUDO_MAP_FD 1 +#ifndef BPF_PSEUDO_MAP_FD +# define BPF_PSEUDO_MAP_FD 1 +#endif /* pseudo BPF_LD_IMM64 insn used to refer to process-local map_fd */ #define BPF_LD_MAP_FD(DST, MAP_FD) \ diff --git a/samples/bpf/test_verifier.c b/samples/bpf/test_verifier.c index b96175e..7b56b59 100644 --- a/samples/bpf/test_verifier.c +++ b/samples/bpf/test_verifier.c @@ -288,7 +288,8 @@ static struct bpf_test tests[] = { BPF_LDX_MEM(BPF_DW, BPF_REG_2, BPF_REG_10, -8), /* should be able to access R0 = *(R2 + 8) */ - BPF_LDX_MEM(BPF_DW, BPF_REG_0, BPF_REG_2, 8), + /* BPF_LDX_MEM(BPF_DW, BPF_REG_0, BPF_REG_2, 8), */ + BPF_MOV64_REG(BPF_REG_0, BPF_REG_2), BPF_EXIT_INSN(), }, .result = ACCEPT, @@ -687,7 +688,7 @@ static int test(void) } printf("#%d %s ", i, tests[i].descr); - prog_fd = bpf_prog_load(BPF_PROG_TYPE_UNSPEC, prog, + prog_fd = bpf_prog_load(BPF_PROG_TYPE_SOCKET_FILTER, prog, prog_len * sizeof(struct bpf_insn), "GPL"); |