From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-io1-xd44.google.com (mail-io1-xd44.google.com [IPv6:2607:f8b0:4864:20::d44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.bufferbloat.net (Postfix) with ESMTPS id CB58E3CB35 for ; Thu, 26 Sep 2019 10:50:42 -0400 (EDT) Received: by mail-io1-xd44.google.com with SMTP id q10so7343736iop.2 for ; Thu, 26 Sep 2019 07:50:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :content-transfer-encoding; bh=UHcPi8wfKhUT2KY5p5AKQhvDVnAJIwixEaCo6Z7Lnrk=; b=Cejwf98878Fo0xvNy93K2mCRlnvO64gEU+V9eUXvysR47EH7Pal0hfEWXfjPp9yMO+ lFm1kwJZxeKDJKj5M4c0mNiS1koYrHooBNKdZdXoSeIhSzVA+ZnKRp/kKwSp1o5jJlZy GnlwOvZmzngKT7/ald/3UtIfzyk7WHUqckclHcQ+GL68VvwMskh+HAPSZfaWW4JbsRXe lp6DoikFJgSJCoJtOUv64e0txEbawjqLf1oB110FuB+9b1bxAWt/qE1SYGeEmZg3I8Hl bQX+jNYC1vZnsNDt0Ic7nLedOKydTg7f9gIyxPwaHuq20hPTCVuMTF1IOK17SgmqongP EBlw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:content-transfer-encoding; bh=UHcPi8wfKhUT2KY5p5AKQhvDVnAJIwixEaCo6Z7Lnrk=; b=T1JVD9PML4RGIMdBdfFRJjoJ8GFbaBuHz9MLuw7JpwEesz9P+DYjc6QiaFoBvbVmz8 Ztj1WAXgcjtXAYlP3k7hMnOoHuQY79FXkOQhTcQ6zlqF3g366HZj6YslOe2BTaL3B8r1 L4g5Gs1ROF2GtAgya3VjFy4El3qyASwxpRke30+qftuQeTDK2OmJ6S8HkM2CuXtLNEob SCR8Zey0pE4GVG1Ijeop4oA7lmsMsNFKVkog12o2xOzotrHS3hmWpRsnkL9pT1dOa0r0 hLBfYZyZMqbdLaeoUddCTHqLt60AZZiSwWb7a7tvcBx2p6l2Mtsd4ZpV92GbVd3YpwDx mxuw== X-Gm-Message-State: APjAAAWWzvbqxtHzW+k2EoIp96Yl33zqbu9zZ8IPeqLqsrlw0Cn22SEO v3wh6dVSFpWD7Jr9YLr7mI66K8YVU4PHfLkmJXOcEKaL X-Google-Smtp-Source: APXvYqxjhBcAj1oEhkB/mWccUtGM8z4Yn/57V1XuiF3dnLA7eBn9OqoyKJM5656iGWxDeqX7o+hVYWH/gLv92rHwcVI= X-Received: by 2002:a92:5c13:: with SMTP id q19mr2767197ilb.249.1569509441999; Thu, 26 Sep 2019 07:50:41 -0700 (PDT) MIME-Version: 1.0 References: <20190926143005.106045-1-yyd@google.com> In-Reply-To: <20190926143005.106045-1-yyd@google.com> From: Dave Taht Date: Thu, 26 Sep 2019 07:50:30 -0700 Message-ID: To: ECN-Sane Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: [Ecn-sane] Fwd: [PATCH net] tcp_bbr: fix quantization code to not raise cwnd if not probing bandwidth X-BeenThere: ecn-sane@lists.bufferbloat.net X-Mailman-Version: 2.1.20 Precedence: list List-Id: Discussion of explicit congestion notification's impact on the Internet List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Sep 2019 14:50:42 -0000 ---------- Forwarded message --------- From: Kevin(Yudong) Yang Date: Thu, Sep 26, 2019 at 7:33 AM Subject: [PATCH net] tcp_bbr: fix quantization code to not raise cwnd if not probing bandwidth To: David Miller Cc: , Kevin(Yudong) Yang , Neal Cardwell , Yuchung Cheng , Soheil Hassas Yeganeh , Priyaranjan Jha There was a bug in the previous logic that attempted to ensure gain cycling gets inflight above BDP even for small BDPs. This code correctly raised and lowered target inflight values during the gain cycle. And this code correctly ensured that cwnd was raised when probing bandwidth. However, it did not correspondingly ensure that cwnd was *not* raised in this way when *not* probing for bandwidth. The result was that small-BDP flows that were always cwnd-bound could go for many cycles with a fixed cwnd, and not probe or yield bandwidth at all. This meant that multiple small-BDP flows could fail to converge in their bandwidth allocations. Fixes: 383d470 ("tcp_bbr: fix bw probing to raise in-flight data for very small BDPs") Signed-off-by: Kevin(Yudong) Yang Acked-by: Neal Cardwell Acked-by: Yuchung Cheng Acked-by: Soheil Hassas Yeganeh Acked-by: Priyaranjan Jha --- net/ipv4/tcp_bbr.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/net/ipv4/tcp_bbr.c b/net/ipv4/tcp_bbr.c index 95b59540eee1..32772d6ded4e 100644 --- a/net/ipv4/tcp_bbr.c +++ b/net/ipv4/tcp_bbr.c @@ -388,7 +388,7 @@ static u32 bbr_bdp(struct sock *sk, u32 bw, int gain) * which allows 2 outstanding 2-packet sequences, to try to keep pipe * full even with ACK-every-other-packet delayed ACKs. */ -static u32 bbr_quantization_budget(struct sock *sk, u32 cwnd, int gain) +static u32 bbr_quantization_budget(struct sock *sk, u32 cwnd) { struct bbr *bbr =3D inet_csk_ca(sk); @@ -399,7 +399,7 @@ static u32 bbr_quantization_budget(struct sock *sk, u32 cwnd, int gain) cwnd =3D (cwnd + 1) & ~1U; /* Ensure gain cycling gets inflight above BDP even for small BDPs.= */ - if (bbr->mode =3D=3D BBR_PROBE_BW && gain > BBR_UNIT) + if (bbr->mode =3D=3D BBR_PROBE_BW && bbr->cycle_idx =3D=3D 0) cwnd +=3D 2; return cwnd; @@ -411,7 +411,7 @@ static u32 bbr_inflight(struct sock *sk, u32 bw, int ga= in) u32 inflight; inflight =3D bbr_bdp(sk, bw, gain); - inflight =3D bbr_quantization_budget(sk, inflight, gain); + inflight =3D bbr_quantization_budget(sk, inflight); return inflight; } @@ -531,7 +531,7 @@ static void bbr_set_cwnd(struct sock *sk, const struct rate_sample *rs, * due to aggregation (of data and/or ACKs) visible in the ACK stre= am. */ target_cwnd +=3D bbr_ack_aggregation_cwnd(sk); - target_cwnd =3D bbr_quantization_budget(sk, target_cwnd, gain); + target_cwnd =3D bbr_quantization_budget(sk, target_cwnd); /* If we're below target cwnd, slow start cwnd toward target cwnd. = */ if (bbr_full_bw_reached(sk)) /* only cut cwnd if we filled the pip= e */ -- 2.23.0.444.g18eeb5a265-goog --=20 Dave T=C3=A4ht CTO, TekLibre, LLC http://www.teklibre.com Tel: 1-831-205-9740