Skip to content

packet: add cBPF and eBPF fanout modes

Willem de Bruijn netdev 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest4 patches 6 repliesIn review
  2. v14 patches 7 repliesSuperseded

Changes in v2 from the cover letter

- follow SO_LOCK_FILTER semantics on filter updates
- only accept eBPF programs of type BPF_PROG_TYPE_SOCKET_FILTER
- rename PACKET_FANOUT_BPF to PACKET_FANOUT_CBPF to match man 2 bpf usage: "classic" vs. "extended" BPF.

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4packet: add classic BPF fanout modeinclude/uapi/linux/if_packet.h net/packet/af_packet.c net/packet/internal.h+104 -23 replies
2/4packet: add extended BPF fanout modeinclude/uapi/linux/if_packet.h net/packet/af_packet.c+32 -02 replies
3/4selftests/net: test classic bpf fanout modetools/testing/selftests/net/psock_fanout.c tools/testing/selftests/net/psock_lib.h+33 -120 replies
4/4selftests/net: test extended BPF fanout modetools/testing/selftests/net/psock_fanout.c+53 -00 replies

Reviews trailers per patch

2 of 4 patches have a Reviewed-by or Acked-by.

PatchAlexei StarovoitovDaniel BorkmannEric Dumazet
1/4A-b A-b A-b
2/4A-b A-b
3/4
4/4

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v2 thread

Cover letter [PATCH net-next v2 0/4] packet: add cBPF and eBPF fanout modes

From: Willem de Bruijn <[email protected]>

Allow programmable fanout modes. Support both classical BPF programs passed directly and extended BPF programs passed by file descriptor.

One use case is packet steering by deep packet inspection, for instance for packet steering by application layer header fields.

Separate the configuration of the fanout mode and the configuration of the program, to allow dynamic updates to the latter at runtime.

Changes
v1 -> v2:
- follow SO_LOCK_FILTER semantics on filter updates
- only accept eBPF programs of type BPF_PROG_TYPE_SOCKET_FILTER
- rename PACKET_FANOUT_BPF to PACKET_FANOUT_CBPF to match man 2 bpf usage: "classic" vs. "extended" BPF.

Willem de Bruijn (4):
packet: add classic BPF fanout mode
packet: add extended BPF fanout mode
selftests/net: test classic bpf fanout mode
selftests/net: test extended BPF fanout mode

 include/uapi/linux/if_packet.h             |   3 +
 net/packet/af_packet.c                     | 130 ++++++++++++++++++++++++++++-
 net/packet/internal.h                      |   5 +-
 tools/testing/selftests/net/psock_fanout.c |  69 ++++++++++++++-
 tools/testing/selftests/net/psock_lib.h    |  29 +++++--
 5 files changed, 222 insertions(+), 14 deletions(-)
Signature · 1 line
2.5.0.276.gf5e568e