]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/4.14.60/tcp_bbr-fix-bw-probing-to-raise-in-flight-data-for-very-small-bdps.patch
Fixes for 5.10
[thirdparty/kernel/stable-queue.git] / releases / 4.14.60 / tcp_bbr-fix-bw-probing-to-raise-in-flight-data-for-very-small-bdps.patch
CommitLineData
2c643bb0
GKH
1From foo@baz Wed Aug 1 08:19:32 CEST 2018
2From: Neal Cardwell <ncardwell@google.com>
3Date: Fri, 27 Jul 2018 17:19:12 -0400
4Subject: tcp_bbr: fix bw probing to raise in-flight data for very small BDPs
5
6From: Neal Cardwell <ncardwell@google.com>
7
8[ Upstream commit 383d470936c05554219094a4d364d964cb324827 ]
9
10For some very small BDPs (with just a few packets) there was a
11quantization effect where the target number of packets in flight
12during the super-unity-gain (1.25x) phase of gain cycling was
13implicitly truncated to a number of packets no larger than the normal
14unity-gain (1.0x) phase of gain cycling. This meant that in multi-flow
15scenarios some flows could get stuck with a lower bandwidth, because
16they did not push enough packets inflight to discover that there was
17more bandwidth available. This was really only an issue in multi-flow
18LAN scenarios, where RTTs and BDPs are low enough for this to be an
19issue.
20
21This fix ensures that gain cycling can raise inflight for small BDPs
22by ensuring that in PROBE_BW mode target inflight values with a
23super-unity gain are always greater than inflight values with a gain
24<= 1. Importantly, this applies whether the inflight value is
25calculated for use as a cwnd value, or as a target inflight value for
26the end of the super-unity phase in bbr_is_next_cycle_phase() (both
27need to be bigger to ensure we can probe with more packets in flight
28reliably).
29
30This is a candidate fix for stable releases.
31
32Fixes: 0f8782ea1497 ("tcp_bbr: add BBR congestion control")
33Signed-off-by: Neal Cardwell <ncardwell@google.com>
34Acked-by: Yuchung Cheng <ycheng@google.com>
35Acked-by: Soheil Hassas Yeganeh <soheil@google.com>
36Acked-by: Priyaranjan Jha <priyarjha@google.com>
37Reviewed-by: Eric Dumazet <edumazet@google.com>
38Signed-off-by: David S. Miller <davem@davemloft.net>
39Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
40---
41 net/ipv4/tcp_bbr.c | 4 ++++
42 1 file changed, 4 insertions(+)
43
44--- a/net/ipv4/tcp_bbr.c
45+++ b/net/ipv4/tcp_bbr.c
46@@ -353,6 +353,10 @@ static u32 bbr_target_cwnd(struct sock *
47 /* Reduce delayed ACKs by rounding up cwnd to the next even number. */
48 cwnd = (cwnd + 1) & ~1U;
49
50+ /* Ensure gain cycling gets inflight above BDP even for small BDPs. */
51+ if (bbr->mode == BBR_PROBE_BW && gain > BBR_UNIT)
52+ cwnd += 2;
53+
54 return cwnd;
55 }
56