From patchwork Fri Feb 20 18:33:16 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neal Cardwell X-Patchwork-Id: 442120 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 59B5214017F for ; Sat, 21 Feb 2015 05:33:50 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754878AbbBTSdp (ORCPT ); Fri, 20 Feb 2015 13:33:45 -0500 Received: from mail-yk0-f171.google.com ([209.85.160.171]:65095 "EHLO mail-yk0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754820AbbBTSdm (ORCPT ); Fri, 20 Feb 2015 13:33:42 -0500 Received: by mail-yk0-f171.google.com with SMTP id q200so8025826ykb.2 for ; Fri, 20 Feb 2015 10:33:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=zVR3140syPw+b4PIi84tlnONWfO3Ef1UQhFUk4k/LoM=; b=lLUkkUCqIyHWLPBdgaWJY5BTR96nKUJcA3FXj8IpnSR+3jPM9yy69cMrDjxDE7IAxI nIXkeKrr38LNANmx5Xy0c/WuC2VbNYoPC2+5/VURQ4pdxNUijnZduMIKjspiqbEXPuPP mUVX1hR/LC0O+AHAnsjFuHN+YK8R+woBW/0dWPBhMeJ/PTLPted3OLAibeOntnDTHwc7 PtDbCbkX0tuN5Plyn9f4Xh6X5OY1Vtq9af9JlDwVP0m2Cz8XAXuRtluRrSNEzTG/lcqY sST+quF57GsDEX/KACPiUIPPNmD+JbG+n+Z206Gy8g+mwhxs+3mIProsmPhIOmrIOb/t lWug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=zVR3140syPw+b4PIi84tlnONWfO3Ef1UQhFUk4k/LoM=; b=b11PXwZ3SZ5EKpFfJSyghMyvnGwYValHmqqKu3tIN1O1gz7+XBTbursYBuQf0SRN50 dY38voah2RuRz+dzhC8qAnhBTP0i8w0NBUCdp6EuoScR11bmst45smCM9WIQhkbqgmvG upEDalSHLYzplA1ABUKlQYf+sZ/xqrWE79Bbd6pG2pBqIDPjbY9UGAoH0OnEoF8AKFWP sPny+lL8whFUgm9DXamsyh6TEjC5GRkyEzn9aGZ0vc9eyp0As52aw4ffwcrh6HgJlQcK 7how5VzP2Yz1If4pZVf8RXi6IRM2A/JjgG3YFmPeQtkrBDMEdEeuTQZwYGmgDgkn3kAz jzyw== X-Gm-Message-State: ALoCoQngFl7lYDsexC6weshGRd0QVxtHhdggSQ+GhnIIn66k8ignHSWRIXdnLHPm9juz3xtDaBGv X-Received: by 10.170.142.85 with SMTP id j82mr9089547ykc.123.1424457221905; Fri, 20 Feb 2015 10:33:41 -0800 (PST) Received: from coy.nyc.corp.google.com ([172.26.105.221]) by mx.google.com with ESMTPSA id f45sm21856301yhf.28.2015.02.20.10.33.40 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 20 Feb 2015 10:33:41 -0800 (PST) From: Neal Cardwell To: David Miller Cc: netdev@vger.kernel.org, Neal Cardwell , Yuchung Cheng , Eric Dumazet , Nandita Dukkipati Subject: [PATCH net-next] tcp: fix tcp_should_expand_sndbuf() to use tcp_packets_in_flight() Date: Fri, 20 Feb 2015 13:33:16 -0500 Message-Id: <1424457196-3497-1-git-send-email-ncardwell@google.com> X-Mailer: git-send-email 2.2.0.rc0.207.ga3a616c Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org tcp_should_expand_sndbuf() does not expand the send buffer if we have filled the congestion window. However, it should use tcp_packets_in_flight() instead of tp->packets_out to make this check. Testing has established that the difference matters a lot if there are many SACKed packets, causing a needless performance shortfall. Signed-off-by: Neal Cardwell Signed-off-by: Yuchung Cheng Signed-off-by: Eric Dumazet Signed-off-by: Nandita Dukkipati --- net/ipv4/tcp_input.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index 8fdd27b..fb4cf8b 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c @@ -4770,7 +4770,7 @@ static bool tcp_should_expand_sndbuf(const struct sock *sk) return false; /* If we filled the congestion window, do not expand. */ - if (tp->packets_out >= tp->snd_cwnd) + if (tcp_packets_in_flight(tp) >= tp->snd_cwnd) return false; return true;