Received: by 10.223.176.5 with SMTP id f5csp702497wra; Fri, 9 Feb 2018 05:58:02 -0800 (PST) X-Google-Smtp-Source: AH8x224ECanOmhxPsoHT0dTbYnU7XCl4DpkJZ1SvE4EslTy4ADzNo7gd5D8Po5KO20YDup8s+J2K X-Received: by 10.98.17.15 with SMTP id z15mr3015485pfi.116.1518184682853; Fri, 09 Feb 2018 05:58:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518184682; cv=none; d=google.com; s=arc-20160816; b=toie1hqTsxEZGN2ogSRM/32REgwZI1bj1q2SC4tlhSoSRTDFch6H7gFCVoL+ldrtqs ityS8r3YD0corZN4EYVBU65Le4wt9F/SGrrO4xDYDM6KqKYQ5TQWFUFEHsmIx0RodWhh KdDhLcmTc6B3if2pHBzClb7H6706whK/EWzFnT92xg1NM6LSHgRMUK0PQu/NTpcboSsi O+gV2bE2NdzRXv4MpGOwJFOJZgQ5iy26LSSMfiZq657108b6rF+CmDWMbCpcOEfRk0dK HAWqiGQJG9JCrMaalW792qKCrNBFqttN3S+hViv7qyDvSQw+hzijk9evvkXAA79Qfz1t ETww== 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=CMT0SuCvdlz4LxEQRs1dN3YayFfpsEVnN5QCsaskPp8=; b=EDTtdAf3gtGHpp51rPZesl7uuM+tOCuawOnJUXkatIBVG5/p4NUC+Z71tUeGabHaAn A4x2dE99rf6Bgc5an04Je1zmuqB5iiM/2rOcLXiVmM/5iIyhg3md3BVYUBiwsd8u+R11 cW0whqMDuViuaxRpG9BS5x+b+cYF/2J+MsYI8JGKevdSWY0OGxGB3D4c8N5wIXXbSBQv 5KHG30BeY06Gp/AMXbRa2tVFSQNxLa7HXd3bDkyGuHM4LqwE+RmOSXhsDvh0rFCZxfiN cu/CbHlhRnhnUkbrtY7qNxWiMnfVu3mDhSnVvgsVQDs8Nqr2jJ3gRIm1xpr6UkcBfm2f 67/g== 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 f34-v6si1586226ple.102.2018.02.09.05.57.48; Fri, 09 Feb 2018 05:58:02 -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 S1753593AbeBINpO (ORCPT + 99 others); Fri, 9 Feb 2018 08:45:14 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:51758 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752879AbeBINpN (ORCPT ); Fri, 9 Feb 2018 08:45:13 -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 4546210F1; Fri, 9 Feb 2018 13:45:12 +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.14 14/22] tcp_bbr: fix pacing_gain to always be unity when using lt_bw Date: Fri, 9 Feb 2018 14:40:03 +0100 Message-Id: <20180209133935.096742447@linuxfoundation.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180209133934.024795822@linuxfoundation.org> References: <20180209133934.024795822@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.14-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 @@ -481,7 +481,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. */ @@ -490,8 +491,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); }