linux-sg2042/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 defxx: fix build warning 2016-01-25 10:51:52 -08:00
fjes
hamradio dmascc: Return correct error codes 2016-02-16 15:32:34 -05:00
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 net/irda: bfin_sir: remove duplicate defines 2016-01-21 10:45:45 -08:00
phy Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2016-03-08 12:34:12 -05:00
plip net: plip: use new parport device model 2016-01-09 21:02:05 -05:00
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 xen-netback: implement dynamic multicast control 2016-02-07 13:58:36 -05:00
Kconfig
LICENSE.SRC
Makefile
Space.c
dummy.c
eql.c
geneve.c bpf: support for access to tunnel options 2016-03-08 13:58:46 -05:00
ifb.c
loopback.c sctp: Rename NETIF_F_SCTP_CSUM to NETIF_F_SCTP_CRC 2015-12-15 16:49:58 -05:00
macvlan.c net: macvlan: use __ethtool_get_ksettings 2016-02-25 22:06:46 -05:00
macvtap.c net: Rename NETIF_F_ALL_CSUM to NETIF_F_CSUM_MASK 2015-12-15 16:50:08 -05:00
mdio.c
mii.c
netconsole.c
nlmon.c
ntb_netdev.c
rionet.c
sb1000.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 virtio_net: validate ethtool port setting and explain the user validation 2016-02-11 11:55:38 -05:00
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 xen-netfront: request Tx response events more often 2016-01-28 16:08:55 -08:00