All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net] tcp_bbr: fix bw probing to raise in-flight data for very small BDPs
@ 2018-07-27 21:19 Neal Cardwell
  2018-07-29  5:46 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Neal Cardwell @ 2018-07-27 21:19 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, Neal Cardwell

For some very small BDPs (with just a few packets) there was a
quantization effect where the target number of packets in flight
during the super-unity-gain (1.25x) phase of gain cycling was
implicitly truncated to a number of packets no larger than the normal
unity-gain (1.0x) phase of gain cycling. This meant that in multi-flow
scenarios some flows could get stuck with a lower bandwidth, because
they did not push enough packets inflight to discover that there was
more bandwidth available. This was really only an issue in multi-flow
LAN scenarios, where RTTs and BDPs are low enough for this to be an
issue.

This fix ensures that gain cycling can raise inflight for small BDPs
by ensuring that in PROBE_BW mode target inflight values with a
super-unity gain are always greater than inflight values with a gain
<= 1. Importantly, this applies whether the inflight value is
calculated for use as a cwnd value, or as a target inflight value for
the end of the super-unity phase in bbr_is_next_cycle_phase() (both
need to be bigger to ensure we can probe with more packets in flight
reliably).

This is a candidate fix for stable releases.

Fixes: 0f8782ea1497 ("tcp_bbr: add BBR congestion control")
Signed-off-by: Neal Cardwell <ncardwell@google.com>
Acked-by: Yuchung Cheng <ycheng@google.com>
Acked-by: Soheil Hassas Yeganeh <soheil@google.com>
Acked-by: Priyaranjan Jha <priyarjha@google.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
---
 net/ipv4/tcp_bbr.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/net/ipv4/tcp_bbr.c b/net/ipv4/tcp_bbr.c
index 3b5f45b9e81eb..13d34427ca3dd 100644
--- a/net/ipv4/tcp_bbr.c
+++ b/net/ipv4/tcp_bbr.c
@@ -358,6 +358,10 @@ static u32 bbr_target_cwnd(struct sock *sk, u32 bw, int gain)
 	/* Reduce delayed ACKs by rounding up cwnd to the next even number. */
 	cwnd = (cwnd + 1) & ~1U;
 
+	/* Ensure gain cycling gets inflight above BDP even for small BDPs. */
+	if (bbr->mode == BBR_PROBE_BW && gain > BBR_UNIT)
+		cwnd += 2;
+
 	return cwnd;
 }
 
-- 
2.18.0.345.g5c9ce644c3-goog

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net] tcp_bbr: fix bw probing to raise in-flight data for very small BDPs
  2018-07-27 21:19 [PATCH net] tcp_bbr: fix bw probing to raise in-flight data for very small BDPs Neal Cardwell
@ 2018-07-29  5:46 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2018-07-29  5:46 UTC (permalink / raw)
  To: ncardwell; +Cc: netdev

From: Neal Cardwell <ncardwell@google.com>
Date: Fri, 27 Jul 2018 17:19:12 -0400

> For some very small BDPs (with just a few packets) there was a
> quantization effect where the target number of packets in flight
> during the super-unity-gain (1.25x) phase of gain cycling was
> implicitly truncated to a number of packets no larger than the normal
> unity-gain (1.0x) phase of gain cycling. This meant that in multi-flow
> scenarios some flows could get stuck with a lower bandwidth, because
> they did not push enough packets inflight to discover that there was
> more bandwidth available. This was really only an issue in multi-flow
> LAN scenarios, where RTTs and BDPs are low enough for this to be an
> issue.
> 
> This fix ensures that gain cycling can raise inflight for small BDPs
> by ensuring that in PROBE_BW mode target inflight values with a
> super-unity gain are always greater than inflight values with a gain
> <= 1. Importantly, this applies whether the inflight value is
> calculated for use as a cwnd value, or as a target inflight value for
> the end of the super-unity phase in bbr_is_next_cycle_phase() (both
> need to be bigger to ensure we can probe with more packets in flight
> reliably).
> 
> This is a candidate fix for stable releases.
> 
> Fixes: 0f8782ea1497 ("tcp_bbr: add BBR congestion control")
> Signed-off-by: Neal Cardwell <ncardwell@google.com>
> Acked-by: Yuchung Cheng <ycheng@google.com>
> Acked-by: Soheil Hassas Yeganeh <soheil@google.com>
> Acked-by: Priyaranjan Jha <priyarjha@google.com>
> Reviewed-by: Eric Dumazet <edumazet@google.com>

Applied and queued up for -stable, thank you.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-07-29  7:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-27 21:19 [PATCH net] tcp_bbr: fix bw probing to raise in-flight data for very small BDPs Neal Cardwell
2018-07-29  5:46 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.