Received: by 10.223.176.5 with SMTP id f5csp698405wra; Fri, 9 Feb 2018 05:53:50 -0800 (PST) X-Google-Smtp-Source: AH8x2255gD/KxAshcuxw0+1v/RFCQNMB6tFnj/cM49AwG04YzwGNROF4FOTOWPCwJcD6G83hlZZS X-Received: by 10.99.178.68 with SMTP id t4mr2195315pgo.441.1518184430065; Fri, 09 Feb 2018 05:53:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518184430; cv=none; d=google.com; s=arc-20160816; b=J1wgf1ECX5T8OcAuaxPW7pyaJoRvrCVrvRiAJtdexEzXk5Y42RpHvD9RKmPFw33Aos la+kz/5vxSi2TpcRACMGM/Ux+p+fsX++WkNNrCAPtB8KmggQw9GxROymdYyR4KqLHdUa YzbKUmB3LonNO05TylzIclHDe5W/2/rqr0Ux8seG4X9u6WffHjfO3SPZNt2uzXI/fYA0 CM+JLxPR9K/weMV+pTE+FecuLUO4K5OES1A5j9bDn2MYmzywwhTgIDTHk3zy8JW7efm6 q66x53rKtrEtADFK6freadGkbkJ6yz6OKVCxCge7MHEKU+1CAZNhKplNdhAE0UX977w1 KNbA== 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=PWEHbX2IIUh2Ywk5JWrZ72NG/8yrCis/T0lcGqdj6tc=; b=TViDV44nVaXSox0Bm6R+fgAanN906g8SVR9QsZ7prQB/ZFs3Nhb1dToNj3Sg8ZC2KM qo0L7noK/C3t5IH5w1hd3t1bgIx0Y6UK+fpCuwEVDa7evJOEtKwBVZEXBE8dUe0xeSG1 MYNchTSYZp8DBUVc1xM821Ff7auuersQxMapoVYGta5ey9whEKq9U5n3mPdPzr+Z2zy+ 8+uMyEeT/44rbQIqVWW3ZmXiCTNF3JZkRl3eX5Ka7IdzZBTKFG8xiyG1TBqxhyq4mhbB bjwMlGho0zidV+11mulzMoBdFGDSM4pDTqYkMmBrrj1wufh5dUwL67PtGM8O/BdnoA+w 2jAA== 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 y2si1413729pgv.493.2018.02.09.05.53.36; Fri, 09 Feb 2018 05:53:50 -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 S1753470AbeBINvF (ORCPT + 99 others); Fri, 9 Feb 2018 08:51:05 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:52702 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753789AbeBINqU (ORCPT ); Fri, 9 Feb 2018 08:46:20 -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 9E5BD723; Fri, 9 Feb 2018 13:46:19 +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.15 13/23] tcp_bbr: fix pacing_gain to always be unity when using lt_bw Date: Fri, 9 Feb 2018 14:40:11 +0100 Message-Id: <20180209133939.030729845@linuxfoundation.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180209133938.366024920@linuxfoundation.org> References: <20180209133938.366024920@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.15-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); }