bpf: add BPF_LWT_ENCAP_IP option to bpf_lwt_push_encap
Status from this message: Applied. Thanks everyone!
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v11 Latest7 patches 7 repliesApplied
- v107 patches 4 repliesSuperseded
- v97 patches 4 repliesSuperseded
Earlier versions · 8
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v8 | 6 patches | 1 reply | Superseded | |
| v7 | 6 patches | 2 replies | Superseded | |
| v6 | 5 patches | 2 replies | Superseded | |
| v5 | 5 patches | 4 replies | Superseded | |
| v4 | 5 patches | 0 replies | Superseded | |
| v3 | 4 patches | 2 replies | Superseded | |
| v2 | 3 patches | 5 replies | Superseded | |
| v1 | 2 patches | 8 replies | Superseded |
V8 changes from the cover letter
- fixed build errors when LWT or IPV6 are not enabled;
- whitelisted TCP GSO instead of blacklisting SCTP and UDP GSO, as
Patches in v11 Applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/7 | bpf: add plumbing for BPF_LWT_ENCAP_IP in bpf_lwt_push_encapinclude/ net/ | +67 | 0 replies | |
| 2/7 | bpf: implement BPF_LWT_ENCAP_IP mode in bpf_lwt_push_encapinclude/ net/ net/ | +69 | 0 replies | |
| 3/7 | bpf: handle GSO in bpf_lwt_push_encapnet/ | +65 | 0 replies | |
| 4/7 | ipv6_stub: add ipv6_route_input stub/proxy.include/ net/ net/ | +14 | 0 replies | |
| 5/7 | bpf: add handling of BPF_LWT_REROUTE to lwt_bpf.cnet/ | +124 | 0 replies | |
| 6/7 | bpf: sync <kdir>/include/.../bpf.h with tools/include/.../bpf.htools/ | +24 | 0 replies | |
| 7/7 | selftests: bpf: add test_lwt_ip_encap selftesttools/ tools/ tools/ | +398 | 1 reply |
Reviews trailers per patch
None of the 7 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.
| Patch | David Ahern |
|---|---|
| Series | R-b |
| 1/7 | |
| 2/7 | |
| 3/7 | |
| 4/7 | |
| 5/7 | |
| 6/7 | |
| 7/7 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH bpf-next v11 0/7] bpf: add BPF_LWT_ENCAP_IP option to bpf_lwt_push_encap
This patchset implements BPF_LWT_ENCAP_IP mode in bpf_lwt_push_encap BPF helper. It enables BPF programs (specifically, BPF_PROG_TYPE_LWT_IN and BPF_PROG_TYPE_LWT_XMIT prog types) to add IP encapsulation headers to packets (e.g. IP/GRE, GUE, IPIP).
This is useful when thousands of different short-lived flows should be encapped, each with different and dynamically determined destination. Although lwtunnels can be used in some of these scenarios, the ability to dynamically generate encap headers adds more flexibility, e.g. when routing depends on the state of the host (reflected in global bpf maps).
V2 changes: added flowi-based route lookup, IPv6 encapping, and
encapping on ingress.
V3 changes: incorporated David Ahern's suggestions:
- added l3mdev check/oif (patch 2)
- sync bpf.h from include/uapi into tools/include/uapi
- selftest tweaks
V4 changes: moved route lookup/dst change from bpf_push_ip_encap
to when BPF_LWT_REROUTE is handled, as suggested by David Ahern.
V5 changes: added a check in lwt_xmit that skb->protocol stays the
same if the skb is to be passed back to the stack (ret == BPF_OK). Again, suggested by David Ahern.
V6 changes: abandoned.
V7 changes: added handling of GSO packets (patch 3 in the patchset added),
as suggested by BPF maintainers.
V8 changes:
- fixed build errors when LWT or IPV6 are not enabled;
- whitelisted TCP GSO instead of blacklisting SCTP and UDP GSO, as
suggested by Willem de Bruijn;
- added validation that pushed length cover needed headers when GRE/UDP
encap is detected, as suggested by Willem de Bruijn;- a couple of minor/stylistic tweaks/fixed typos.
V9 changes:
- fixed a kbuild test robot compiler warning;
- added ipv6_route_input to ipv6_stub (patch 4 in the patchset added), and IPv6 routing functions are now invoked via ipv6_stub, as suggested by David Ahern.
V10 changes:
- removed unnecessary IS_ENABLED and pr_warn_once from patch 5.
V11 changes: fixed a potential dst leak in patch 5, as suggested by
David Ahern.
Peter Oskolkov (7):
bpf: add plumbing for BPF_LWT_ENCAP_IP in bpf_lwt_push_encap
bpf: implement BPF_LWT_ENCAP_IP mode in bpf_lwt_push_encap
bpf: handle GSO in bpf_lwt_push_encap
ipv6_stub: add ipv6_route_input stub/proxy.
bpf: add handling of BPF_LWT_REROUTE to lwt_bpf.c
bpf: sync <kdir>/include/.../bpf.h with tools/include/.../bpf.h
selftests: bpf: add test_lwt_ip_encap selftest
include/net/addrconf.h | 1 + include/net/lwtunnel.h | 2 + include/uapi/linux/bpf.h | 26 +- net/core/filter.c | 49 ++- net/core/lwt_bpf.c | 254 +++++++++++++- net/ipv6/addrconf_core.c | 6 + net/ipv6/af_inet6.c | 7 + tools/include/uapi/linux/bpf.h | 26 +- tools/testing/selftests/bpf/Makefile | 3 +- .../selftests/bpf/progs/test_lwt_ip_encap.c | 85 +++++ .../selftests/bpf/test_lwt_ip_encap.sh | 311 ++++++++++++++++++ 11 files changed, 758 insertions(+), 12 deletions(-) create mode 100644 tools/testing/selftests/bpf/progs/test_lwt_ip_encap.c create mode 100755 tools/testing/selftests/bpf/test_lwt_ip_encap.sh
Signature · 1 line
2.20.1.791.gb4d0f1c61a-goog