Received: by 10.223.176.5 with SMTP id f5csp723560wra; Fri, 9 Feb 2018 06:15:07 -0800 (PST) X-Google-Smtp-Source: AH8x224DsbcL1OWvKCLa246lgiprXRyLt9YgQRgJQAQrSOldN2/UCzXEWMbWx7gdn7UotIK8t42+ X-Received: by 2002:a17:902:8c91:: with SMTP id t17-v6mr2829617plo.310.1518185707561; Fri, 09 Feb 2018 06:15:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518185707; cv=none; d=google.com; s=arc-20160816; b=oSFj6DDsAhzVcDNQbRm4g9u8hvtt6D2KQJtdiM0D+e1cHRPMDd1nrw3NfmCT19g4l0 lJGoB4VneJKn2XRlsaFlGSPk3+RmKAx5NmNTM5wCDdPtFFY6w7fdx0fUpw3BlsSEzac8 364tCi+hO0DBqSpbj2FfYpUNKCZmD21dW9+deRzkbUfcoNr+sh4EUnFAK58YV6FlxhR4 YVWiqcrSfNHvwTtJrJuRjqAFeHNE3O8P6kJhaOL77bC07WU5VVHXP9p2EH6ctoOFUcAO GcSxzxb3L5ULD1zfrzYPrEPhRx+a+WOblbJN6Yd+gUMOZXTaZIxBkpnVzFCzC9vhCqrC sNSQ== 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=qlAYqloOOeeY3CSeTCN8U8CSads33A5NKEIik7bvdpQ=; b=LodmdKvBpY4rUh6/+jIu9SELhpw3uasqelAFzzrRZGZtG+GBnrpAAUQ9AgSi7J3ur5 Kn8DrofOUJJA0874vrw69xJYZlD9e/gvo+uXu6zZlSVSVz8aVKm81WcTTRVKy4BHCMot AdOaiLO07m65v3UkcJGahDOtRMflnqYeoncwcxHazZvRQox0tqv9fgJlKzLczBSFQ57N wyL3VIFGgTNvPlWOAapggp8UC6VjuTpDfWtSI8+HmJ1L1//AgVwMRImLJ6xnD+OKMMiK SSGPBKc6ErXL8d7RzjTKPSj19moALEbmRi/oSQQ9KwYdEybe83WNAP2SCtppUZ7lnahZ fWDA== 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 99-v6si1607300plf.440.2018.02.09.06.14.53; Fri, 09 Feb 2018 06:15:07 -0800 (PST) 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 S1752589AbeBINl1 (ORCPT + 99 others); Fri, 9 Feb 2018 08:41:27 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:48668 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751024AbeBINlX (ORCPT ); Fri, 9 Feb 2018 08:41:23 -0500 Received: from localhost (LFbn-1-12258-90.w90-92.abo.wanadoo.fr [90.92.71.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id DABDE6C; Fri, 9 Feb 2018 13:41:21 +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 , Beyers Cronje , "David S. Miller" Subject: [PATCH 4.9 26/92] tcp_bbr: fix pacing_gain to always be unity when using lt_bw Date: Fri, 9 Feb 2018 14:38:55 +0100 Message-Id: <20180209133933.136876360@linuxfoundation.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180209133931.211869118@linuxfoundation.org> References: <20180209133931.211869118@linuxfoundation.org> User-Agent: quilt/0.65 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.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Neal Cardwell [ Upstream commit 3aff3b4b986e51bcf4ab249e5d48d39596e0df6a ] This commit fixes the pacing_gain to remain at BBR_UNIT (1.0) when using lt_bw and returning from the PROBE_RTT state to PROBE_BW. Previously, when using lt_bw, upon exiting PROBE_RTT and entering PROBE_BW the bbr_reset_probe_bw_mode() code could sometimes randomly end up with a cycle_idx of 0 and hence have bbr_advance_cycle_phase() set a pacing gain above 1.0. In such cases this would result in a pacing rate that is 1.25x higher than intended, potentially resulting in a high loss rate for a little while until we stop using the lt_bw a bit later. This commit is a stable candidate for kernels back as far as 4.9. Fixes: 0f8782ea1497 ("tcp_bbr: add BBR congestion control") Signed-off-by: Neal Cardwell Signed-off-by: Yuchung Cheng Signed-off-by: Soheil Hassas Yeganeh Reported-by: Beyers Cronje Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/ipv4/tcp_bbr.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) --- a/net/ipv4/tcp_bbr.c +++ b/net/ipv4/tcp_bbr.c @@ -452,7 +452,8 @@ static void bbr_advance_cycle_phase(stru bbr->cycle_idx = (bbr->cycle_idx + 1) & (CYCLE_LEN - 1); bbr->cycle_mstamp = tp->delivered_mstamp; - bbr->pacing_gain = bbr_pacing_gain[bbr->cycle_idx]; + bbr->pacing_gain = bbr->lt_use_bw ? BBR_UNIT : + bbr_pacing_gain[bbr->cycle_idx]; } /* Gain cycling: cycle pacing gain to converge to fair share of available bw. */ @@ -461,8 +462,7 @@ static void bbr_update_cycle_phase(struc { struct bbr *bbr = inet_csk_ca(sk); - if ((bbr->mode == BBR_PROBE_BW) && !bbr->lt_use_bw && - bbr_is_next_cycle_phase(sk, rs)) + if (bbr->mode == BBR_PROBE_BW && bbr_is_next_cycle_phase(sk, rs)) bbr_advance_cycle_phase(sk); }