* sit tunnel slow since added GSO/TSO support @ 2013-12-13 16:13 Michal Schmidt 2013-12-13 16:28 ` Eric Dumazet 2013-12-16 14:31 ` [PATCH] ipv6: sit: update mtu check to take care of gso packets Eric Dumazet 0 siblings, 2 replies; 11+ messages in thread From: Michal Schmidt @ 2013-12-13 16:13 UTC (permalink / raw) To: netdev@vger.kernel.org; +Cc: Eric Dumazet Hello, I've been experimenting with IPIP and SIT tunnels. Both of them had the support for GSO/TSO added recently, by commits: cb32f511a7 "ipip: add GSO/TSO support" 61c1db7fae "ipv6: sit: add GSO/TSO support" IPIP works fine for me. I am seeing very low TCP performance with SIT if TSO is enabled on the SIT interface. It does not matter if the underlying hardware supports NETIF_F_GSO_SIT or not (I have tested with bnx2x and tg3). This is for example with TSO on a 1Gb interface: $ netperf -H 2001:0DB8:1234::000e MIGRATED TCP STREAM TEST from ::0 (::) port 0 AF_INET6 to 2001:0DB8:1234::000e () port 0 AF_INET6 Recv Send Send Socket Socket Message Elapsed Size Size Size Time Throughput bytes bytes bytes secs. 10^6bits/sec 87380 16384 16384 10.00 35.92 After "ethtool -K sittun tso off": $ netperf -H 2001:0DB8:1234::000e MIGRATED TCP STREAM TEST from ::0 (::) port 0 AF_INET6 to 2001:0DB8:1234::000e () port 0 AF_INET6 Recv Send Send Socket Socket Message Elapsed Size Size Size Time Throughput bytes bytes bytes secs. 10^6bits/sec 87380 16384 16384 10.01 706.86 After looking into what was happening I discovered that in the TSO-enabled case big skbs enters into ipip6_tunnel_xmit() where they are dropped by this branch: if (df) { /* ... */ if (skb->len > mtu) { icmpv6_send(skb, ICMPV6_PKT_TOOBIG, 0, mtu); ip_rt_put(rt); goto tx_error; } } After having looked at the meaning of "df" I found that I can use the "nopmtudisc" option when creating the sit tunnel to work around the problem: ip tun add sittun mode sit remote $REMOTE local $LOCAL dev $IFACE nopmtudisc With "nopmtudisc" and TSO enabled: $ netperf -H 2001:0DB8:1234::000e MIGRATED TCP STREAM TEST from ::0 (::) port 0 AF_INET6 to 2001:0DB8:1234::000e () port 0 AF_INET6 Recv Send Send Socket Socket Message Elapsed Size Size Size Time Throughput bytes bytes bytes secs. 10^6bits/sec 87380 16384 16384 10.01 716.85 Regards, Michal ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: sit tunnel slow since added GSO/TSO support 2013-12-13 16:13 sit tunnel slow since added GSO/TSO support Michal Schmidt @ 2013-12-13 16:28 ` Eric Dumazet 2013-12-13 22:54 ` Eric Dumazet 2013-12-16 14:31 ` [PATCH] ipv6: sit: update mtu check to take care of gso packets Eric Dumazet 1 sibling, 1 reply; 11+ messages in thread From: Eric Dumazet @ 2013-12-13 16:28 UTC (permalink / raw) To: Michal Schmidt; +Cc: netdev@vger.kernel.org, Eric Dumazet On Fri, 2013-12-13 at 17:13 +0100, Michal Schmidt wrote: > Hello, > > I've been experimenting with IPIP and SIT tunnels. Both of them > had the support for GSO/TSO added recently, by commits: > cb32f511a7 "ipip: add GSO/TSO support" > 61c1db7fae "ipv6: sit: add GSO/TSO support" > > IPIP works fine for me. > > I am seeing very low TCP performance with SIT if TSO is enabled on the > SIT interface. It does not matter if the underlying hardware supports > NETIF_F_GSO_SIT or not (I have tested with bnx2x and tg3). Strange, my tests were done on bnx2x, and TSO was definitely working ... I'll take a look, thanks ! ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: sit tunnel slow since added GSO/TSO support 2013-12-13 16:28 ` Eric Dumazet @ 2013-12-13 22:54 ` Eric Dumazet 2013-12-14 21:25 ` Michal Schmidt 0 siblings, 1 reply; 11+ messages in thread From: Eric Dumazet @ 2013-12-13 22:54 UTC (permalink / raw) To: Michal Schmidt; +Cc: netdev@vger.kernel.org, Eric Dumazet On Fri, 2013-12-13 at 08:28 -0800, Eric Dumazet wrote: > On Fri, 2013-12-13 at 17:13 +0100, Michal Schmidt wrote: > > Hello, > > > > I've been experimenting with IPIP and SIT tunnels. Both of them > > had the support for GSO/TSO added recently, by commits: > > cb32f511a7 "ipip: add GSO/TSO support" > > 61c1db7fae "ipv6: sit: add GSO/TSO support" > > > > IPIP works fine for me. > > > > I am seeing very low TCP performance with SIT if TSO is enabled on the > > SIT interface. It does not matter if the underlying hardware supports > > NETIF_F_GSO_SIT or not (I have tested with bnx2x and tg3). > > Strange, my tests were done on bnx2x, and TSO was definitely working ... > > I'll take a look, thanks ! I tried the same setup than before and got good behavior on current net-next kernel modprobe sit ip link set sit0 up ip -6 addr add dev sit0 2002:af6:1153::/64 ip -6 ro add 2002:a00::/24 via fe80:: dev sit0 ./netperf -H 2002:af6:1154:: MIGRATED TCP STREAM TEST from ::0 (::) port 0 AF_INET6 to 2002:af6:1154:: () port 0 AF_INET6 Recv Send Send Socket Socket Message Elapsed Size Size Size Time Throughput bytes bytes bytes secs. 10^6bits/sec 87380 16384 16384 10.00 6703.45 14:51:59.664613 IP 10.246.17.83 > 10.246.17.84: IP6 2002:af6:1153::.47324 > 2002:af6:1154::.49917: S 4047734761:4047734761(0) win 28400 <mss 1420,sackOK,timestamp 3668787 0,nop,wscale 6> 14:51:59.664791 IP 10.246.17.84 > 10.246.17.83: IP6 2002:af6:1154::.49917 > 2002:af6:1153::.47324: S 850000541:850000541(0) ack 4047734762 win 28160 <mss 1420,sackOK,timestamp 3668673 3668787,nop,wscale 6> 14:51:59.664825 IP 10.246.17.83 > 10.246.17.84: IP6 2002:af6:1153::.47324 > 2002:af6:1154::.49917: . ack 1 win 444 <nop,nop,timestamp 3668787 3668673> 14:51:59.664854 IP 10.246.17.83 > 10.246.17.84: IP6 2002:af6:1153::.47324 > 2002:af6:1154::.49917: . 1:14081(14080) ack 1 win 444 <nop,nop,timestamp 3668787 3668673> 14:51:59.665028 IP 10.246.17.84 > 10.246.17.83: IP6 2002:af6:1154::.49917 > 2002:af6:1153::.47324: . ack 1409 win 484 <nop,nop,timestamp 3668673 3668787> 14:51:59.665030 IP 10.246.17.84 > 10.246.17.83: IP6 2002:af6:1154::.49917 > 2002:af6:1153::.47324: . ack 2817 win 528 <nop,nop,timestamp 3668673 3668787> 14:51:59.665031 IP 10.246.17.84 > 10.246.17.83: IP6 2002:af6:1154::.49917 > 2002:af6:1153::.47324: . ack 4225 win 572 <nop,nop,timestamp 3668673 3668787> 14:51:59.665051 IP 10.246.17.84 > 10.246.17.83: IP6 2002:af6:1154::.49917 > 2002:af6:1153::.47324: . ack 5633 win 616 <nop,nop,timestamp 3668673 3668787> 14:51:59.665083 IP 10.246.17.83 > 10.246.17.84: IP6 2002:af6:1153::.47324 > 2002:af6:1154::.49917: . 14081:19713(5632) ack 1 win 444 <nop,nop,timestamp 3668788 3668673> 14:51:59.665052 IP 10.246.17.84 > 10.246.17.83: IP6 2002:af6:1154::.49917 > 2002:af6:1153::.47324: . ack 7041 win 660 <nop,nop,timestamp 3668673 3668787> 14:51:59.665054 IP 10.246.17.84 > 10.246.17.83: IP6 2002:af6:1154::.49917 > 2002:af6:1153::.47324: . ack 8449 win 704 <nop,nop,timestamp 3668673 3668787> 14:51:59.665080 IP 10.246.17.84 > 10.246.17.83: IP6 2002:af6:1154::.49917 > 2002:af6:1153::.47324: . ack 9857 win 748 <nop,nop,timestamp 3668674 3668787> 14:51:59.665082 IP 10.246.17.84 > 10.246.17.83: IP6 2002:af6:1154::.49917 > 2002:af6:1153::.47324: . ack 11265 win 792 <nop,nop,timestamp 3668674 3668787> 14:51:59.665083 IP 10.246.17.84 > 10.246.17.83: IP6 2002:af6:1154::.49917 > 2002:af6:1153::.47324: . ack 12673 win 836 <nop,nop,timestamp 3668674 3668787> 14:51:59.665116 IP 10.246.17.83 > 10.246.17.84: IP6 2002:af6:1153::.47324 > 2002:af6:1154::.49917: . 19713:28161(8448) ack 1 win 444 <nop,nop,timestamp 3668788 3668673> 14:51:59.665101 IP 10.246.17.84 > 10.246.17.83: IP6 2002:af6:1154::.49917 > 2002:af6:1153::.47324: . ack 14081 win 880 <nop,nop,timestamp 3668674 3668787> 14:51:59.665127 IP 10.246.17.83 > 10.246.17.84: IP6 2002:af6:1153::.47324 > 2002:af6:1154::.49917: . 28161:36609(8448) ack 1 win 444 <nop,nop,timestamp 3668788 3668674> 14:51:59.665177 IP 10.246.17.83 > 10.246.17.84: IP6 2002:af6:1153::.47324 > 2002:af6:1154::.49917: . 36609:42241(5632) ack 1 win 444 <nop,nop,timestamp 3668788 3668674> 14:51:59.665131 IP 10.246.17.84 > 10.246.17.83: IP6 2002:af6:1154::.49917 > 2002:af6:1153::.47324: . ack 15489 win 924 <nop,nop,timestamp 3668674 3668788> 14:51:59.665133 IP 10.246.17.84 > 10.246.17.83: IP6 2002:af6:1154::.49917 > 2002:af6:1153::.47324: . ack 16897 win 968 <nop,nop,timestamp 3668674 3668788> 14:51:59.665178 IP 10.246.17.84 > 10.246.17.83: IP6 2002:af6:1154::.49917 > 2002:af6:1153::.47324: . ack 18305 win 1012 <nop,nop,timestamp 3668674 3668788> 14:51:59.665179 IP 10.246.17.84 > 10.246.17.83: IP6 2002:af6:1154::.49917 > 2002:af6:1153::.47324: . ack 19713 win 1056 <nop,nop,timestamp 3668674 3668788> 14:51:59.665214 IP 10.246.17.83 > 10.246.17.84: IP6 2002:af6:1153::.47324 > 2002:af6:1154::.49917: . 42241:53505(11264) ack 1 win 444 <nop,nop,timestamp 3668788 3668674> 14:51:59.665227 IP 10.246.17.84 > 10.246.17.83: IP6 2002:af6:1154::.49917 > 2002:af6:1153::.47324: . ack 21121 win 1100 <nop,nop,timestamp 3668674 3668788> 14:51:59.665248 IP 10.246.17.84 > 10.246.17.83: IP6 2002:af6:1154::.49917 > 2002:af6:1153::.47324: . ack 22529 win 1144 <nop,nop,timestamp 3668674 3668788> 14:51:59.665249 IP 10.246.17.84 > 10.246.17.83: IP6 2002:af6:1154::.49917 > 2002:af6:1153::.47324: . ack 23937 win 1188 <nop,nop,timestamp 3668674 3668788> 14:51:59.665273 IP 10.246.17.83 > 10.246.17.84: IP6 2002:af6:1153::.47324 > 2002:af6:1154::.49917: . 53505:61953(8448) ack 1 win 444 <nop,nop,timestamp 3668788 3668674> 14:51:59.665271 IP 10.246.17.84 > 10.246.17.83: IP6 2002:af6:1154::.49917 > 2002:af6:1153::.47324: . ack 25345 win 1232 <nop,nop,timestamp 3668674 3668788> 14:51:59.665272 IP 10.246.17.84 > 10.246.17.83: IP6 2002:af6:1154::.49917 > 2002:af6:1153::.47324: . ack 26753 win 1276 <nop,nop,timestamp 3668674 3668788> 14:51:59.665275 IP 10.246.17.84 > 10.246.17.83: IP6 2002:af6:1154::.49917 > 2002:af6:1153::.47324: . ack 28161 win 1320 <nop,nop,timestamp 3668674 3668788> 14:51:59.665278 IP 10.246.17.84 > 10.246.17.83: IP6 2002:af6:1154::.49917 > 2002:af6:1153::.47324: . ack 29569 win 1364 <nop,nop,timestamp 3668674 3668788> 14:51:59.665279 IP 10.246.17.84 > 10.246.17.83: IP6 2002:af6:1154::.49917 > 2002:af6:1153::.47324: . ack 30977 win 1408 <nop,nop,timestamp 3668674 3668788> 14:51:59.665279 IP 10.246.17.84 > 10.246.17.83: IP6 2002:af6:1154::.49917 > 2002:af6:1153::.47324: . ack 32385 win 1452 <nop,nop,timestamp 3668674 3668788> 14:51:59.665280 IP 10.246.17.84 > 10.246.17.83: IP6 2002:af6:1154::.49917 > 2002:af6:1153::.47324: . ack 33793 win 1496 <nop,nop,timestamp 3668674 3668788> 14:51:59.665281 IP 10.246.17.84 > 10.246.17.83: IP6 2002:af6:1154::.49917 > 2002:af6:1153::.47324: . ack 35201 win 1540 <nop,nop,timestamp 3668674 3668788> 14:51:59.665281 IP 10.246.17.84 > 10.246.17.83: IP6 2002:af6:1154::.49917 > 2002:af6:1153::.47324: . ack 36609 win 1584 <nop,nop,timestamp 3668674 3668788> 14:51:59.665296 IP 10.246.17.84 > 10.246.17.83: IP6 2002:af6:1154::.49917 > 2002:af6:1153::.47324: . ack 38017 win 1628 <nop,nop,timestamp 3668674 3668788> 14:51:59.665297 IP 10.246.17.84 > 10.246.17.83: IP6 2002:af6:1154::.49917 > 2002:af6:1153::.47324: . ack 39425 win 1672 <nop,nop,timestamp 3668674 3668788> 14:51:59.665298 IP 10.246.17.84 > 10.246.17.83: IP6 2002:af6:1154::.49917 > 2002:af6:1153::.47324: . ack 40833 win 1716 <nop,nop,timestamp 3668674 3668788> 14:51:59.665298 IP 10.246.17.84 > 10.246.17.83: IP6 2002:af6:1154::.49917 > 2002:af6:1153::.47324: . ack 42241 win 1760 <nop,nop,timestamp 3668674 3668788> 14:51:59.665299 IP 10.246.17.84 > 10.246.17.83: IP6 2002:af6:1154::.49917 > 2002:af6:1153::.47324: . ack 43649 win 1804 <nop,nop,timestamp 3668674 3668788> 14:51:59.665300 IP 10.246.17.84 > 10.246.17.83: IP6 2002:af6:1154::.49917 > 2002:af6:1153::.47324: . ack 45057 win 1848 <nop,nop,timestamp 3668674 3668788> 14:51:59.665301 IP 10.246.17.84 > 10.246.17.83: IP6 2002:af6:1154::.49917 > 2002:af6:1153::.47324: . ack 46465 win 1892 <nop,nop,timestamp 3668674 3668788> 14:51:59.665302 IP 10.246.17.84 > 10.246.17.83: IP6 2002:af6:1154::.49917 > 2002:af6:1153::.47324: . ack 47873 win 1936 <nop,nop,timestamp 3668674 3668788> 14:51:59.665339 IP 10.246.17.83 > 10.246.17.84: IP6 2002:af6:1153::.47324 > 2002:af6:1154::.49917: . 61953:78849(16896) ack 1 win 444 <nop,nop,timestamp 3668788 3668674> 14:51:59.665313 IP 10.246.17.84 > 10.246.17.83: IP6 2002:af6:1154::.49917 > 2002:af6:1153::.47324: . ack 49281 win 1980 <nop,nop,timestamp 3668674 3668788> 14:51:59.665314 IP 10.246.17.84 > 10.246.17.83: IP6 2002:af6:1154::.49917 > 2002:af6:1153::.47324: . ack 50689 win 2024 <nop,nop,timestamp 3668674 3668788> 14:51:59.665316 IP 10.246.17.84 > 10.246.17.83: IP6 2002:af6:1154::.49917 > 2002:af6:1153::.47324: . ack 52097 win 2068 <nop,nop,timestamp 3668674 3668788> 14:51:59.665320 IP 10.246.17.84 > 10.246.17.83: IP6 2002:af6:1154::.49917 > 2002:af6:1153::.47324: . ack 53505 win 2112 <nop,nop,timestamp 3668674 3668788> 14:51:59.665322 IP 10.246.17.84 > 10.246.17.83: IP6 2002:af6:1154::.49917 > 2002:af6:1153::.47324: . ack 54913 win 2156 <nop,nop,timestamp 3668674 3668788> 14:51:59.665362 IP 10.246.17.83 > 10.246.17.84: IP6 2002:af6:1153::.47324 > 2002:af6:1154::.49917: . 78849:98561(19712) ack 1 win 444 <nop,nop,timestamp 3668788 3668674> 14:51:59.665367 IP 10.246.17.83 > 10.246.17.84: IP6 2002:af6:1153::.47324 > 2002:af6:1154::.49917: P 98561:99969(1408) ack 1 win 444 <nop,nop,timestamp 3668788 3668674> 14:51:59.665344 IP 10.246.17.84 > 10.246.17.83: IP6 2002:af6:1154::.49917 > 2002:af6:1153::.47324: . ack 56321 win 2200 <nop,nop,timestamp 3668674 3668788> 14:51:59.665345 IP 10.246.17.84 > 10.246.17.83: IP6 2002:af6:1154::.49917 > 2002:af6:1153::.47324: . ack 57729 win 2244 <nop,nop,timestamp 3668674 3668788> 14:51:59.665347 IP 10.246.17.84 > 10.246.17.83: IP6 2002:af6:1154::.49917 > 2002:af6:1153::.47324: . ack 59137 win 2288 <nop,nop,timestamp 3668674 3668788> 14:51:59.665347 IP 10.246.17.84 > 10.246.17.83: IP6 2002:af6:1154::.49917 > 2002:af6:1153::.47324: . ack 60545 win 2332 <nop,nop,timestamp 3668674 3668788> 14:51:59.665348 IP 10.246.17.84 > 10.246.17.83: IP6 2002:af6:1154::.49917 > 2002:af6:1153::.47324: . ack 61953 win 2376 <nop,nop,timestamp 3668674 3668788> 14:51:59.665411 IP 10.246.17.83 > 10.246.17.84: IP6 2002:af6:1153::.47324 > 2002:af6:1154::.49917: . 99969:130945(30976) ack 1 win 444 <nop,nop,timestamp 3668788 3668674> 14:51:59.665470 IP 10.246.17.84 > 10.246.17.83: IP6 2002:af6:1154::.49917 > 2002:af6:1153::.47324: . ack 63361 win 2420 <nop,nop,timestamp 3668674 3668788> 14:51:59.665471 IP 10.246.17.84 > 10.246.17.83: IP6 2002:af6:1154::.49917 > 2002:af6:1153::.47324: . ack 64769 win 2464 <nop,nop,timestamp 3668674 3668788> 14:51:59.665494 IP 10.246.17.84 > 10.246.17.83: IP6 2002:af6:1154::.49917 > 2002:af6:1153::.47324: . ack 66177 win 2508 <nop,nop,timestamp 3668674 3668788> 14:51:59.665495 IP 10.246.17.84 > 10.246.17.83: IP6 2002:af6:1154::.49917 > 2002:af6:1153::.47324: . ack 67585 win 2552 <nop,nop,timestamp 3668674 3668788> 14:51:59.665495 IP 10.246.17.84 > 10.246.17.83: IP6 2002:af6:1154::.49917 > 2002:af6:1153::.47324: . ack 68993 win 2596 <nop,nop,timestamp 3668674 3668788> 14:51:59.665518 IP 10.246.17.84 > 10.246.17.83: IP6 2002:af6:1154::.49917 > 2002:af6:1153::.47324: . ack 70401 win 2640 <nop,nop,timestamp 3668674 3668788> 14:51:59.665519 IP 10.246.17.84 > 10.246.17.83: IP6 2002:af6:1154::.49917 > 2002:af6:1153::.47324: . ack 71809 win 2684 <nop,nop,timestamp 3668674 3668788> 14:51:59.665521 IP 10.246.17.84 > 10.246.17.83: IP6 2002:af6:1154::.49917 > 2002:af6:1153::.47324: . ack 73217 win 2728 <nop,nop,timestamp 3668674 3668788> 14:51:59.665522 IP 10.246.17.84 > 10.246.17.83: IP6 2002:af6:1154::.49917 > 2002:af6:1153::.47324: . ack 74625 win 2733 <nop,nop,timestamp 3668674 3668788> 14:51:59.665523 IP 10.246.17.84 > 10.246.17.83: IP6 2002:af6:1154::.49917 > 2002:af6:1153::.47324: . ack 76033 win 2733 <nop,nop,timestamp 3668674 3668788> 14:51:59.665524 IP 10.246.17.84 > 10.246.17.83: IP6 2002:af6:1154::.49917 > 2002:af6:1153::.47324: . ack 77441 win 2733 <nop,nop,timestamp 3668674 3668788> 14:51:59.665524 IP 10.246.17.84 > 10.246.17.83: IP6 2002:af6:1154::.49917 > 2002:af6:1153::.47324: . ack 78849 win 2733 <nop,nop,timestamp 3668674 3668788> 14:51:59.665525 IP 10.246.17.84 > 10.246.17.83: IP6 2002:af6:1154::.49917 > 2002:af6:1153::.47324: . ack 80257 win 2733 <nop,nop,timestamp 3668674 3668788> 14:51:59.665525 IP 10.246.17.84 > 10.246.17.83: IP6 2002:af6:1154::.49917 > 2002:af6:1153::.47324: . ack 81665 win 2733 <nop,nop,timestamp 3668674 3668788> What am I missing ? Thanks ! ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: sit tunnel slow since added GSO/TSO support 2013-12-13 22:54 ` Eric Dumazet @ 2013-12-14 21:25 ` Michal Schmidt 2013-12-15 1:23 ` Eric Dumazet 0 siblings, 1 reply; 11+ messages in thread From: Michal Schmidt @ 2013-12-14 21:25 UTC (permalink / raw) To: Eric Dumazet; +Cc: netdev@vger.kernel.org, Eric Dumazet On 12/13/2013 11:54 PM, Eric Dumazet wrote: > I tried the same setup than before and got good behavior on current > net-next kernel > > modprobe sit > ip link set sit0 up > ip -6 addr add dev sit0 2002:af6:1153::/64 > ip -6 ro add 2002:a00::/24 via fe80:: dev sit0 Eric, in my test I do not use sit0. I create a new tunnel interface: ip tun add sittun mode sit remote $REMOTE_IPV4 local $LOCAL_IPV4 \ dev $IFACE Looking at "ip tun show" I see that sit0 has the nopmtudisc option by default, while sittun does not. As I wrote in my original message, using nopmtudisc when creating my tunnel interface works around the problem. So I think nopmtudisc is the key difference in our setups. Regards, Michal ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: sit tunnel slow since added GSO/TSO support 2013-12-14 21:25 ` Michal Schmidt @ 2013-12-15 1:23 ` Eric Dumazet 0 siblings, 0 replies; 11+ messages in thread From: Eric Dumazet @ 2013-12-15 1:23 UTC (permalink / raw) To: Michal Schmidt; +Cc: netdev@vger.kernel.org, Eric Dumazet On Sat, 2013-12-14 at 22:25 +0100, Michal Schmidt wrote: > On 12/13/2013 11:54 PM, Eric Dumazet wrote: > > I tried the same setup than before and got good behavior on current > > net-next kernel > > > > modprobe sit > > ip link set sit0 up > > ip -6 addr add dev sit0 2002:af6:1153::/64 > > ip -6 ro add 2002:a00::/24 via fe80:: dev sit0 > > Eric, > in my test I do not use sit0. I create a new tunnel interface: > ip tun add sittun mode sit remote $REMOTE_IPV4 local $LOCAL_IPV4 \ > dev $IFACE > > Looking at "ip tun show" I see that sit0 has the nopmtudisc option by > default, while sittun does not. > > As I wrote in my original message, using nopmtudisc when creating my > tunnel interface works around the problem. > > So I think nopmtudisc is the key difference in our setups. Oh right. Iguess the following should help ? diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c index 366fbba3359a..a710fdec42d3 100644 --- a/net/ipv6/sit.c +++ b/net/ipv6/sit.c @@ -924,7 +924,7 @@ static netdev_tx_t ipip6_tunnel_xmit(struct sk_buff *skb, if (tunnel->parms.iph.daddr && skb_dst(skb)) skb_dst(skb)->ops->update_pmtu(skb_dst(skb), NULL, skb, mtu); - if (skb->len > mtu) { + if (skb->len > mtu && !skb_is_gso(skb)) { icmpv6_send(skb, ICMPV6_PKT_TOOBIG, 0, mtu); ip_rt_put(rt); goto tx_error; ^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH] ipv6: sit: update mtu check to take care of gso packets 2013-12-13 16:13 sit tunnel slow since added GSO/TSO support Michal Schmidt 2013-12-13 16:28 ` Eric Dumazet @ 2013-12-16 14:31 ` Eric Dumazet 2013-12-17 14:22 ` Michal Schmidt ` (2 more replies) 1 sibling, 3 replies; 11+ messages in thread From: Eric Dumazet @ 2013-12-16 14:31 UTC (permalink / raw) To: Michal Schmidt, David Miller; +Cc: netdev@vger.kernel.org From: Eric Dumazet <edumazet@google.com> While testing my changes for TSO support in SIT devices, I was using sit0 tunnel which appears to include nopmtudisc flag. But using : ip tun add sittun mode sit remote $REMOTE_IPV4 local $LOCAL_IPV4 \ dev $IFACE We get a tunnel which rejects too long packets because of the mtu check which is not yet GSO aware. erd:~# ip tunnel sittun: ipv6/ip remote 10.246.17.84 local 10.246.17.83 ttl inherit 6rd-prefix 2002::/16 sit0: ipv6/ip remote any local any ttl 64 nopmtudisc 6rd-prefix 2002::/16 This patch is based on an excellent report from Michal Shmidt. In the future, we probably want to extend the MTU check to do the right thing for GSO packets... Fixes: ("61c1db7fae21 ipv6: sit: add GSO/TSO support") Reported-by: Michal Schmidt <mschmidt@redhat.com> Signed-off-by: Eric Dumazet <edumazet@google.com> --- net/ipv6/sit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c index 366fbba3359a..a710fdec42d3 100644 --- a/net/ipv6/sit.c +++ b/net/ipv6/sit.c @@ -924,7 +924,7 @@ static netdev_tx_t ipip6_tunnel_xmit(struct sk_buff *skb, if (tunnel->parms.iph.daddr && skb_dst(skb)) skb_dst(skb)->ops->update_pmtu(skb_dst(skb), NULL, skb, mtu); - if (skb->len > mtu) { + if (skb->len > mtu && !skb_is_gso(skb)) { icmpv6_send(skb, ICMPV6_PKT_TOOBIG, 0, mtu); ip_rt_put(rt); goto tx_error; ^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH] ipv6: sit: update mtu check to take care of gso packets 2013-12-16 14:31 ` [PATCH] ipv6: sit: update mtu check to take care of gso packets Eric Dumazet @ 2013-12-17 14:22 ` Michal Schmidt 2013-12-17 14:48 ` Eric Dumazet 2013-12-17 20:19 ` Hannes Frederic Sowa 2013-12-18 22:57 ` David Miller 2 siblings, 1 reply; 11+ messages in thread From: Michal Schmidt @ 2013-12-17 14:22 UTC (permalink / raw) To: Eric Dumazet, David Miller; +Cc: netdev@vger.kernel.org On 12/16/2013 03:31 PM, Eric Dumazet wrote: > From: Eric Dumazet <edumazet@google.com> > > While testing my changes for TSO support in SIT devices, > I was using sit0 tunnel which appears to include nopmtudisc flag. > > But using : > > ip tun add sittun mode sit remote $REMOTE_IPV4 local $LOCAL_IPV4 \ > dev $IFACE > > We get a tunnel which rejects too long packets because of the mtu check > which is not yet GSO aware. > > erd:~# ip tunnel > sittun: ipv6/ip remote 10.246.17.84 local 10.246.17.83 ttl inherit 6rd-prefix 2002::/16 > sit0: ipv6/ip remote any local any ttl 64 nopmtudisc 6rd-prefix 2002::/16 > > This patch is based on an excellent report from > Michal Shmidt. > > In the future, we probably want to extend the MTU check to do the > right thing for GSO packets... > > Fixes: ("61c1db7fae21 ipv6: sit: add GSO/TSO support") > Reported-by: Michal Schmidt <mschmidt@redhat.com> > Signed-off-by: Eric Dumazet <edumazet@google.com> Tested-by: Michal Schmidt <mschmidt@redhat.com> It works fine now. Thanks. Michal ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] ipv6: sit: update mtu check to take care of gso packets 2013-12-17 14:22 ` Michal Schmidt @ 2013-12-17 14:48 ` Eric Dumazet 0 siblings, 0 replies; 11+ messages in thread From: Eric Dumazet @ 2013-12-17 14:48 UTC (permalink / raw) To: Michal Schmidt; +Cc: David Miller, netdev@vger.kernel.org On Tue, 2013-12-17 at 15:22 +0100, Michal Schmidt wrote: > Tested-by: Michal Schmidt <mschmidt@redhat.com> > > It works fine now. Thanks. > Michal Thanks a lot Michal for your very nice bug report ! ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] ipv6: sit: update mtu check to take care of gso packets 2013-12-16 14:31 ` [PATCH] ipv6: sit: update mtu check to take care of gso packets Eric Dumazet 2013-12-17 14:22 ` Michal Schmidt @ 2013-12-17 20:19 ` Hannes Frederic Sowa 2013-12-17 21:34 ` Eric Dumazet 2013-12-18 22:57 ` David Miller 2 siblings, 1 reply; 11+ messages in thread From: Hannes Frederic Sowa @ 2013-12-17 20:19 UTC (permalink / raw) To: Eric Dumazet; +Cc: Michal Schmidt, David Miller, netdev@vger.kernel.org Hi Eric! On Mon, Dec 16, 2013 at 06:31:23AM -0800, Eric Dumazet wrote: > In the future, we probably want to extend the MTU check to do the > right thing for GSO packets... How could that look like? Greetings, Hannes ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] ipv6: sit: update mtu check to take care of gso packets 2013-12-17 20:19 ` Hannes Frederic Sowa @ 2013-12-17 21:34 ` Eric Dumazet 0 siblings, 0 replies; 11+ messages in thread From: Eric Dumazet @ 2013-12-17 21:34 UTC (permalink / raw) To: Hannes Frederic Sowa; +Cc: Michal Schmidt, David Miller, netdev@vger.kernel.org On Tue, 2013-12-17 at 21:19 +0100, Hannes Frederic Sowa wrote: > Hi Eric! > > On Mon, Dec 16, 2013 at 06:31:23AM -0800, Eric Dumazet wrote: > > In the future, we probably want to extend the MTU check to do the > > right thing for GSO packets... > > How could that look like? I think I already posted a draft for this. Idea would be to have a helper to compute the mtu of each segment : static inline unsigned int gso_size_with_headers(const struct sk_buff *skb) { unsigned int hdrlen = skb_transport_header(skb) - skb_network_header(skb); if (skb_shinfo(skb)->gso_type & (SKB_GSO_TCPV4 | SKB_GSO_TCPV6)) hdrlen += tcp_hdrlen(skb); else hdrlen += 8; // sizeof(struct udphdr) return skb_shinfo(skb)->gso_size + hdrlen; } ... len = skb_is_gso(skb) ? gso_size_with_headers(skb) : skb->len; if (unlikely(len > dst_mtu(&rt->dst) && ... ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] ipv6: sit: update mtu check to take care of gso packets 2013-12-16 14:31 ` [PATCH] ipv6: sit: update mtu check to take care of gso packets Eric Dumazet 2013-12-17 14:22 ` Michal Schmidt 2013-12-17 20:19 ` Hannes Frederic Sowa @ 2013-12-18 22:57 ` David Miller 2 siblings, 0 replies; 11+ messages in thread From: David Miller @ 2013-12-18 22:57 UTC (permalink / raw) To: eric.dumazet; +Cc: mschmidt, netdev From: Eric Dumazet <eric.dumazet@gmail.com> Date: Mon, 16 Dec 2013 06:31:23 -0800 > From: Eric Dumazet <edumazet@google.com> > > While testing my changes for TSO support in SIT devices, > I was using sit0 tunnel which appears to include nopmtudisc flag. > > But using : > > ip tun add sittun mode sit remote $REMOTE_IPV4 local $LOCAL_IPV4 \ > dev $IFACE > > We get a tunnel which rejects too long packets because of the mtu check > which is not yet GSO aware. > > erd:~# ip tunnel > sittun: ipv6/ip remote 10.246.17.84 local 10.246.17.83 ttl inherit 6rd-prefix 2002::/16 > sit0: ipv6/ip remote any local any ttl 64 nopmtudisc 6rd-prefix 2002::/16 > > This patch is based on an excellent report from > Michal Shmidt. > > In the future, we probably want to extend the MTU check to do the > right thing for GSO packets... > > Fixes: ("61c1db7fae21 ipv6: sit: add GSO/TSO support") > Reported-by: Michal Schmidt <mschmidt@redhat.com> > Signed-off-by: Eric Dumazet <edumazet@google.com> Applied, thanks Eric. ^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2013-12-18 22:57 UTC | newest] Thread overview: 11+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2013-12-13 16:13 sit tunnel slow since added GSO/TSO support Michal Schmidt 2013-12-13 16:28 ` Eric Dumazet 2013-12-13 22:54 ` Eric Dumazet 2013-12-14 21:25 ` Michal Schmidt 2013-12-15 1:23 ` Eric Dumazet 2013-12-16 14:31 ` [PATCH] ipv6: sit: update mtu check to take care of gso packets Eric Dumazet 2013-12-17 14:22 ` Michal Schmidt 2013-12-17 14:48 ` Eric Dumazet 2013-12-17 20:19 ` Hannes Frederic Sowa 2013-12-17 21:34 ` Eric Dumazet 2013-12-18 22:57 ` David Miller
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).