Skip to content

RFC eBPF support for cls_bpf

Daniel Borkmann netdev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest7 patches 5 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7ebpf: remove kernel test stubskernel/bpf/Makefile kernel/bpf/test_stub.c samples/bpf/test_verifier.c+3 -831 reply
2/7ebpf: constify various function pointer structsinclude/linux/bpf.h kernel/bpf/arraymap.c kernel/bpf/hashtab.c +2 more+19 -191 reply
3/7ebpf: check first for MAXINSNS in bpf_prog_loadkernel/bpf/syscall.c+9 -82 replies
4/7ebpf: extend program type/subsystem registrationinclude/linux/bpf.h kernel/bpf/helpers.c kernel/bpf/syscall.c +2 more+83 -340 replies
5/7ebpf: export BPF_PSEUDO_MAP_FD to uapiinclude/linux/filter.h include/uapi/linux/bpf.h samples/bpf/libbpf.h+5 -31 reply
6/7ebpf: remove CONFIG_BPF_SYSCALL ifdefs in socket filter codeinclude/linux/bpf.h net/core/filter.c+100 -930 replies
7/7cls_bpf: add initial eBPF support for programmable classifiersinclude/uapi/linux/bpf.h include/uapi/linux/pkt_cls.h kernel/bpf/verifier.c +1 more+165 -520 replies

Reviews trailers per patch

3 of 7 patches have a Reviewed-by or Acked-by.

PatchAlexei Starovoitov
1/7A-b
2/7A-b
3/7
4/7
5/7A-b
6/7
7/7

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [RFC PATCH net-next 0/7] eBPF support for cls_bpf

I'm sending this out only as RFC as the merge window is open anyway and Dave's pull request pending.

My plan would be to get this work fully refined and remove some rough edges until net-next opens up again, submitting it as non-RFC.

So for the time being similarly as the recent OVS eBPF action patchset this may serve as a discussion ground, also wrt to the BPF tutorial at netdev01 [1].

I presume on top of this e.g. Jiri might want to follow-up with act_bpf, I'm also open/happy to contribute to it.

The series starts with a couple of cleanups and making the prog type infrastructure pluggable in eBPF. Most interesting is probably the last patch that adds actual support and the iproute2 bits from the link below.

With regards to accessing fields from the context (here: skb), I leave that for future work just as we currently do in socket filters, also with regard to the currently ongoing ABI discussion from tracing side. Nevertheless, the state with these patches still allows for interesting functionality to be implemented as complex classifiers, e.g. such as a fully fledged C-like flow dissector as shown in bpf samples directory and the like.

iproute2 part:

http://git.breakpoint.cc/cgit/dborkman/iproute2.git/log/?h=ebpf

I have configured and built LLVM with: --enable-experimental-targets=BPF

[1] https://www.netdev01.org/sessions/15

Thanks !

Daniel Borkmann (7):
ebpf: remove kernel test stubs
ebpf: constify various function pointer structs
ebpf: check first for MAXINSNS in bpf_prog_load
ebpf: extend program type/subsystem registration
ebpf: export BPF_PSEUDO_MAP_FD to uapi
ebpf: remove CONFIG_BPF_SYSCALL ifdefs in socket filter code
cls_bpf: add initial eBPF support for programmable classifiers

 include/linux/bpf.h          |  46 +++++++---
 include/linux/filter.h       |   2 -
 include/uapi/linux/bpf.h     |   3 +
 include/uapi/linux/pkt_cls.h |   1 +
 kernel/bpf/Makefile          |   3 -
 kernel/bpf/arraymap.c        |   6 +-
 kernel/bpf/hashtab.c         |   6 +-
 kernel/bpf/helpers.c         |   9 +-
 kernel/bpf/syscall.c         |  96 +++++++++++++++------
 kernel/bpf/test_stub.c       |  78 -----------------
 kernel/bpf/verifier.c        |  28 ++++--
 net/core/filter.c            | 169 +++++++++++++++++-------------------
 net/sched/cls_bpf.c          | 200 ++++++++++++++++++++++++++++++++-----------
 samples/bpf/libbpf.h         |   4 +-
 samples/bpf/test_verifier.c  |   5 +-
 15 files changed, 374 insertions(+), 282 deletions(-)
 delete mode 100644 kernel/bpf/test_stub.c
Signature · 1 line
1.9.3