<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/include/net/ip6_tunnel.h, branch v4.5</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v4.5</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v4.5'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2016-01-05T02:50:51Z</updated>
<entry>
<title>net: make ip6tunnel_xmit definition conditional</title>
<updated>2016-01-05T02:50:51Z</updated>
<author>
<name>Arnd Bergmann</name>
<email>arnd@arndb.de</email>
</author>
<published>2016-01-01T12:18:48Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=0efeff2905d0ea14f2ee83e6cefbda35ee8cf6fc'/>
<id>urn:sha1:0efeff2905d0ea14f2ee83e6cefbda35ee8cf6fc</id>
<content type='text'>
Moving the caller of iptunnel_xmit_stats causes a build error in
randconfig builds that disable CONFIG_INET:

In file included from ../net/xfrm/xfrm_input.c:17:0:
../include/net/ip6_tunnel.h: In function 'ip6tunnel_xmit':
../include/net/ip6_tunnel.h:93:2: error: implicit declaration of function 'iptunnel_xmit_stats' [-Werror=implicit-function-declaration]
  iptunnel_xmit_stats(dev, pkt_len);

The reason is that the iptunnel_xmit_stats definition is hidden
inside #ifdef CONFIG_INET but the caller is not. We can change
one or the other to fix it, and this patch adds a second #ifdef
around ip6tunnel_xmit() to avoid seeing the invalid call.

Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Fixes: 039f50629b7f ("ip_tunnel: Move stats update to iptunnel_xmit()")
Acked-by: Pravin B Shelar &lt;pshelar@nicira.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>ip_tunnel: Move stats update to iptunnel_xmit()</title>
<updated>2015-12-26T04:32:23Z</updated>
<author>
<name>Pravin B Shelar</name>
<email>pshelar@nicira.com</email>
</author>
<published>2015-12-24T22:34:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=039f50629b7f860f36644ed1f34b27da9aa62f43'/>
<id>urn:sha1:039f50629b7f860f36644ed1f34b27da9aa62f43</id>
<content type='text'>
By moving stats update into iptunnel_xmit(), we can simplify
iptunnel_xmit() usage. With this change there is no need to
call another function (iptunnel_xmit_stats()) to update stats
in tunnel xmit code path.

Signed-off-by: Pravin B Shelar &lt;pshelar@nicira.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>ip_tunnel: disable preemption when updating per-cpu tstats</title>
<updated>2015-11-16T19:14:32Z</updated>
<author>
<name>Jason A. Donenfeld</name>
<email>Jason@zx2c4.com</email>
</author>
<published>2015-11-12T16:35:58Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=b4fe85f9c9146f60457e9512fb6055e69e6a7a65'/>
<id>urn:sha1:b4fe85f9c9146f60457e9512fb6055e69e6a7a65</id>
<content type='text'>
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-&gt;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-&gt;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]  [&lt;ffffffff8234e936&gt;] dump_stack+0x4f/0x7b
[  188.435615]  [&lt;ffffffff81915f3d&gt;] check_preemption_disabled+0x19d/0x1c0
[  188.435619]  [&lt;ffffffff81915f77&gt;] debug_smp_processor_id+0x17/0x20

The solution would be to protect the whole
this_cpu_ptr(dev-&gt;tstats)/u64_stats_update_begin/end blocks with
disabling preemption and then reenabling it.

Signed-off-by: Jason A. Donenfeld &lt;Jason@zx2c4.com&gt;
Acked-by: Hannes Frederic Sowa &lt;hannes@stressinduktion.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>ipv4, ipv6: Pass net into ip_local_out and ip6_local_out</title>
<updated>2015-10-08T11:27:02Z</updated>
<author>
<name>Eric W. Biederman</name>
<email>ebiederm@xmission.com</email>
</author>
<published>2015-10-07T21:48:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=33224b16ffccb49cf798317670389e0bfba0024c'/>
<id>urn:sha1:33224b16ffccb49cf798317670389e0bfba0024c</id>
<content type='text'>
Signed-off-by: "Eric W. Biederman" &lt;ebiederm@xmission.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>ipv6: Merge ip6_local_out and ip6_local_out_sk</title>
<updated>2015-10-08T11:26:58Z</updated>
<author>
<name>Eric W. Biederman</name>
<email>ebiederm@xmission.com</email>
</author>
<published>2015-10-07T21:48:40Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=792883303cdb3a7edd16017d7aba53926189ef41'/>
<id>urn:sha1:792883303cdb3a7edd16017d7aba53926189ef41</id>
<content type='text'>
Stop hidding the sk parameter with an inline helper function and make
all of the callers pass it, so that it is clear what the function is
doing.

Signed-off-by: "Eric W. Biederman" &lt;ebiederm@xmission.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>ip6tunnel: make rx/tx bytes counters consistent</title>
<updated>2015-09-21T05:36:42Z</updated>
<author>
<name>Nicolas Dichtel</name>
<email>nicolas.dichtel@6wind.com</email>
</author>
<published>2015-09-18T09:47:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=83cf9a2521b0934a5f9d04082c9bb4f554fddcd4'/>
<id>urn:sha1:83cf9a2521b0934a5f9d04082c9bb4f554fddcd4</id>
<content type='text'>
Like the previous patch, which fixes ipv4 tunnels, here is the ipv6 part.

Before the patch, the external ipv6 header + gre header were included on
tx.

After the patch:
$ ping -c1 192.168.6.121 ; ip -s l ls dev ip6gre1
PING 192.168.6.121 (192.168.6.121) 56(84) bytes of data.
64 bytes from 192.168.6.121: icmp_req=1 ttl=64 time=1.92 ms

--- 192.168.6.121 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 1.923/1.923/1.923/0.000 ms
7: ip6gre1@NONE: &lt;POINTOPOINT,NOARP,UP,LOWER_UP&gt; mtu 1440 qdisc noqueue state UNKNOWN mode DEFAULT group default
    link/gre6 20:01:06:60:30:08:c1:c3:00:00:00:00:00:00:01:23 peer 20:01:06:60:30:08:c1:c3:00:00:00:00:00:00:01:21
    RX: bytes  packets  errors  dropped overrun mcast
    84         1        0       0       0       0
    TX: bytes  packets  errors  dropped carrier collsns
    84         1        0       0       0       0
$ ping -c1 192.168.1.121 ; ip -s l ls dev ip6tnl1
PING 192.168.1.121 (192.168.1.121) 56(84) bytes of data.
64 bytes from 192.168.1.121: icmp_req=1 ttl=64 time=2.28 ms

--- 192.168.1.121 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 2.288/2.288/2.288/0.000 ms
8: ip6tnl1@NONE: &lt;POINTOPOINT,NOARP,UP,LOWER_UP&gt; mtu 1452 qdisc noqueue state UNKNOWN mode DEFAULT group default
    link/tunnel6 2001:660:3008:c1c3::123 peer 2001:660:3008:c1c3::121
    RX: bytes  packets  errors  dropped overrun mcast
    84         1        0       0       0       0
    TX: bytes  packets  errors  dropped carrier collsns
    84         1        0       0       0       0

Signed-off-by: Nicolas Dichtel &lt;nicolas.dichtel@6wind.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>ipv6: Replace spinlock with seqlock and rcu in ip6_tunnel</title>
<updated>2015-09-15T21:53:05Z</updated>
<author>
<name>Martin KaFai Lau</name>
<email>kafai@fb.com</email>
</author>
<published>2015-09-15T21:30:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=70da5b5c532f0ec8aa76b4f46158da5f010f34b3'/>
<id>urn:sha1:70da5b5c532f0ec8aa76b4f46158da5f010f34b3</id>
<content type='text'>
This patch uses a seqlock to ensure consistency between idst-&gt;dst and
idst-&gt;cookie.  It also makes dst freeing from fib tree to undergo a
rcu grace period.

Signed-off-by: Martin KaFai Lau &lt;kafai@fb.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>ipv6: Fix dst_entry refcnt bugs in ip6_tunnel</title>
<updated>2015-09-15T21:53:05Z</updated>
<author>
<name>Martin KaFai Lau</name>
<email>kafai@fb.com</email>
</author>
<published>2015-09-15T21:30:07Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=cdf3464e6c6bd764277cbbe992cd12da735b92fb'/>
<id>urn:sha1:cdf3464e6c6bd764277cbbe992cd12da735b92fb</id>
<content type='text'>
Problems in the current dst_entry cache in the ip6_tunnel:

1. ip6_tnl_dst_set is racy.  There is no lock to protect it:
   - One major problem is that the dst refcnt gets messed up. F.e.
     the same dst_cache can be released multiple times and then
     triggering the infamous dst refcnt &lt; 0 warning message.
   - Another issue is the inconsistency between dst_cache and
     dst_cookie.

   It can be reproduced by adding and removing the ip6gre tunnel
   while running a super_netperf TCP_CRR test.

2. ip6_tnl_dst_get does not take the dst refcnt before returning
   the dst.

This patch:
1. Create a percpu dst_entry cache in ip6_tnl
2. Use a spinlock to protect the dst_cache operations
3. ip6_tnl_dst_get always takes the dst refcnt before returning

Signed-off-by: Martin KaFai Lau &lt;kafai@fb.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>ipv6: Rename the dst_cache helper functions in ip6_tunnel</title>
<updated>2015-09-15T21:53:04Z</updated>
<author>
<name>Martin KaFai Lau</name>
<email>kafai@fb.com</email>
</author>
<published>2015-09-15T21:30:06Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=f230d1e891ba1da5953460516960894154f265db'/>
<id>urn:sha1:f230d1e891ba1da5953460516960894154f265db</id>
<content type='text'>
It is a prep work to fix the dst_entry refcnt bugs in
ip6_tunnel.

This patch rename:
1. ip6_tnl_dst_check() to ip6_tnl_dst_get() to better
   reflect that it will take a dst refcnt in the next patch.
2. ip6_tnl_dst_store() to ip6_tnl_dst_set() to have a more
   conventional name matching with ip6_tnl_dst_get().

Signed-off-by: Martin KaFai Lau &lt;kafai@fb.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>udp_tunnel: Pass UDP socket down through udp_tunnel{, 6}_xmit_skb().</title>
<updated>2015-04-07T19:29:08Z</updated>
<author>
<name>David Miller</name>
<email>davem@davemloft.net</email>
</author>
<published>2015-04-06T02:19:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=79b16aadea32cce077acbe9e229fcb58a7801687'/>
<id>urn:sha1:79b16aadea32cce077acbe9e229fcb58a7801687</id>
<content type='text'>
That was we can make sure the output path of ipv4/ipv6 operate on
the UDP socket rather than whatever random thing happens to be in
skb-&gt;sk.

Based upon a patch by Jiri Pirko.

Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Acked-by: Hannes Frederic Sowa &lt;hannes@stressinduktion.org&gt;
</content>
</entry>
</feed>
