Skip to content

eBPF support for cls_bpf

Daniel Borkmann netdev 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest8 patches 1 replyIn review
  2. v110 patches 7 repliesSuperseded

Changes in v2 from the cover letter

- 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

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/8ebpf: remove kernel test stubskernel/bpf/Makefile kernel/bpf/test_stub.c samples/bpf/test_verifier.c+3 -830 replies
2/8ebpf: constify various function pointer structsinclude/linux/bpf.h kernel/bpf/arraymap.c kernel/bpf/hashtab.c +2 more+19 -190 replies
3/8ebpf: export BPF_PSEUDO_MAP_FD to uapiinclude/linux/filter.h include/uapi/linux/bpf.h samples/bpf/libbpf.h+5 -30 replies
4/8ebpf: make internal bpf API independent of CONFIG_BPF_SYSCALL ifdefsinclude/linux/bpf.h+16 -40 replies
5/8ebpf: remove CONFIG_BPF_SYSCALL ifdefs in socket filter codenet/core/filter.c+14 -220 replies
6/8ebpf: add sched_cls_type and map it to sk_filter's verifier opsinclude/uapi/linux/bpf.h kernel/bpf/verifier.c net/core/filter.c+21 -20 replies
7/8ebpf: move read-only fields to bpf_prog and shrink bpf_prog_auxinclude/linux/bpf.h include/linux/filter.h kernel/bpf/syscall.c +2 more+11 -120 replies
8/8cls_bpf: add initial eBPF support for programmable classifiersinclude/uapi/linux/pkt_cls.h kernel/bpf/syscall.c net/sched/cls_bpf.c+158 -520 replies

Reviews trailers per patch

6 of 8 patches have a Reviewed-by or Acked-by.

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

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

Read the v2 thread

Cover letter [PATCH net-next v2 0/8] 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

Daniel Borkmann (8):
ebpf: remove kernel test stubs
ebpf: constify various function pointer structs
ebpf: export BPF_PSEUDO_MAP_FD to uapi
ebpf: make internal bpf API independent of CONFIG_BPF_SYSCALL ifdefs
ebpf: remove CONFIG_BPF_SYSCALL ifdefs in socket filter code
ebpf: add sched_cls_type and map it to sk_filter's verifier ops
ebpf: move read-only fields to bpf_prog and shrink bpf_prog_aux
cls_bpf: add initial eBPF support for programmable classifiers

 include/linux/bpf.h          |  38 +++++---
 include/linux/filter.h       |   6 +-
 include/uapi/linux/bpf.h     |   3 +
 include/uapi/linux/pkt_cls.h |   2 +
 kernel/bpf/Makefile          |   3 -
 kernel/bpf/arraymap.c        |   6 +-
 kernel/bpf/hashtab.c         |   6 +-
 kernel/bpf/helpers.c         |   6 +-
 kernel/bpf/syscall.c         |   9 +-
 kernel/bpf/test_stub.c       |  78 ----------------
 kernel/bpf/verifier.c        |  17 +++-
 net/core/filter.c            |  47 +++++-----
 net/sched/cls_bpf.c          | 206 ++++++++++++++++++++++++++++++++-----------
 samples/bpf/libbpf.h         |   4 +-
 samples/bpf/test_verifier.c  |   5 +-
 15 files changed, 243 insertions(+), 193 deletions(-)
 delete mode 100644 kernel/bpf/test_stub.c
Signature · 1 line
1.9.3