linux-stable/drivers/net
Daniel Borkmann 14ca0751c9 bpf: support for access to tunnel options
After eBPF being able to programmatically access/manage tunnel key meta
data via commit d3aa45ce6b ("bpf: add helpers to access tunnel metadata")
and more recently also for IPv6 through c6c3345407 ("bpf: support ipv6
for bpf_skb_{set,get}_tunnel_key"), this work adds two complementary
helpers to generically access their auxiliary tunnel options.

Geneve and vxlan support this facility. For geneve, TLVs can be pushed,
and for the vxlan case its GBP extension. I.e. setting tunnel key for geneve
case only makes sense, if we can also read/write TLVs into it. In the GBP
case, it provides the flexibility to easily map the group policy ID in
combination with other helpers or maps.

I chose to model this as two separate helpers, bpf_skb_{set,get}_tunnel_opt(),
for a couple of reasons. bpf_skb_{set,get}_tunnel_key() is already rather
complex by itself, and there may be cases for tunnel key backends where
tunnel options are not always needed. If we would have integrated this
into bpf_skb_{set,get}_tunnel_key() nevertheless, we are very limited with
remaining helper arguments, so keeping compatibility on structs in case of
passing in a flat buffer gets more cumbersome. Separating both also allows
for more flexibility and future extensibility, f.e. options could be fed
directly from a map, etc.

Moreover, change geneve's xmit path to test only for info->options_len
instead of TUNNEL_GENEVE_OPT flag. This makes it more consistent with vxlan's
xmit path and allows for avoiding to specify a protocol flag in the API on
xmit, so it can be protocol agnostic. Having info->options_len is enough
information that is needed. Tested with vxlan and geneve.

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-03-08 13:58:46 -05:00
..
appletalk
arcnet
bonding net: bonding: use __ethtool_get_ksettings 2016-02-25 22:06:46 -05:00
caif
can Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2016-03-08 12:34:12 -05:00
cris
dsa net: dsa: mv88e6xxx: support VLAN filtering 2016-03-01 16:24:53 -05:00
ethernet Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2016-03-08 12:34:12 -05:00
fddi
fjes
hamradio
hippi
hyperv hv_netvsc: Move subchannel waiting to rndis_filter_device_remove() 2016-03-07 15:37:50 -05:00
ieee802154 mrf24j40: add writeable missing reg 2016-02-23 20:29:40 +01:00
ipvlan net: ipvlan: use __ethtool_get_ksettings 2016-02-25 22:06:46 -05:00
irda
phy Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2016-03-08 12:34:12 -05:00
plip
ppp Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2016-03-08 12:34:12 -05:00
slip
team net: team: use __ethtool_get_ksettings 2016-02-25 22:06:46 -05:00
usb Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2016-03-08 12:34:12 -05:00
vmxnet3 vmxnet3: avoid calling pskb_may_pull with interrupts disabled 2016-03-07 15:15:24 -05:00
wan wan: lmc: Switch to using managed resources 2016-03-02 13:43:03 -05:00
wimax
wireless Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2016-03-08 12:34:12 -05:00
xen-netback
dummy.c
eql.c
geneve.c bpf: support for access to tunnel options 2016-03-08 13:58:46 -05:00
ifb.c
Kconfig
LICENSE.SRC
loopback.c
macvlan.c net: macvlan: use __ethtool_get_ksettings 2016-02-25 22:06:46 -05:00
macvtap.c
Makefile
mdio.c
mii.c
netconsole.c
nlmon.c
ntb_netdev.c
rionet.c
sb1000.c
Space.c
sungem_phy.c
tun.c net/tun: implement ndo_set_rx_headroom 2016-03-01 15:54:30 -05:00
veth.c veth: implement ndo_set_rx_headroom 2016-03-01 15:54:31 -05:00
virtio_net.c
vrf.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2016-03-08 12:34:12 -05:00
vxlan.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2016-03-08 12:34:12 -05:00
xen-netfront.c