Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1238485pxu; Mon, 23 Nov 2020 15:36:58 -0800 (PST) X-Google-Smtp-Source: ABdhPJzmuJczgky8jz1hiLLKzJuYzvjrAU1M2e0oolftRp/pY1cXlSk7JLYgj+u+FO7zAme651Al X-Received: by 2002:a17:906:5587:: with SMTP id y7mr1835798ejp.138.1606174618106; Mon, 23 Nov 2020 15:36:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606174618; cv=none; d=google.com; s=arc-20160816; b=dAMhHDZCZwuWFwBtqo5pORH2i7K+LRoKY1V3x/6MirUpdcLu6Cdgo+w/d4GLIR279F hdLTL6rvPKTdglly0jEzhBm4GLoX+kLIXDjUSbGYuhl9xE3YrZmFneSGAUjGkrWfwtI3 vp7RGx68gyXbhfhNIJN29c0NiGih5L5SOfi/cAucaeTRd/kGWebPfcc9FIZTjRGDA7by dexIT+FwIoREakU1g5z9aGTo1slQJnOyg+VtA4/0KMBXbhOvsuIosXmeW+xVFSsBPkBL SShTMF1EgJxDBjHKtC4q6jBe3CearH/JFDXkqFZMpn8rhoDkCl2rQa5RLamZYEu886N/ X3PQ== 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=FUaTV6EMC4eh32m3N2FFIsAwpKLOSuqg88us4ELyGgA=; b=KnMyjTkTg9RyTO4zcUd86oXrEwJLUTAbAR/iXbnBjjr/vMccl58nmB8xpEzRzZRK2y 2iNnhKm41yoY5MvY3ttIfQPbyRrNuq7qdNWUnejb3UeoKzhSG9Eus4HwfUhvUrgpBRza 1m+3ZCBBD99XZXKa01NkMZuEb068t4RuAGmVi06j+zR4qZ1L9LdZv6TrYe6rjgvohl6/ mwz00Lq5GsaxFe4crQ3Ogw3qAmeMoBGQduyJmB+tyylaPkN8Hfsq3AdSO3eIyWe9SlqV sDrr9/trcB7hccOQWUiyO1ChIXqKc6HQNuTXMgese81nxSHotn1iV9cxI8LoqasePOyp XL6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=QjBURXjF; 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 b26si7722393edy.172.2020.11.23.15.36.36; Mon, 23 Nov 2020 15:36:58 -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=QjBURXjF; 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 S1731666AbgKWMgT (ORCPT + 99 others); Mon, 23 Nov 2020 07:36:19 -0500 Received: from mail.kernel.org ([198.145.29.99]:48364 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731652AbgKWMgO (ORCPT ); Mon, 23 Nov 2020 07:36:14 -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 ADBF0208DB; Mon, 23 Nov 2020 12:36:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1606134973; bh=dWd8T2yo9NXYD7bdTYaQEjA+WjGJAEzUkkl3TYN4bW0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QjBURXjF2ug2sp4ZD/lWt3wH17fAWDYLpdx4qBwaqLM2vxdGjhycBC3CJxGgovZDe y0QmLmjAnf6wBGEDrAcEzQiuoEewFhWSs6rJrk2ZLLEm7hzv4WddVpJPoY5KC6TFv+ QaGt2dkMfHOjkqjzSQUajj0EqAgnXNZdpEPMJqsA= 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 5.4 028/158] tcp: only postpone PROBE_RTT if RTT is < current min_rtt estimate Date: Mon, 23 Nov 2020 13:20:56 +0100 Message-Id: <20201123121821.293827742@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201123121819.943135899@linuxfoundation.org> References: <20201123121819.943135899@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 @@ -945,7 +945,7 @@ static void bbr_update_min_rtt(struct so filter_expired = after(tcp_jiffies32, bbr->min_rtt_stamp + bbr_min_rtt_win_sec * HZ); if (rs->rtt_us >= 0 && - (rs->rtt_us <= bbr->min_rtt_us || + (rs->rtt_us < bbr->min_rtt_us || (filter_expired && !rs->is_ack_delayed))) { bbr->min_rtt_us = rs->rtt_us; bbr->min_rtt_stamp = tcp_jiffies32;