Lines Matching refs:ca
95 u8 nv_min_cwnd; /* nv won't make a ca decision if cwnd is
101 u8 nv_rtt_cnt; /* RTTs without making ca decision */;
124 static inline void tcpnv_reset(struct tcpnv *ca, struct sock *sk)
128 ca->nv_reset = 0;
129 ca->nv_no_cong_cnt = 0;
130 ca->nv_rtt_cnt = 0;
131 ca->nv_last_rtt = 0;
132 ca->nv_rtt_max_rate = 0;
133 ca->nv_rtt_start_seq = tp->snd_una;
134 ca->nv_eval_call_cnt = 0;
135 ca->nv_last_snd_una = tp->snd_una;
140 struct tcpnv *ca = inet_csk_ca(sk);
143 tcpnv_reset(ca, sk);
152 ca->nv_base_rtt = base_rtt;
153 ca->nv_lower_bound_rtt = (base_rtt * 205) >> 8; /* 80% */
155 ca->nv_base_rtt = 0;
156 ca->nv_lower_bound_rtt = 0;
159 ca->nv_allow_cwnd_growth = 1;
160 ca->nv_min_rtt_reset_jiffies = jiffies + 2 * HZ;
161 ca->nv_min_rtt = NV_INIT_RTT;
162 ca->nv_min_rtt_new = NV_INIT_RTT;
163 ca->nv_min_cwnd = NV_MIN_CWND;
164 ca->nv_catchup = 0;
165 ca->cwnd_growth_factor = 0;
171 inline u32 nv_get_bounded_rtt(struct tcpnv *ca, u32 val)
173 if (ca->nv_lower_bound_rtt > 0 && val < ca->nv_lower_bound_rtt)
174 return ca->nv_lower_bound_rtt;
175 else if (ca->nv_base_rtt > 0 && val > ca->nv_base_rtt)
176 return ca->nv_base_rtt;
184 struct tcpnv *ca = inet_csk_ca(sk);
191 if (!ca->nv_allow_cwnd_growth)
200 if (ca->cwnd_growth_factor < 0) {
201 cnt = tp->snd_cwnd << -ca->cwnd_growth_factor;
204 cnt = max(4U, tp->snd_cwnd >> ca->cwnd_growth_factor);
218 struct tcpnv *ca = inet_csk_ca(sk);
220 if (new_state == TCP_CA_Open && ca->nv_reset) {
221 tcpnv_reset(ca, sk);
224 ca->nv_reset = 1;
225 ca->nv_allow_cwnd_growth = 0;
228 if (ca->cwnd_growth_factor > 0)
229 ca->cwnd_growth_factor = 0;
232 ca->cwnd_growth_factor > -8)
233 ca->cwnd_growth_factor--;
244 struct tcpnv *ca = inet_csk_ca(sk);
261 if (ca->nv_catchup && tp->snd_cwnd >= nv_min_cwnd) {
262 ca->nv_catchup = 0;
263 ca->nv_allow_cwnd_growth = 0;
266 bytes_acked = tp->snd_una - ca->nv_last_snd_una;
267 ca->nv_last_snd_una = tp->snd_una;
274 if (ca->nv_last_rtt > 0) {
276 ((u64)ca->nv_last_rtt)
280 ca->nv_min_rtt = avg_rtt << 1;
282 ca->nv_last_rtt = avg_rtt;
296 if (ca->nv_rtt_max_rate < rate)
297 ca->nv_rtt_max_rate = rate;
300 if (ca->nv_eval_call_cnt < 255)
301 ca->nv_eval_call_cnt++;
304 avg_rtt = nv_get_bounded_rtt(ca, avg_rtt);
307 if (avg_rtt < ca->nv_min_rtt)
308 ca->nv_min_rtt = avg_rtt;
311 if (avg_rtt < ca->nv_min_rtt_new)
312 ca->nv_min_rtt_new = avg_rtt;
323 if (time_after_eq(now, ca->nv_min_rtt_reset_jiffies)) {
326 ca->nv_min_rtt = ca->nv_min_rtt_new;
327 ca->nv_min_rtt_new = NV_INIT_RTT;
329 ca->nv_min_rtt_reset_jiffies =
331 /* Every so often we decrease ca->nv_min_cwnd in case previous
334 ca->nv_min_cwnd = max(ca->nv_min_cwnd / 2, NV_MIN_CWND);
338 if (before(ca->nv_rtt_start_seq, tp->snd_una)) {
339 ca->nv_rtt_start_seq = tp->snd_nxt;
340 if (ca->nv_rtt_cnt < 0xff)
342 ca->nv_rtt_cnt++;
347 * ca->nv_min_cwnd.
349 if (ca->nv_eval_call_cnt == 1 &&
350 bytes_acked >= (ca->nv_min_cwnd - 1) * tp->mss_cache &&
351 ca->nv_min_cwnd < (NV_TSO_CWND_BOUND + 1)) {
352 ca->nv_min_cwnd = min(ca->nv_min_cwnd
355 ca->nv_rtt_start_seq = tp->snd_nxt +
356 ca->nv_min_cwnd * tp->mss_cache;
357 ca->nv_eval_call_cnt = 0;
358 ca->nv_allow_cwnd_growth = 1;
367 div64_u64(((u64)ca->nv_rtt_max_rate) * ca->nv_min_rtt,
383 if (ca->nv_rtt_cnt < nv_rtt_min_cnt) {
386 if (ca->nv_eval_call_cnt <
390 } else if (ca->nv_eval_call_cnt <
392 if (ca->nv_allow_cwnd_growth &&
393 ca->nv_rtt_cnt > nv_stop_rtt_cnt)
394 ca->nv_allow_cwnd_growth = 0;
399 ca->nv_allow_cwnd_growth = 0;
412 if (ca->cwnd_growth_factor > 0)
413 ca->cwnd_growth_factor = 0;
414 ca->nv_no_cong_cnt = 0;
417 if (ca->nv_eval_call_cnt < nv_inc_eval_min_calls)
420 ca->nv_allow_cwnd_growth = 1;
421 ca->nv_no_cong_cnt++;
422 if (ca->cwnd_growth_factor < 0 &&
424 ca->nv_no_cong_cnt > nv_cwnd_growth_rate_neg) {
425 ca->cwnd_growth_factor++;
426 ca->nv_no_cong_cnt = 0;
427 } else if (ca->cwnd_growth_factor >= 0 &&
429 ca->nv_no_cong_cnt >
431 ca->cwnd_growth_factor++;
432 ca->nv_no_cong_cnt = 0;
440 ca->nv_eval_call_cnt = 0;
441 ca->nv_rtt_cnt = 0;
442 ca->nv_rtt_max_rate = 0;
457 const struct tcpnv *ca = inet_csk_ca(sk);
461 info->vegas.tcpv_rttcnt = ca->nv_rtt_cnt;
462 info->vegas.tcpv_rtt = ca->nv_last_rtt;
463 info->vegas.tcpv_minrtt = ca->nv_min_rtt;