Commit de8e1beb authored by Luke Hsiao's avatar Luke Hsiao Committed by David S. Miller

tcp_bbr: clarify that bbr_bdp() rounds up in comments

This explicitly clarifies that bbr_bdp() returns the rounded-up value of
the bandwidth-delay product and why in the comments.
Signed-off-by: default avatarLuke Hsiao <lukehsiao@google.com>
Acked-by: default avatarSoheil Hassas Yeganeh <soheil@google.com>
Acked-by: default avatarNeal Cardwell <ncardwell@google.com>
Acked-by: default avatarPriyaranjan Jha <priyarjha@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent fa730a3b
...@@ -346,7 +346,7 @@ static void bbr_cwnd_event(struct sock *sk, enum tcp_ca_event event) ...@@ -346,7 +346,7 @@ static void bbr_cwnd_event(struct sock *sk, enum tcp_ca_event event)
/* Calculate bdp based on min RTT and the estimated bottleneck bandwidth: /* Calculate bdp based on min RTT and the estimated bottleneck bandwidth:
* *
* bdp = bw * min_rtt * gain * bdp = ceil(bw * min_rtt * gain)
* *
* The key factor, gain, controls the amount of queue. While a small gain * The key factor, gain, controls the amount of queue. While a small gain
* builds a smaller queue, it becomes more vulnerable to noise in RTT * builds a smaller queue, it becomes more vulnerable to noise in RTT
...@@ -370,7 +370,9 @@ static u32 bbr_bdp(struct sock *sk, u32 bw, int gain) ...@@ -370,7 +370,9 @@ static u32 bbr_bdp(struct sock *sk, u32 bw, int gain)
w = (u64)bw * bbr->min_rtt_us; w = (u64)bw * bbr->min_rtt_us;
/* Apply a gain to the given value, then remove the BW_SCALE shift. */ /* Apply a gain to the given value, remove the BW_SCALE shift, and
* round the value up to avoid a negative feedback loop.
*/
bdp = (((w * gain) >> BBR_SCALE) + BW_UNIT - 1) / BW_UNIT; bdp = (((w * gain) >> BBR_SCALE) + BW_UNIT - 1) / BW_UNIT;
return bdp; return bdp;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment