Received: by 2002:aa6:c429:0:b029:98:93ff:f56f with SMTP id g9csp3385451lkq; Mon, 23 Nov 2020 04:29:48 -0800 (PST) X-Google-Smtp-Source: ABdhPJzACIBQECX0+1X1F/Mqav3cKfYyYGe1nhPgtw9NEl6R19ir8tCWdltLB77JG6BLHKfHlOfe X-Received: by 2002:a17:906:1804:: with SMTP id v4mr44294795eje.201.1606134587912; Mon, 23 Nov 2020 04:29:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606134587; cv=none; d=google.com; s=arc-20160816; b=gZAPCSjhwjTzoIpH5Qx4DJadoi3C9j+6bqXQrOFGw6oDNaxRqbHHqs60mu6LP8xnDZ 86OcaWnK80LmCLxlNL8jmHWMb9j3NEBYeJvTHJmc/RNWcO1MXhymKS4ts/WvUQp8jXdt RFeP/4k07gqEyT/N0pWSJNOeQm1dsmOFwOYq8wvGJOsPlb1rN72SDRjKZAqHLA7LEnPr jRSMj7Ozzl+CNt2pE/DnxNzwev0leKwFmVqCNZrE5w5gPyGMMhbwx3MK05zPfn9BUqEK Sc6Tar3L52P+5IgTl6yuTZvOcas/KppFlBb/6WLHwk7hVrGsxoeu6cO05CjH6DLfmnqH 92nw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=MVmgx47yaaaVbN4c+hUTy2U4eCjjbQBIViA9WU+4gz8=; b=r1+W06RT3X+JfOs8nXm74wMGWQzpfJN36zu+vKRyln1/K2w9+WG+ZWU99lEsS0rWLt Rjs0bmy+crVGaE2ilKeLxls+dS75ztsaPA1PqIAcQ3dd6Zlj916VowP1v8btOPl/Godc v23To8F+PrDlGupaKJ0y4262WnRcbJcck56IiHgqYCduy/sFlgXH7yqoqK2saPLGXE/S ylhnzMzyYed4ju1B172aU+Ve5W+OcgGZGz1tPjFGlw9tak/MobylLmRKTXq/EIte4NC3 qKOqoBi2zkjza0C13jDYfp/d/0kTWgyXD0UbKNhQjfgrdskbCYz4CZFkijAaoplrQdym Dn6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=1PiycF5o; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f23si6579835ejb.6.2020.11.23.04.29.25; Mon, 23 Nov 2020 04:29:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=1PiycF5o; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729880AbgKWMYt (ORCPT + 99 others); Mon, 23 Nov 2020 07:24:49 -0500 Received: from mail.kernel.org ([198.145.29.99]:34362 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729863AbgKWMYp (ORCPT ); Mon, 23 Nov 2020 07:24:45 -0500 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id EFD992076E; Mon, 23 Nov 2020 12:24:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1606134284; bh=l3o67iad6VP+yL5RBsCEyT4t+/Fh7VsG0Vg7+8pyNzY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1PiycF5ozsbnaynUpNSRiTzg/YNUNWwtxoNHsMS113HF3fFMyM18PQXag4E0cANCO wMLOCmcytLedduQymAEdkEO1wbgAkL25R+kfKMB/bqtmN3PJuUx/ZeiA1iXpdctxPU KtlsL9I/+1edWtG4BKtp9Umfj9KDPokMeqMlwbMY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ryan Sharpelletti , Neal Cardwell , Soheil Hassas Yeganeh , Yuchung Cheng , Jakub Kicinski Subject: [PATCH 4.9 16/47] tcp: only postpone PROBE_RTT if RTT is < current min_rtt estimate Date: Mon, 23 Nov 2020 13:22:02 +0100 Message-Id: <20201123121806.326715558@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201123121805.530891002@linuxfoundation.org> References: <20201123121805.530891002@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ryan Sharpelletti [ Upstream commit 1b9e2a8c99a5c021041bfb2d512dc3ed92a94ffd ] During loss recovery, retransmitted packets are forced to use TCP timestamps to calculate the RTT samples, which have a millisecond granularity. BBR is designed using a microsecond granularity. As a result, multiple RTT samples could be truncated to the same RTT value during loss recovery. This is problematic, as BBR will not enter PROBE_RTT if the RTT sample is <= the current min_rtt sample, meaning that if there are persistent losses, PROBE_RTT will constantly be pushed off and potentially never re-entered. This patch makes sure that BBR enters PROBE_RTT by checking if RTT sample is < the current min_rtt sample, rather than <=. The Netflix transport/TCP team discovered this bug in the Linux TCP BBR code during lab tests. Fixes: 0f8782ea1497 ("tcp_bbr: add BBR congestion control") Signed-off-by: Ryan Sharpelletti Signed-off-by: Neal Cardwell Signed-off-by: Soheil Hassas Yeganeh Signed-off-by: Yuchung Cheng Link: https://lore.kernel.org/r/20201116174412.1433277-1-sharpelletti.kdev@gmail.com Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- net/ipv4/tcp_bbr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/net/ipv4/tcp_bbr.c +++ b/net/ipv4/tcp_bbr.c @@ -740,7 +740,7 @@ static void bbr_update_min_rtt(struct so filter_expired = after(tcp_time_stamp, bbr->min_rtt_stamp + bbr_min_rtt_win_sec * HZ); if (rs->rtt_us >= 0 && - (rs->rtt_us <= bbr->min_rtt_us || filter_expired)) { + (rs->rtt_us < bbr->min_rtt_us || filter_expired)) { bbr->min_rtt_us = rs->rtt_us; bbr->min_rtt_stamp = tcp_time_stamp; }