2013-03-25 14:49:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-08-28 20:48:20 +02:00
|
|
|
|
2013-03-25 14:49:35 +00:00
|
|
|
|
|
|
|
|
|
2016-03-16 01:42:51 +01:00
|
|
|
|
|
|
|
|
|
2013-03-25 14:49:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-09-17 12:25:58 -07:00
|
|
|
|
2013-03-25 14:49:35 +00:00
|
|
|
|
2015-07-21 10:44:00 +02:00
|
|
|
|
2016-02-12 15:43:55 +01:00
|
|
|
|
2013-03-25 14:49:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-07-21 10:43:54 +02:00
|
|
|
|
2015-08-20 13:56:22 +02:00
|
|
|
|
2015-07-21 10:43:54 +02:00
|
|
|
|
2015-08-20 13:56:23 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-07-21 10:43:54 +02:00
|
|
|
|
|
|
|
|
|
2015-08-20 13:56:23 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-07-21 10:43:54 +02:00
|
|
|
|
2015-08-20 13:56:24 +02:00
|
|
|
|
|
|
|
|
|
2016-03-09 03:00:02 +01:00
|
|
|
|
2015-07-21 10:43:54 +02:00
|
|
|
|
|
|
|
|
|
2015-08-20 13:56:20 +02:00
|
|
|
|
2015-07-21 10:43:54 +02:00
|
|
|
|
2015-08-28 20:48:19 +02:00
|
|
|
|
|
|
|
|
|
2015-08-28 20:48:20 +02:00
|
|
|
|
2015-07-21 10:43:58 +02:00
|
|
|
|
2016-03-16 01:42:51 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-07-21 10:43:54 +02:00
|
|
|
|
|
|
|
|
|
2016-02-12 15:43:57 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-07-21 10:43:54 +02:00
|
|
|
|
2015-07-21 10:43:58 +02:00
|
|
|
|
2015-07-21 10:43:54 +02:00
|
|
|
|
|
|
|
|
|
2013-03-25 14:49:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-09-17 12:25:58 -07:00
|
|
|
|
2015-08-20 13:56:21 +02:00
|
|
|
|
|
|
|
|
|
2014-09-17 12:25:58 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-03-25 14:49:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-08-07 23:51:42 -07:00
|
|
|
|
|
|
|
|
|
2013-03-25 14:49:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-06-26 16:11:28 +02:00
|
|
|
|
2013-03-25 14:49:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-04-13 17:02:21 -07:00
|
|
|
|
2013-03-25 14:49:35 +00:00
|
|
|
|
|
|
|
|
|
2015-08-20 13:56:21 +02:00
|
|
|
|
|
|
|
|
|
2014-09-17 12:25:58 -07:00
|
|
|
|
2013-03-25 14:49:35 +00:00
|
|
|
|
2016-02-12 15:43:55 +01:00
|
|
|
|
2014-01-02 11:48:26 -08:00
|
|
|
|
2013-03-25 14:49:35 +00:00
|
|
|
|
|
|
|
|
|
2016-04-13 17:02:21 -07:00
|
|
|
|
2014-09-17 12:25:58 -07:00
|
|
|
|
|
|
|
|
|
2016-04-13 17:02:21 -07:00
|
|
|
|
2014-09-17 12:25:58 -07:00
|
|
|
|
2013-03-25 14:49:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-08-07 23:51:42 -07:00
|
|
|
|
2016-06-14 15:53:02 -06:00
|
|
|
|
2013-03-25 14:49:35 +00:00
|
|
|
|
|
|
|
|
|
2014-10-03 15:35:33 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-06-17 17:50:07 -07:00
|
|
|
|
2014-10-03 15:35:33 -07:00
|
|
|
|
|
|
|
|
|
2015-01-15 03:53:59 +01:00
|
|
|
|
|
|
|
|
|
bpf, vxlan, geneve, gre: fix usage of dst_cache on xmit
The assumptions from commit 0c1d70af924b ("net: use dst_cache for vxlan
device"), 468dfffcd762 ("geneve: add dst caching support") and 3c1cb4d2604c
("net/ipv4: add dst cache support for gre lwtunnels") on dst_cache usage
when ip_tunnel_info is used is unfortunately not always valid as assumed.
While it seems correct for ip_tunnel_info front-ends such as OVS, eBPF
however can fill in ip_tunnel_info for consumers like vxlan, geneve or gre
with different remote dsts, tos, etc, therefore they cannot be assumed as
packet independent.
Right now vxlan, geneve, gre would cache the dst for eBPF and every packet
would reuse the same entry that was first created on the initial route
lookup. eBPF doesn't store/cache the ip_tunnel_info, so each skb may have
a different one.
Fix it by adding a flag that checks the ip_tunnel_info. Also the !tos test
in vxlan needs to be handeled differently in this context as it is currently
inferred from ip_tunnel_info as well if present. ip_tunnel_dst_cache_usable()
helper is added for the three tunnel cases, which checks if we can use dst
cache.
Fixes: 0c1d70af924b ("net: use dst_cache for vxlan device")
Fixes: 468dfffcd762 ("geneve: add dst caching support")
Fixes: 3c1cb4d2604c ("net/ipv4: add dst cache support for gre lwtunnels")
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Paolo Abeni <pabeni@redhat.com>
Acked-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-03-04 15:15:07 +01:00
|
|
|
|
2015-01-15 03:53:59 +01:00
|
|
|
|
|
|
|
|
|
2013-03-25 14:49:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-06-18 21:52:05 -07:00
|
|
|
|
2013-03-25 14:49:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-05-03 17:10:08 +02:00
|
|
|
|
2013-03-25 14:49:35 +00:00
|
|
|
|
2013-08-05 22:51:37 -07:00
|
|
|
|
2013-03-25 14:49:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-08-05 22:51:37 -07:00
|
|
|
|
2015-08-07 23:51:42 -07:00
|
|
|
|
2013-03-25 14:49:35 +00:00
|
|
|
|
|
|
|
|
|
2015-08-30 18:09:38 -07:00
|
|
|
|
|
|
|
|
|
2016-03-09 03:00:02 +01:00
|
|
|
|
2015-08-30 18:09:38 -07:00
|
|
|
|
|
|
|
|
|
2015-07-21 10:43:54 +02:00
|
|
|
|
2015-08-30 18:09:38 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-08-20 13:56:23 +02:00
|
|
|
|
2015-08-30 18:09:38 -07:00
|
|
|
|
|
|
|
|
|
2016-03-09 03:00:02 +01:00
|
|
|
|
2015-08-30 18:09:38 -07:00
|
|
|
|
2015-07-21 10:43:54 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-08-30 18:09:38 -07:00
|
|
|
|
|
|
|
|
|
2015-07-21 10:43:54 +02:00
|
|
|
|
|
|
|
|
|
2015-08-30 18:09:38 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-07-21 10:43:54 +02:00
|
|
|
|
|
|
|
|
|
bpf, vxlan, geneve, gre: fix usage of dst_cache on xmit
The assumptions from commit 0c1d70af924b ("net: use dst_cache for vxlan
device"), 468dfffcd762 ("geneve: add dst caching support") and 3c1cb4d2604c
("net/ipv4: add dst cache support for gre lwtunnels") on dst_cache usage
when ip_tunnel_info is used is unfortunately not always valid as assumed.
While it seems correct for ip_tunnel_info front-ends such as OVS, eBPF
however can fill in ip_tunnel_info for consumers like vxlan, geneve or gre
with different remote dsts, tos, etc, therefore they cannot be assumed as
packet independent.
Right now vxlan, geneve, gre would cache the dst for eBPF and every packet
would reuse the same entry that was first created on the initial route
lookup. eBPF doesn't store/cache the ip_tunnel_info, so each skb may have
a different one.
Fix it by adding a flag that checks the ip_tunnel_info. Also the !tos test
in vxlan needs to be handeled differently in this context as it is currently
inferred from ip_tunnel_info as well if present. ip_tunnel_dst_cache_usable()
helper is added for the three tunnel cases, which checks if we can use dst
cache.
Fixes: 0c1d70af924b ("net: use dst_cache for vxlan device")
Fixes: 468dfffcd762 ("geneve: add dst caching support")
Fixes: 3c1cb4d2604c ("net/ipv4: add dst cache support for gre lwtunnels")
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Paolo Abeni <pabeni@redhat.com>
Acked-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-03-04 15:15:07 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-08-28 20:48:20 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-09-08 16:23:45 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-06-21 16:17:11 -07:00
|
|
|
|
|
|
|
|
|
2013-03-25 14:49:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-01-15 15:11:17 +01:00
|
|
|
|
2015-04-02 17:07:02 +02:00
|
|
|
|
2013-06-07 13:26:05 -07:00
|
|
|
|
|
|
|
|
|
2013-03-25 14:49:35 +00:00
|
|
|
|
2013-08-13 17:51:11 +02:00
|
|
|
|
2013-03-25 14:49:35 +00:00
|
|
|
|
|
|
|
|
|
2013-05-27 23:48:15 +00:00
|
|
|
|
2016-09-15 13:00:29 -07:00
|
|
|
|
|
|
|
|
|
2013-03-25 14:49:35 +00:00
|
|
|
|
vxlan, gre, geneve: Set a large MTU on ovs-created tunnel devices
Prior to 4.3, openvswitch tunnel vports (vxlan, gre and geneve) could
transmit vxlan packets of any size, constrained only by the ability to
send out the resulting packets. 4.3 introduced netdevs corresponding
to tunnel vports. These netdevs have an MTU, which limits the size of
a packet that can be successfully encapsulated. The default MTU
values are low (1500 or less), which is awkwardly small in the context
of physical networks supporting jumbo frames, and leads to a
conspicuous change in behaviour for userspace.
Instead, set the MTU on openvswitch-created netdevs to be the relevant
maximum (i.e. the maximum IP packet size minus any relevant overhead),
effectively restoring the behaviour prior to 4.3.
Signed-off-by: David Wragg <david@weave.works>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-02-10 00:05:58 +00:00
|
|
|
|
2013-03-25 14:49:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-08-07 23:51:42 -07:00
|
|
|
|
|
|
|
|
|
2013-03-25 14:49:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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24 14:34:54 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-09-22 18:12:11 +02:00
|
|
|
|
|
|
|
|
|
2013-06-17 17:49:56 -07:00
|
|
|
|
2016-04-14 15:33:37 -04:00
|
|
|
|
2013-10-19 11:42:55 -07:00
|
|
|
|
2016-03-19 09:32:02 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-12-24 14:34:54 -08:00
|
|
|
|
2013-03-25 14:49:35 +00:00
|
|
|
|
2015-12-24 14:34:54 -08:00
|
|
|
|
|
|
|
|
|
2013-03-25 14:49:35 +00:00
|
|
|
|
|
|
|
|
|
2015-12-24 14:34:54 -08:00
|
|
|
|
2013-03-25 14:49:35 +00:00
|
|
|
|
|
|
|
|
|
ip_tunnel: disable preemption when updating per-cpu tstats
Drivers like vxlan use the recently introduced
udp_tunnel_xmit_skb/udp_tunnel6_xmit_skb APIs. udp_tunnel6_xmit_skb
makes use of ip6tunnel_xmit, and ip6tunnel_xmit, after sending the
packet, updates the struct stats using the usual
u64_stats_update_begin/end calls on this_cpu_ptr(dev->tstats).
udp_tunnel_xmit_skb makes use of iptunnel_xmit, which doesn't touch
tstats, so drivers like vxlan, immediately after, call
iptunnel_xmit_stats, which does the same thing - calls
u64_stats_update_begin/end on this_cpu_ptr(dev->tstats).
While vxlan is probably fine (I don't know?), calling a similar function
from, say, an unbound workqueue, on a fully preemptable kernel causes
real issues:
[ 188.434537] BUG: using smp_processor_id() in preemptible [00000000] code: kworker/u8:0/6
[ 188.435579] caller is debug_smp_processor_id+0x17/0x20
[ 188.435583] CPU: 0 PID: 6 Comm: kworker/u8:0 Not tainted 4.2.6 #2
[ 188.435607] Call Trace:
[ 188.435611] [<ffffffff8234e936>] dump_stack+0x4f/0x7b
[ 188.435615] [<ffffffff81915f3d>] check_preemption_disabled+0x19d/0x1c0
[ 188.435619] [<ffffffff81915f77>] debug_smp_processor_id+0x17/0x20
The solution would be to protect the whole
this_cpu_ptr(dev->tstats)/u64_stats_update_begin/end blocks with
disabling preemption and then reenabling it.
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Acked-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2015-11-12 17:35:58 +01:00
|
|
|
|
2013-03-25 14:49:35 +00:00
|
|
|
|
2015-12-24 14:34:54 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-03-25 14:49:35 +00:00
|
|
|
|
|
|
|
|
|
2013-06-21 16:17:11 -07:00
|
|
|
|
2015-08-30 18:09:38 -07:00
|
|
|
|
2015-07-21 10:43:58 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-08-30 18:09:38 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-07-21 10:44:00 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-07-21 10:44:01 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-07-23 10:08:44 +02:00
|
|
|
|
|
|
|
|
|
2015-07-21 10:44:01 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-07-22 14:43:58 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-03-08 23:36:03 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-06-21 16:17:11 -07:00
|
|
|
|
|
|
|
|
|
2013-03-25 14:49:35 +00:00
|
|
|
|