summaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorAlexei Starovoitov <ast@kernel.org>2023-04-13 01:40:39 +0200
committerAlexei Starovoitov <ast@kernel.org>2023-04-13 01:40:40 +0200
commitbbc73e6855b80144cd43d165696f1ff56d6192c9 (patch)
tree970e66422694ac762f552c367514bc1ea3fc94fd /mm
parentbpf, sockmap: fix deadlocks in the sockhash and sockmap (diff)
parentselftests/bpf: Test FOU kfuncs for externally controlled ipip devices (diff)
downloadlinux-bbc73e6855b80144cd43d165696f1ff56d6192c9.tar.xz
linux-bbc73e6855b80144cd43d165696f1ff56d6192c9.zip
Merge branch 'Add FOU support for externally controlled ipip devices'
Christian Ehrig says: ==================== This patch set adds support for using FOU or GUE encapsulation with an ipip device operating in collect-metadata mode and a set of kfuncs for controlling encap parameters exposed to a BPF tc-hook. BPF tc-hooks allow us to read tunnel metadata (like remote IP addresses) in the ingress path of an externally controlled tunnel interface via the bpf_skb_get_tunnel_{key,opt} bpf-helpers. Packets can then be redirected to the same or a different externally controlled tunnel interface by overwriting metadata via the bpf_skb_set_tunnel_{key,opt} helpers and a call to bpf_redirect. This enables us to redirect packets between tunnel interfaces - and potentially change the encapsulation type - using only a single BPF program. Today this approach works fine for a couple of tunnel combinations. For example: redirecting packets between Geneve and GRE interfaces or GRE and plain ipip interfaces. However, redirecting using FOU or GUE is not supported today. The ip_tunnel module does not allow us to egress packets using additional UDP encapsulation from an ipip device in collect-metadata mode. Patch 1 lifts this restriction by adding a struct ip_tunnel_encap to the tunnel metadata. It can be filled by a new BPF kfunc introduced in Patch 2 and evaluated by the ip_tunnel egress path. This will allow us to use FOU and GUE encap with externally controlled ipip devices. Patch 2 introduces two new BPF kfuncs: bpf_skb_{set,get}_fou_encap. These helpers can be used to set and get UDP encap parameters from the BPF tc-hook doing the packet redirect. Patch 3 adds BPF tunnel selftests using the two kfuncs. --- v3: - Integrate selftest into test_progs (Alexei) v2: - Fixes for checkpatch.pl - Fixes for kernel test robot ==================== Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'mm')
0 files changed, 0 insertions, 0 deletions