Lines Matching refs:gain
109 u32 pacing_gain:10, /* current gain for setting pacing rate */
110 cwnd_gain:10, /* current gain for setting cwnd */
128 #define CYCLE_LEN 8 /* number of phases in a pacing gain cycle */
147 /* We use a high_gain value of 2/ln(2) because it's the smallest pacing gain
153 /* The pacing gain of 1/high_gain in BBR_DRAIN is calculated to typically drain
157 /* The gain for deriving steady-state cwnd tolerates delayed/stretched ACKs: */
159 /* The pacing_gain values for the PROBE_BW gain cycle, to discover/share bw: */
166 /* Randomize the starting gain cycling phase over N phases: */
238 /* Return rate in bytes per second, optionally with a gain.
240 * work for input rates of up to 2.9Tbit/sec and gain of 2.89x.
242 static u64 bbr_rate_bytes_per_sec(struct sock *sk, u64 rate, int gain)
247 rate *= gain;
253 /* Convert a BBR bw and gain factor to a pacing rate in bytes per second. */
254 static unsigned long bbr_bw_to_pacing_rate(struct sock *sk, u32 bw, int gain)
258 rate = bbr_rate_bytes_per_sec(sk, rate, gain);
282 /* Pace using current bw estimate and a gain factor. */
283 static void bbr_set_pacing_rate(struct sock *sk, u32 bw, int gain)
287 unsigned long rate = bbr_bw_to_pacing_rate(sk, bw, gain);
350 * bdp = ceil(bw * min_rtt * gain)
352 * The key factor, gain, controls the amount of queue. While a small gain
357 static u32 bbr_bdp(struct sock *sk, u32 bw, int gain)
374 /* Apply a gain to the given value, remove the BW_SCALE shift, and
377 bdp = (((w * gain) >> BBR_SCALE) + BW_UNIT - 1) / BW_UNIT;
402 /* Ensure gain cycling gets inflight above BDP even for small BDPs. */
410 static u32 bbr_inflight(struct sock *sk, u32 bw, int gain)
414 inflight = bbr_bdp(sk, bw, gain);
517 u32 acked, u32 bw, int gain)
529 target_cwnd = bbr_bdp(sk, bw, gain);
597 /* Gain cycling: cycle pacing gain to converge to fair share of available bw. */
620 bbr_advance_cycle_phase(sk); /* flip to next phase of gain cycle */
697 bbr_reset_probe_bw_mode(sk); /* restart gain cycling */