diff options
author | Christian Ehrig <cehrig@cloudflare.com> | 2023-04-07 15:38:54 +0200 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2023-04-12 16:40:39 -0700 |
commit | c50e96099edb134bf107fafc02715fbc4aa2277f (patch) | |
tree | 4c9aaa19e524055ea4c6e5b6ca6f11ca40fc4bd0 /net/ipv4/Makefile | |
parent | ac931d4cdec3df8b6eac3bc40a6871123021f078 (diff) | |
download | linux-c50e96099edb134bf107fafc02715fbc4aa2277f.tar.gz linux-c50e96099edb134bf107fafc02715fbc4aa2277f.tar.bz2 linux-c50e96099edb134bf107fafc02715fbc4aa2277f.zip |
bpf,fou: Add bpf_skb_{set,get}_fou_encap kfuncs
Add two new kfuncs that allow a BPF tc-hook, installed on an ipip
device in collect-metadata mode, to control FOU encap parameters on a
per-packet level. The set of kfuncs is registered with the fou module.
The bpf_skb_set_fou_encap kfunc is supposed to be used in tandem and after
a successful call to the bpf_skb_set_tunnel_key bpf-helper. UDP source and
destination ports can be controlled by passing a struct bpf_fou_encap. A
source port of zero will auto-assign a source port. enum bpf_fou_encap_type
is used to specify if the egress path should FOU or GUE encap the packet.
On the ingress path bpf_skb_get_fou_encap can be used to read UDP source
and destination ports from the receiver's point of view and allows for
packet multiplexing across different destination ports within a single
BPF program and ipip device.
Signed-off-by: Christian Ehrig <cehrig@cloudflare.com>
Link: https://lore.kernel.org/r/e17c94a646b63e78ce0dbf3f04b2c33dc948a32d.1680874078.git.cehrig@cloudflare.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'net/ipv4/Makefile')
-rw-r--r-- | net/ipv4/Makefile | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ipv4/Makefile b/net/ipv4/Makefile index 880277c9fd07..b18ba8ef93ad 100644 --- a/net/ipv4/Makefile +++ b/net/ipv4/Makefile @@ -26,7 +26,7 @@ obj-$(CONFIG_IP_MROUTE) += ipmr.o obj-$(CONFIG_IP_MROUTE_COMMON) += ipmr_base.o obj-$(CONFIG_NET_IPIP) += ipip.o gre-y := gre_demux.o -fou-y := fou_core.o fou_nl.o +fou-y := fou_core.o fou_nl.o fou_bpf.o obj-$(CONFIG_NET_FOU) += fou.o obj-$(CONFIG_NET_IPGRE_DEMUX) += gre.o obj-$(CONFIG_NET_IPGRE) += ip_gre.o |