Skip to content

bpf tc tunneling

Willem de Bruijn netdev 3 versions – Applied

Status from this message: Applied, Thanks

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest13 patches 3 repliesApplied
  2. v213 patches 4 repliesSuperseded
  3. v113 patches 7 repliesSuperseded

Changes in v3 from the cover letter

- move BPF_F_ADJ_ROOM_ENCAP_L3_MASK out of uapi as it has no use in userspace

Patches in v3 Applied

#Subject and filesSizeRepliesApplied
1/13bpf: in bpf_skb_adjust_room avoid copy in tx fast pathnet/core/filter.c+1 -10 replies
2/13selftests/bpf: bpf tunnel encap testtools/testing/selftests/bpf/Makefile tools/testing/selftests/bpf/progs/test_tc_tunnel.c tools/testing/selftests/bpf/test_tc_tunnel.sh+160 -10 replies
3/13selftests/bpf: expand bpf tunnel test with decaptools/testing/selftests/bpf/progs/test_tc_tunnel.c tools/testing/selftests/bpf/test_tc_tunnel.sh+40 -00 replies
4/13selftests/bpf: expand bpf tunnel test to ipv6tools/testing/selftests/bpf/config tools/testing/selftests/bpf/progs/test_tc_tunnel.c tools/testing/selftests/bpf/test_tc_tunnel.sh+149 -220 replies
5/13selftests/bpf: extend bpf tunnel test with gretools/testing/selftests/bpf/progs/test_tc_tunnel.c tools/testing/selftests/bpf/test_tc_tunnel.sh+123 -460 replies
6/13selftests/bpf: extend bpf tunnel test with tsotools/testing/selftests/bpf/test_tc_tunnel.sh+49 -110 replies
7/13bpf: add bpf_skb_adjust_room mode BPF_ADJ_ROOM_MACinclude/uapi/linux/bpf.h net/core/filter.c+25 -190 replies
8/13bpf: add bpf_skb_adjust_room flag BPF_F_ADJ_ROOM_FIXED_GSOinclude/uapi/linux/bpf.h net/core/filter.c+34 -130 replies
9/13bpf: add bpf_skb_adjust_room encap flagsinclude/uapi/linux/bpf.h net/core/filter.c+76 -60 replies
10/13bpf: Sync bpf.h to toolstools/include/uapi/linux/bpf.h+26 -30 replies
11/13selftests/bpf: convert bpf tunnel test to BPF_ADJ_ROOM_MACtools/testing/selftests/bpf/progs/test_tc_tunnel.c+3 -220 replies
12/13selftests/bpf: convert bpf tunnel test to BPF_F_ADJ_ROOM_FIXED_GSOtools/testing/selftests/bpf/progs/test_tc_tunnel.c tools/testing/selftests/bpf/test_tc_tunnel.sh+14 -30 replies
13/13selftests/bpf: convert bpf tunnel test to encap modestools/testing/selftests/bpf/progs/test_tc_tunnel.c tools/testing/selftests/bpf/test_tc_tunnel.sh+19 -100 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.

Read the v3 thread

Cover letter [PATCH bpf-next v3 00/13] bpf tc tunneling

From: Willem de Bruijn <[email protected]>

BPF allows for dynamic tunneling, choosing the tunnel destination and features on-demand. Extend bpf_skb_adjust_room to allow for efficient tunneling at the TC hooks.

Most features are required for large packets with GSO, as these will be modified after this patch.

Patch 1
is a performance optimization, avoiding an unnecessary unclone for the TCP hot path.

Patches 2..6
introduce a regression test. These can be squashed, but the code is arguably more readable when gradually expanding the feature set.

Patch 7
is a performance optimization, avoid copying network headers that are going to be overwritten. This also simplifies the bpf program.

Patch 8
reenables bpf_skb_adjust_room for UDP packets.

Patch 9
configures skb tunneling metadata analogous to tunnel devices.

Patches 10..13
expand the regression test to make use of the new features and enable the GSO testcases.

Changes
v1->v2
- move BPF_F_ADJ_ROOM_MASK out of uapi as it can be expanded
- document new flags
- in tests replace netcat -q flag with coreutils timeout:
the -q flag is not supported in all netcat versions
v2->v3
- move BPF_F_ADJ_ROOM_ENCAP_L3_MASK out of uapi as it has no use in userspace

Willem de Bruijn (13):
bpf: in bpf_skb_adjust_room avoid copy in tx fast path selftests/bpf: bpf tunnel encap test
selftests/bpf: expand bpf tunnel test with decap selftests/bpf: expand bpf tunnel test to ipv6 selftests/bpf: extend bpf tunnel test with gre selftests/bpf: extend bpf tunnel test with tso
bpf: add bpf_skb_adjust_room mode BPF_ADJ_ROOM_MAC
bpf: add bpf_skb_adjust_room flag BPF_F_ADJ_ROOM_FIXED_GSO
bpf: add bpf_skb_adjust_room encap flags
bpf: Sync bpf.h to tools
selftests/bpf: convert bpf tunnel test to BPF_ADJ_ROOM_MAC selftests/bpf: convert bpf tunnel test to BPF_F_ADJ_ROOM_FIXED_GSO selftests/bpf: convert bpf tunnel test to encap modes

 include/uapi/linux/bpf.h                      |  29 +-
 net/core/filter.c                             | 132 +++++++--
 tools/include/uapi/linux/bpf.h                |  29 +-
 tools/testing/selftests/bpf/Makefile          |   3 +-
 tools/testing/selftests/bpf/config            |   2 +
 .../selftests/bpf/progs/test_tc_tunnel.c      | 261 ++++++++++++++++++
 tools/testing/selftests/bpf/test_tc_tunnel.sh | 178 ++++++++++++
 7 files changed, 598 insertions(+), 36 deletions(-)
 create mode 100644 tools/testing/selftests/bpf/progs/test_tc_tunnel.c
 create mode 100755 tools/testing/selftests/bpf/test_tc_tunnel.sh
Signature · 1 line
2.21.0.392.gf8f6787159e-goog