Lines Matching refs:gain
111 u32 pacing_gain:10, /* current gain for setting pacing rate */
112 cwnd_gain:10, /* current gain for setting cwnd */
130 #define CYCLE_LEN 8 /* number of phases in a pacing gain cycle */
149 /* We use a high_gain value of 2/ln(2) because it's the smallest pacing gain
155 /* The pacing gain of 1/high_gain in BBR_DRAIN is calculated to typically drain
159 /* The gain for deriving steady-state cwnd tolerates delayed/stretched ACKs: */
161 /* The pacing_gain values for the PROBE_BW gain cycle, to discover/share bw: */
168 /* Randomize the starting gain cycling phase over N phases: */
240 /* Return rate in bytes per second, optionally with a gain.
242 * work for input rates of up to 2.9Tbit/sec and gain of 2.89x.
244 static u64 bbr_rate_bytes_per_sec(struct sock *sk, u64 rate, int gain)
249 rate *= gain;
255 /* Convert a BBR bw and gain factor to a pacing rate in bytes per second. */
256 static unsigned long bbr_bw_to_pacing_rate(struct sock *sk, u32 bw, int gain)
260 rate = bbr_rate_bytes_per_sec(sk, rate, gain);
284 /* Pace using current bw estimate and a gain factor. */
285 static void bbr_set_pacing_rate(struct sock *sk, u32 bw, int gain)
289 unsigned long rate = bbr_bw_to_pacing_rate(sk, bw, gain);
352 * bdp = ceil(bw * min_rtt * gain)
354 * The key factor, gain, controls the amount of queue. While a small gain
359 static u32 bbr_bdp(struct sock *sk, u32 bw, int gain)
376 /* Apply a gain to the given value, remove the BW_SCALE shift, and
379 bdp = (((w * gain) >> BBR_SCALE) + BW_UNIT - 1) / BW_UNIT;
404 /* Ensure gain cycling gets inflight above BDP even for small BDPs. */
412 static u32 bbr_inflight(struct sock *sk, u32 bw, int gain)
416 inflight = bbr_bdp(sk, bw, gain);
519 u32 acked, u32 bw, int gain)
531 target_cwnd = bbr_bdp(sk, bw, gain);
599 /* Gain cycling: cycle pacing gain to converge to fair share of available bw. */
622 bbr_advance_cycle_phase(sk); /* flip to next phase of gain cycle */
699 bbr_reset_probe_bw_mode(sk); /* restart gain cycling */