Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1116584imm; Wed, 1 Aug 2018 10:27:12 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeivPo9PApf/bbqa0nMo2YZ5wgHcjZ13ycKHusOCnG1fAca++JoVgOr7LUK6qgUt2p6Rmk9 X-Received: by 2002:a62:1157:: with SMTP id z84-v6mr27983229pfi.66.1533144432790; Wed, 01 Aug 2018 10:27:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533144432; cv=none; d=google.com; s=arc-20160816; b=NgeSdSz/u/9OdMVo5gyBYD0qF5H+B4V9sXk8fTCD9+kg889fCcq3RFUEjBRLo9hyfD 5Gn4CUnzV6135m5LA6QBA33GwTiFfc7u4jsLJuWcEOT8FehtqUS1b/HAhwm++ir5r9zr vCKHy66m8WnJHHN76JiPtiNINaceF1jgxObOcXnJWkZjsPz2VzOj9nG8bi0VVcQAwnyG NZXYetGYHF9OHJseIwwhp6/5FaT0WQWoVgoleAqnUvjPJip8S6JMAdI+TAbdn2zi8kvN ZE5Gpu5FWs1YryA/uJqMvt5FlfbSGK+Bz09K+mECSlYvFs2Nqm6OZYIyh64g9DbuS+bQ IWng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=bDGp8yCZ/0fkE7i4NHFmVYrl+LZOAwYxko9RavCFZLY=; b=Iqy8562aqQg1m5J70Oj0rEvwGEMlt7WI9S9tW6ekbvkOnUKWpPacgoVj4BHDGeoW9W VQ1LGJQMBgQJorm39FJewVThKZU91JkF7MkoxkonIPuxDQ/Kphu0o4Xx6WVk4uufNRGU PQ0brr4T0lEAgrJ9FbxIJNyzgnIBqGX/mWL5rQJ6Onw519y+wnsXHHX5JjBqFketAEzt vBuAmK4w4dDdUkfYOmyRB3ZzmF/JNhGfzDEGpBu45q6mqH8qeuXQaCuATy6HmZ1tZSNn iivH/KgiljvHXKNyJa9RuBDQyVj2UO1rCrBS7xaUURUHymJXxJgSeDx5/gr/eBzdgzdn 1VXw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i11-v6si2296129pfe.145.2018.08.01.10.26.58; Wed, 01 Aug 2018 10:27:12 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2406588AbeHATLQ (ORCPT + 99 others); Wed, 1 Aug 2018 15:11:16 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:51150 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404840AbeHATLP (ORCPT ); Wed, 1 Aug 2018 15:11:15 -0400 Received: from localhost (D57E6652.static.ziggozakelijk.nl [213.126.102.82]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 3CAE8CC9; Wed, 1 Aug 2018 17:24:33 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Neal Cardwell , Yuchung Cheng , Soheil Hassas Yeganeh , Priyaranjan Jha , Eric Dumazet , "David S. Miller" Subject: [PATCH 4.14 238/246] tcp_bbr: fix bw probing to raise in-flight data for very small BDPs Date: Wed, 1 Aug 2018 18:52:28 +0200 Message-Id: <20180801165023.140985255@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180801165011.700991984@linuxfoundation.org> References: <20180801165011.700991984@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Neal Cardwell [ Upstream commit 383d470936c05554219094a4d364d964cb324827 ] For some very small BDPs (with just a few packets) there was a quantization effect where the target number of packets in flight during the super-unity-gain (1.25x) phase of gain cycling was implicitly truncated to a number of packets no larger than the normal unity-gain (1.0x) phase of gain cycling. This meant that in multi-flow scenarios some flows could get stuck with a lower bandwidth, because they did not push enough packets inflight to discover that there was more bandwidth available. This was really only an issue in multi-flow LAN scenarios, where RTTs and BDPs are low enough for this to be an issue. This fix ensures that gain cycling can raise inflight for small BDPs by ensuring that in PROBE_BW mode target inflight values with a super-unity gain are always greater than inflight values with a gain <= 1. Importantly, this applies whether the inflight value is calculated for use as a cwnd value, or as a target inflight value for the end of the super-unity phase in bbr_is_next_cycle_phase() (both need to be bigger to ensure we can probe with more packets in flight reliably). This is a candidate fix for stable releases. Fixes: 0f8782ea1497 ("tcp_bbr: add BBR congestion control") Signed-off-by: Neal Cardwell Acked-by: Yuchung Cheng Acked-by: Soheil Hassas Yeganeh Acked-by: Priyaranjan Jha Reviewed-by: Eric Dumazet Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/ipv4/tcp_bbr.c | 4 ++++ 1 file changed, 4 insertions(+) --- a/net/ipv4/tcp_bbr.c +++ b/net/ipv4/tcp_bbr.c @@ -353,6 +353,10 @@ static u32 bbr_target_cwnd(struct sock * /* Reduce delayed ACKs by rounding up cwnd to the next even number. */ cwnd = (cwnd + 1) & ~1U; + /* Ensure gain cycling gets inflight above BDP even for small BDPs. */ + if (bbr->mode == BBR_PROBE_BW && gain > BBR_UNIT) + cwnd += 2; + return cwnd; }