From patchwork Mon Aug 26 02:22:39 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Dumazet X-Patchwork-Id: 269795 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 7BA362C00A6 for ; Mon, 26 Aug 2013 12:22:46 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755731Ab3HZCWn (ORCPT ); Sun, 25 Aug 2013 22:22:43 -0400 Received: from mail-pd0-f177.google.com ([209.85.192.177]:33199 "EHLO mail-pd0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755712Ab3HZCWl (ORCPT ); Sun, 25 Aug 2013 22:22:41 -0400 Received: by mail-pd0-f177.google.com with SMTP id y10so2831031pdj.8 for ; Sun, 25 Aug 2013 19:22:41 -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:in-reply-to:references :content-type:content-transfer-encoding:mime-version; bh=OcEomimzBel4HgBLIyYhHHmPAs+QU4zHThvhM9uDBH8=; b=i1mDkspIBefH544QkIw1nx+oeXnNv2iQPZZN+2ub8/b6Rt2Hjt3FM9UgkC7UFIFRO4 nAUpFGMXGpeOQit7idCGpv+e69aYuxyu/L+flU/tQgFc3IQobOA/qAuG61Y8Xraq1rPk Y3Fm+Vf+9EYAAiVe9H4mvjxewdAA2hJhcydKe/tIqqnJ3Th35V2hBXnkuquUfLIsK4sJ OwGEJkShScdD1uKmagdeK/yES47n7+Olra1MYr6eJhbGURIvNd7ofqznezqAJtLV87Gt CwwWBaBDCdEsqF6a9LERI2nBHfpjTK8m/dZ01upJk765z/JlZaMtm2O9uxoJUyPB2lnK Qcnw== X-Received: by 10.68.244.168 with SMTP id xh8mr12706307pbc.3.1377483761241; Sun, 25 Aug 2013 19:22:41 -0700 (PDT) Received: from [172.19.245.165] ([172.19.245.165]) by mx.google.com with ESMTPSA id qv4sm14735725pbc.16.1969.12.31.16.00.00 (version=SSLv3 cipher=RC4-SHA bits=128/128); Sun, 25 Aug 2013 19:22:40 -0700 (PDT) Message-ID: <1377483759.8828.104.camel@edumazet-glaptop> Subject: Re: [PATCH net-next] tcp: TSO packets automatic sizing From: Eric Dumazet To: Yuchung Cheng Cc: Neal Cardwell , David Miller , netdev , Van Jacobson , Tom Herbert Date: Sun, 25 Aug 2013 19:22:39 -0700 In-Reply-To: <1377477425.8828.101.camel@edumazet-glaptop> References: <1377304192.8828.43.camel@edumazet-glaptop> <1377370594.8828.72.camel@edumazet-glaptop> <1377477425.8828.101.camel@edumazet-glaptop> 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 On Sun, 2013-08-25 at 17:37 -0700, Eric Dumazet wrote: > On Sun, 2013-08-25 at 15:01 -0700, Yuchung Cheng wrote: > > > Any idea to get rid of this undesirable extra RTT delay? > > Its probably a bug in the push code. For exact write/send of a multiple of MSS, I think following patch should fix the bug. If we filled a packet, we must send it. For the other problem, I think its related to Nagle. --- 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.c b/net/ipv4/tcp.c index ab64eea..dd326f4 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c @@ -1187,7 +1187,8 @@ new_segment: from += copy; copied += copy; - if ((seglen -= copy) == 0 && iovlen == 0) + seglen -= copy; + if (seglen == 0 && iovlen == 0 && skb->len < max) goto out; if (skb->len < max || (flags & MSG_OOB) || unlikely(tp->repair))