From patchwork Tue Oct 15 19:24:54 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Eric Dumazet X-Patchwork-Id: 283775 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 28E082C0351 for ; Wed, 16 Oct 2013 06:25:14 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933655Ab3JOTY6 (ORCPT ); Tue, 15 Oct 2013 15:24:58 -0400 Received: from mail-pd0-f180.google.com ([209.85.192.180]:62742 "EHLO mail-pd0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933495Ab3JOTYz (ORCPT ); Tue, 15 Oct 2013 15:24:55 -0400 Received: by mail-pd0-f180.google.com with SMTP id y10so9277402pdj.39 for ; Tue, 15 Oct 2013 12:24:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:subject:from:to:cc:date:content-type :content-transfer-encoding:mime-version; bh=8lZYYqTk3IYQk92KRdPynRUNaK7RlLaWDLqVPjVQppc=; b=A+gbSZ0ju2+8m2opbUiPAAoe/+h4+jX/7TEB/i3QQIT1epd1Fe4r5qEmZ2A1FMQmBn n2KAWMuyW0aceBogFiqL2cEJKqDI8ixI9u8TLedMDzf4Dv/ieZDitDWOjukzDeSkRlJj /UfJtylLZp+ACXy9cmfIiF5lOwnEBoyVTfEIi2W6sdPsdpzhwIdkA5/VikURhhexijLc JD/6ncatHUmRMrZL+/b+KK/xyDdH1sXdt2FQf/YwIJ/iQ2zQviAWsF1YFPP2F/Xez8KM tvAQxnwzTc0FqUkCl5rMb5PCkF6OtnHe4OmAY/9SKW4oFjtwcPVpcFoxW/EF2IW/bOi4 jnuA== X-Received: by 10.66.235.106 with SMTP id ul10mr44146710pac.19.1381865095264; Tue, 15 Oct 2013 12:24:55 -0700 (PDT) Received: from [172.19.247.117] ([172.19.247.117]) by mx.google.com with ESMTPSA id og5sm86298245pbb.10.1969.12.31.16.00.00 (version=SSLv3 cipher=RC4-SHA bits=128/128); Tue, 15 Oct 2013 12:24:54 -0700 (PDT) Message-ID: <1381865094.2045.69.camel@edumazet-glaptop.roam.corp.google.com> Subject: [PATCH 2/2] tcp: remove the sk_can_gso() check from tcp_set_skb_tso_segs() From: Eric Dumazet To: David Miller Cc: netdev , Neal Cardwell , Yuchung Cheng Date: Tue, 15 Oct 2013 12:24:54 -0700 X-Mailer: Evolution 3.2.3-0ubuntu6 Mime-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Eric Dumazet sk_can_gso() should only be used as a hint in tcp_sendmsg() to build GSO packets in the first place. (As a performance hint) Once we have GSO packets in write queue, we can not decide they are no longer GSO only because flow now uses a route which doesn't handle TSO/GSO. Core networking stack handles the case very well for us, all we need is keeping track of packet counts in MSS terms, regardless of segmentation done later (in GSO or hardware) Right now, if tcp_fragment() splits a GSO packet in two parts, @left and @right, and route changed through a non GSO device, both @left and @right have pcount set to 1, which is wrong, and leads to incorrect packet_count tracking. This problem was added in commit d5ac99a648 ("[TCP]: skb pcount with MTU discovery") Signed-off-by: Eric Dumazet Signed-off-by: Neal Cardwell Signed-off-by: Yuchung Cheng Reported-by: Maciej Żenczykowski --- net/ipv4/tcp_output.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) -- 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 diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index 8fad1c1..d46f214 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c @@ -989,8 +989,7 @@ static void tcp_set_skb_tso_segs(const struct sock *sk, struct sk_buff *skb, /* Make sure we own this skb before messing gso_size/gso_segs */ WARN_ON_ONCE(skb_cloned(skb)); - if (skb->len <= mss_now || !sk_can_gso(sk) || - skb->ip_summed == CHECKSUM_NONE) { + if (skb->len <= mss_now || skb->ip_summed == CHECKSUM_NONE) { /* Avoid the costly divide in the normal * non-TSO case. */