Skip to content

Commit 6b3656a

Browse files
yydcooldavem330
authored andcommitted
tcp_bbr: fix quantization code to not raise cwnd if not probing bandwidth
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: 3c346b233c68 ("tcp_bbr: fix bw probing to raise in-flight data for very small BDPs") Signed-off-by: Kevin(Yudong) Yang <[email protected]> Acked-by: Neal Cardwell <[email protected]> Acked-by: Yuchung Cheng <[email protected]> Acked-by: Soheil Hassas Yeganeh <[email protected]> Acked-by: Priyaranjan Jha <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 94e7e5d commit 6b3656a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

net/ipv4/tcp_bbr.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ static u32 bbr_bdp(struct sock *sk, u32 bw, int gain)
388388
* which allows 2 outstanding 2-packet sequences, to try to keep pipe
389389
* full even with ACK-every-other-packet delayed ACKs.
390390
*/
391-
static u32 bbr_quantization_budget(struct sock *sk, u32 cwnd, int gain)
391+
static u32 bbr_quantization_budget(struct sock *sk, u32 cwnd)
392392
{
393393
struct bbr *bbr = inet_csk_ca(sk);
394394

@@ -399,7 +399,7 @@ static u32 bbr_quantization_budget(struct sock *sk, u32 cwnd, int gain)
399399
cwnd = (cwnd + 1) & ~1U;
400400

401401
/* Ensure gain cycling gets inflight above BDP even for small BDPs. */
402-
if (bbr->mode == BBR_PROBE_BW && gain > BBR_UNIT)
402+
if (bbr->mode == BBR_PROBE_BW && bbr->cycle_idx == 0)
403403
cwnd += 2;
404404

405405
return cwnd;
@@ -411,7 +411,7 @@ static u32 bbr_inflight(struct sock *sk, u32 bw, int gain)
411411
u32 inflight;
412412

413413
inflight = bbr_bdp(sk, bw, gain);
414-
inflight = bbr_quantization_budget(sk, inflight, gain);
414+
inflight = bbr_quantization_budget(sk, inflight);
415415

416416
return inflight;
417417
}
@@ -531,7 +531,7 @@ static void bbr_set_cwnd(struct sock *sk, const struct rate_sample *rs,
531531
* due to aggregation (of data and/or ACKs) visible in the ACK stream.
532532
*/
533533
target_cwnd += bbr_ack_aggregation_cwnd(sk);
534-
target_cwnd = bbr_quantization_budget(sk, target_cwnd, gain);
534+
target_cwnd = bbr_quantization_budget(sk, target_cwnd);
535535

536536
/* If we're below target cwnd, slow start cwnd toward target cwnd. */
537537
if (bbr_full_bw_reached(sk)) /* only cut cwnd if we filled the pipe */

0 commit comments

Comments
 (0)