From: Kevin Yang <yyd@google.com>
To: David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org, Kevin Yang <yyd@google.com>,
Neal Cardwell <ncardwell@google.com>
Subject: [PATCH net 3/3] tcp_bbr: apply PROBE_RTT cwnd cap even if acked==0
Date: Wed, 22 Aug 2018 17:43:16 -0400 [thread overview]
Message-ID: <20180822214316.174161-4-yyd@google.com> (raw)
In-Reply-To: <20180822214316.174161-1-yyd@google.com>
This commit fixes a corner case where TCP BBR would enter PROBE_RTT
mode but not reduce its cwnd. If a TCP receiver ACKed less than one
full segment, the number of delivered/acked packets was 0, so that
bbr_set_cwnd() would short-circuit and exit early, without cutting
cwnd to the value we want for PROBE_RTT.
The fix is to instead make sure that even when 0 full packets are
ACKed, we do apply all the appropriate caps, including the cap that
applies in PROBE_RTT mode.
Fixes: 0f8782ea1497 ("tcp_bbr: add BBR congestion control")
Signed-off-by: Kevin Yang <yyd@google.com>
Signed-off-by: Neal Cardwell <ncardwell@google.com>
Reviewed-by: Yuchung Cheng <ycheng@google.com>
Reviewed-by: Soheil Hassas Yeganeh <soheil@google.com>
---
net/ipv4/tcp_bbr.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/ipv4/tcp_bbr.c b/net/ipv4/tcp_bbr.c
index 1d4bdd3b5e4d0..02ff2dde96094 100644
--- a/net/ipv4/tcp_bbr.c
+++ b/net/ipv4/tcp_bbr.c
@@ -420,10 +420,10 @@ static void bbr_set_cwnd(struct sock *sk, const struct rate_sample *rs,
{
struct tcp_sock *tp = tcp_sk(sk);
struct bbr *bbr = inet_csk_ca(sk);
- u32 cwnd = 0, target_cwnd = 0;
+ u32 cwnd = tp->snd_cwnd, target_cwnd = 0;
if (!acked)
- return;
+ goto done; /* no packet fully ACKed; just apply caps */
if (bbr_set_cwnd_to_recover_or_restore(sk, rs, acked, &cwnd))
goto done;
--
2.18.0.1017.ga543ac7ca45-goog
next prev parent reply other threads:[~2018-08-23 1:10 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-22 21:43 [PATCH net 0/3] tcp_bbr: PROBE_RTT minor bug fixes Kevin Yang
2018-08-22 21:43 ` [PATCH net 1/3] tcp_bbr: add bbr_check_probe_rtt_done() helper Kevin Yang
2018-08-22 21:43 ` [PATCH net 2/3] tcp_bbr: in restart from idle, see if we should exit PROBE_RTT Kevin Yang
2018-08-22 21:43 ` Kevin Yang [this message]
2018-08-23 4:45 ` [PATCH net 0/3] tcp_bbr: PROBE_RTT minor bug fixes David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180822214316.174161-4-yyd@google.com \
--to=yyd@google.com \
--cc=davem@davemloft.net \
--cc=ncardwell@google.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox