aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2012-05-18 17:51:44 -0400
committerDavid S. Miller <davem@davemloft.net>2012-05-19 04:02:12 -0400
commita34a101e1e6365638b02ea83a38d7a4cb228dc04 (patch)
tree6757af0793572021c9284bccdae87a8a737e62ab /net/ipv6
parenta1e8b307986ab27b7608f107aec71d3569650f46 (diff)
ipv6: disable GSO on sockets hitting dst_allfrag
If the allfrag feature has been set on a host route (due to an ICMPv6 Packet Too Big received indicating a MTU of less than 1280), we hit a very slow behavior in TCP stack, because all big packets are dropped and only a retransmit timer is able to push one MSS frame every 200 ms. One way to handle this is to disable GSO on the socket the first time a super packet is dropped. Adding a specific dst_allfrag() in the fast path is probably overkill since the dst_allfrag() case almost never happen. Result on netperf TCP_STREAM, one flow : Before : 60 kbit/sec After : 1.6 Gbit/sec Reported-by: Tore Anderson <tore@fud.no> Signed-off-by: Eric Dumazet <edumazet@google.com> Tested-by: Tore Anderson <tore@fud.no> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6')
-rw-r--r--net/ipv6/ip6_output.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
index 3dc633f39372..d99fdc699625 100644
--- a/net/ipv6/ip6_output.c
+++ b/net/ipv6/ip6_output.c
@@ -643,7 +643,10 @@ int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *))
643 /* We must not fragment if the socket is set to force MTU discovery 643 /* We must not fragment if the socket is set to force MTU discovery
644 * or if the skb it not generated by a local socket. 644 * or if the skb it not generated by a local socket.
645 */ 645 */
646 if (!skb->local_df && skb->len > mtu) { 646 if (unlikely(!skb->local_df && skb->len > mtu)) {
647 if (skb->sk && dst_allfrag(skb_dst(skb)))
648 sk_nocaps_add(skb->sk, NETIF_F_GSO_MASK);
649
647 skb->dev = skb_dst(skb)->dev; 650 skb->dev = skb_dst(skb)->dev;
648 icmpv6_send(skb, ICMPV6_PKT_TOOBIG, 0, mtu); 651 icmpv6_send(skb, ICMPV6_PKT_TOOBIG, 0, mtu);
649 IP6_INC_STATS(net, ip6_dst_idev(skb_dst(skb)), 652 IP6_INC_STATS(net, ip6_dst_idev(skb_dst(skb)),