diff mbox

Bugzilla 42595

Message ID 1326901345.2316.27.camel@edumazet-HP-Compaq-6005-Pro-SFF-PC
State RFC, archived
Delegated to: David Miller
Headers show

Commit Message

Eric Dumazet Jan. 18, 2012, 3:42 p.m. UTC
Le mercredi 18 janvier 2012 à 15:42 +0100, Eric Dumazet a écrit :

> It seems that if you try to have the default ethtool settings (tso, gso,
> tx checksum ... on), transfert is very slow... I am investigating, but I
> suspect that if dst_allfrag() is true, we must disable gso as well.
> 
> 

Following patch is a good compromise, since it disables gso on the
socket on the first frame we consider too big in ip6_fragment().

So the added check on dst_allfrag() is only done once per socket,
instead of adding in sk_can_gso(sk) in fast path.

I can now let gso on on the device, and still have good transfert speed
on sockets hitting the ALLFRAG feature.

 		kfree_skb(skb);


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Tore Anderson Jan. 18, 2012, 7:26 p.m. UTC | #1
* Eric Dumazet

> Following patch is a good compromise, since it disables gso on the
> socket on the first frame we consider too big in ip6_fragment().
> 
> So the added check on dst_allfrag() is only done once per socket,
> instead of adding in sk_can_gso(sk) in fast path.
> 
> I can now let gso on on the device, and still have good transfert speed
> on sockets hitting the ALLFRAG feature.

I can both confirm that I too saw abysmal performance when using the
default offload settings (with your two earlier patches applied only),
and also that applying this patch in addition fixes the problem, with no
apparent ill effects. Thanks!

Best regards,
diff mbox

Patch

diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
index d97e071..e058747 100644
--- a/net/ipv6/ip6_output.c
+++ b/net/ipv6/ip6_output.c
@@ -647,8 +647,12 @@  int ip6_fragment(struct sk_buff *skb, int
(*output)(struct sk_buff *))
 	 * or if the skb it not generated by a local socket.
 	 */
 	if (!skb->local_df && skb->len > mtu) {
+
+		if (skb->sk && dst_allfrag(skb_dst(skb)))
+			sk_nocaps_add(skb->sk, NETIF_F_GSO_MASK);
+
 		skb->dev = skb_dst(skb)->dev;
 		icmpv6_send(skb, ICMPV6_PKT_TOOBIG, 0, mtu);
 		IP6_INC_STATS(net, ip6_dst_idev(skb_dst(skb)),
 			      IPSTATS_MIB_FRAGFAILS);