]>
Commit | Line | Data |
---|---|---|
2c643bb0 GKH |
1 | From foo@baz Wed Aug 1 08:19:32 CEST 2018 |
2 | From: Neal Cardwell <ncardwell@google.com> | |
3 | Date: Fri, 27 Jul 2018 17:19:12 -0400 | |
4 | Subject: tcp_bbr: fix bw probing to raise in-flight data for very small BDPs | |
5 | ||
6 | From: Neal Cardwell <ncardwell@google.com> | |
7 | ||
8 | [ Upstream commit 383d470936c05554219094a4d364d964cb324827 ] | |
9 | ||
10 | For some very small BDPs (with just a few packets) there was a | |
11 | quantization effect where the target number of packets in flight | |
12 | during the super-unity-gain (1.25x) phase of gain cycling was | |
13 | implicitly truncated to a number of packets no larger than the normal | |
14 | unity-gain (1.0x) phase of gain cycling. This meant that in multi-flow | |
15 | scenarios some flows could get stuck with a lower bandwidth, because | |
16 | they did not push enough packets inflight to discover that there was | |
17 | more bandwidth available. This was really only an issue in multi-flow | |
18 | LAN scenarios, where RTTs and BDPs are low enough for this to be an | |
19 | issue. | |
20 | ||
21 | This fix ensures that gain cycling can raise inflight for small BDPs | |
22 | by ensuring that in PROBE_BW mode target inflight values with a | |
23 | super-unity gain are always greater than inflight values with a gain | |
24 | <= 1. Importantly, this applies whether the inflight value is | |
25 | calculated for use as a cwnd value, or as a target inflight value for | |
26 | the end of the super-unity phase in bbr_is_next_cycle_phase() (both | |
27 | need to be bigger to ensure we can probe with more packets in flight | |
28 | reliably). | |
29 | ||
30 | This is a candidate fix for stable releases. | |
31 | ||
32 | Fixes: 0f8782ea1497 ("tcp_bbr: add BBR congestion control") | |
33 | Signed-off-by: Neal Cardwell <ncardwell@google.com> | |
34 | Acked-by: Yuchung Cheng <ycheng@google.com> | |
35 | Acked-by: Soheil Hassas Yeganeh <soheil@google.com> | |
36 | Acked-by: Priyaranjan Jha <priyarjha@google.com> | |
37 | Reviewed-by: Eric Dumazet <edumazet@google.com> | |
38 | Signed-off-by: David S. Miller <davem@davemloft.net> | |
39 | Signed-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 |