From patchwork Wed May 2 01:45:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neal Cardwell X-Patchwork-Id: 907259 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.b="XRd/2y+D"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 40bLhZ4vbrz9s1w for ; Wed, 2 May 2018 11:45:50 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751329AbeEBBpr (ORCPT ); Tue, 1 May 2018 21:45:47 -0400 Received: from mail-yw0-f201.google.com ([209.85.161.201]:55178 "EHLO mail-yw0-f201.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750859AbeEBBpq (ORCPT ); Tue, 1 May 2018 21:45:46 -0400 Received: by mail-yw0-f201.google.com with SMTP id x190-v6so258963ywg.21 for ; Tue, 01 May 2018 18:45:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:date:message-id:subject:from:to:cc; bh=ErE58TGsqyWxn3c4LRa8auZ5G+svF6OojXI7Gt76PMo=; b=XRd/2y+Dt9YDLkO6iUVM5LB/b1aQy5eexUmGg1sE2iI0d15zr+R1lekuAAiKNO8JqV bzEoWUcmtGgEwFVGlY6KNP+f8Xt4VRjiheyidkZy9BtI0Edfl6V3IMa4gG4b5u4DnogM FaIGRxq+2iQz/bSo/R67eUgz9GPNwdvGjfOB+AMSyHA5U1I8P4JLDlju5WqemgnvV/io JI6TmU657UmQanMe7qmWTN3E2GfGFX9JRaDaGA/JmM+YN1j3c1VYb9O1q/DqoGgL2qME oumCkZkfoYdgDdz50g+Uwg9a6rHPNWJ++7Qe7Lm7l/tMySUi3st6u7f7Ez/JEQTzH1T5 t4rg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:date:message-id:subject:from:to:cc; bh=ErE58TGsqyWxn3c4LRa8auZ5G+svF6OojXI7Gt76PMo=; b=fXI83jKSMECuJ2qC9+VivYaCg2dZoVvC1hC0nhr6dRvBe2ZS+FRIWOZGAtXZ9FWp6r jGPUVVDBY/bUIEo6uIiW7MnlAOGP/LwO7qda04X3gzzo1OOFtFq4JREVWE8kjwNfi3h/ 7j3F4YZTqj51ZsrXgVwxTCps6wwIUwGaGfjkM22/pF/bWrPFVzxEVCuHGNhHStMYEFmP m4EYuY2YfCrVHivtrHMeiQQYlf+4AqnxCGFDPUlnYxVh5D+ORJp9MTsJtlYKYbGOZkRs NkxQYdPB83UjKgh/AYIPXRksJODmniiSc+gcM/RM0hLOWpAExp+mxtOGWzzrOfASmsv2 AZCA== X-Gm-Message-State: ALQs6tBciLJZar2doguJfBWe2J2ps8kX5jGoVGF/8Czdt/29CcPnuDKD vyCzC9u9qiZqSjzqttTFykafrbX98CLhZRU= X-Google-Smtp-Source: AB8JxZp26nkE7sw7dCpjm/bkwhQrdfOf368CjTlTWg0NiP1EXCwg6Xf7EJr65CS5N3AKdRyPwgwGc/x8v6UZfpU= MIME-Version: 1.0 X-Received: by 2002:a81:520c:: with SMTP id g12-v6mr6219687ywb.142.1525225545769; Tue, 01 May 2018 18:45:45 -0700 (PDT) Date: Tue, 1 May 2018 21:45:41 -0400 Message-Id: <20180502014541.194259-1-ncardwell@google.com> X-Mailer: git-send-email 2.17.0.441.gb46fe60e1d-goog Subject: [PATCH net] tcp_bbr: fix to zero idle_restart only upon S/ACKed data From: Neal Cardwell To: davem@davemloft.net, netdev@vger.kernel.org, ncardwell@google.com, ycheng@google.com, soheil@google.com, priyarjha@google.com, ysseung@google.com Cc: netdev@vger.kernel.org, Neal Cardwell , Yuchung Cheng , Soheil Hassas Yeganeh , Priyaranjan Jha , Yousuk Seung Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Previously the bbr->idle_restart tracking was zeroing out the bbr->idle_restart bit upon ACKs that did not SACK or ACK anything, e.g. receiving incoming data or receiver window updates. In such situations BBR would forget that this was a restart-from-idle situation, and if the min_rtt had expired it would unnecessarily enter PROBE_RTT (even though we were actually restarting from idle but had merely forgotten that fact). The fix is simple: we need to remember we are restarting from idle until we receive a S/ACK for some data (a S/ACK for the first flight of data we send as we are restarting). 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 Signed-off-by: Priyaranjan Jha Signed-off-by: Yousuk Seung --- net/ipv4/tcp_bbr.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/net/ipv4/tcp_bbr.c b/net/ipv4/tcp_bbr.c index 158d105e76da1..58e2f479ffb4d 100644 --- a/net/ipv4/tcp_bbr.c +++ b/net/ipv4/tcp_bbr.c @@ -806,7 +806,9 @@ static void bbr_update_min_rtt(struct sock *sk, const struct rate_sample *rs) } } } - bbr->idle_restart = 0; + /* Restart after idle ends only once we process a new S/ACK for data */ + if (rs->delivered > 0) + bbr->idle_restart = 0; } static void bbr_update_model(struct sock *sk, const struct rate_sample *rs)