Skip to contentSkip to conversation

sit tunnel slow since added GSO/TSO support

PATCH Applied Michal Schmidt 4 participants 11 messages Dec 13, 2013 – Dec 18, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

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

#1 lore raw
Quoted 7 lines · Michal Schmidt

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"

Quoted 5 lines

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 !

#2 lore raw
Quoted 10 lines · Eric Dumazet
Quoted 9 lines · Michal Schmidt

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.

Quoted 7 lines
Quoted 3 lines

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 !

#3 lore raw
Quoted 7 lines · Eric Dumazet

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

#4 lore raw
Quoted 14 lines · Michal Schmidt
Quoted 7 lines · Eric Dumazet

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

Quoted 7 lines

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 ?

net/ipv6/sit.c +1 -1
index 366fbba3359a..a710fdec42d3 100644
@@ -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;
#5 lore raw

PATCH 1/1 ipv6: sit: update mtu check to take care of gso packets

In reply to Michal Schmidt

From: Eric Dumazet <[email protected]>

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")
---
 net/ipv6/sit.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/ipv6/sit.c +1 -1
index 366fbba3359a..a710fdec42d3 100644
@@ -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;
author Tested-by on v1 1/1
#6 lore raw

Re: [PATCH] ipv6: sit: update mtu check to take care of gso packets

Quoted 20 lines · Eric Dumazet

From: Eric Dumazet <[email protected]>

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.

Quoted 6 lines

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")

It works fine now. Thanks.
Michal

#8 lore raw

Re: [PATCH] ipv6: sit: update mtu check to take care of gso packets

In reply to Eric Dumazet

Hi Eric!

Quoted 2 lines · Eric Dumazet

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

#9 lore raw

Re: [PATCH] ipv6: sit: update mtu check to take care of gso packets

Quoted 7 lines · Hannes Frederic Sowa

Hi Eric!

Quoted 2 lines · Eric Dumazet

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) && ...
maintainer Applied
#10 lore raw

Re: [PATCH] ipv6: sit: update mtu check to take care of gso packets

In reply to Eric Dumazet

From: Eric Dumazet <[email protected]>
Date: Mon, 16 Dec 2013 06:31:23 -0800

Quoted 20 lines

From: Eric Dumazet <[email protected]>

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.

Quoted 6 lines

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")

Applied, thanks Eric.