Lines Matching refs:ca

94 static inline void bictcp_reset(struct bictcp *ca)  in bictcp_reset()  argument
96 ca->cnt = 0; in bictcp_reset()
97 ca->last_max_cwnd = 0; in bictcp_reset()
98 ca->last_cwnd = 0; in bictcp_reset()
99 ca->last_time = 0; in bictcp_reset()
100 ca->bic_origin_point = 0; in bictcp_reset()
101 ca->bic_K = 0; in bictcp_reset()
102 ca->delay_min = 0; in bictcp_reset()
103 ca->epoch_start = 0; in bictcp_reset()
104 ca->ack_cnt = 0; in bictcp_reset()
105 ca->tcp_cwnd = 0; in bictcp_reset()
106 ca->found = 0; in bictcp_reset()
164 struct bictcp *ca = inet_csk_ca(sk); in bictcp_hystart_reset() local
166 ca->round_start = ca->last_ack = bictcp_clock_us(sk); in bictcp_hystart_reset()
167 ca->end_seq = tp->snd_nxt; in bictcp_hystart_reset()
168 ca->curr_rtt = ~0U; in bictcp_hystart_reset()
169 ca->sample_cnt = 0; in bictcp_hystart_reset()
176 struct bictcp *ca = inet_csk_ca(sk); in BPF_PROG() local
178 bictcp_reset(ca); in BPF_PROG()
192 struct bictcp *ca = inet_csk_ca(sk); in BPF_PROG() local
201 if (ca->epoch_start && delta > 0) { in BPF_PROG()
202 ca->epoch_start += delta; in BPF_PROG()
203 if (after(ca->epoch_start, now)) in BPF_PROG()
204 ca->epoch_start = now; in BPF_PROG()
266 static __always_inline void bictcp_update(struct bictcp *ca, __u32 cwnd, in bictcp_update() argument
272 ca->ack_cnt += acked; /* count the number of ACKed packets */ in bictcp_update()
274 if (ca->last_cwnd == cwnd && in bictcp_update()
275 (__s32)(tcp_jiffies32 - ca->last_time) <= HZ / 32) in bictcp_update()
282 if (ca->epoch_start && tcp_jiffies32 == ca->last_time) in bictcp_update()
285 ca->last_cwnd = cwnd; in bictcp_update()
286 ca->last_time = tcp_jiffies32; in bictcp_update()
288 if (ca->epoch_start == 0) { in bictcp_update()
289 ca->epoch_start = tcp_jiffies32; /* record beginning */ in bictcp_update()
290 ca->ack_cnt = acked; /* start counting */ in bictcp_update()
291 ca->tcp_cwnd = cwnd; /* syn with cubic */ in bictcp_update()
293 if (ca->last_max_cwnd <= cwnd) { in bictcp_update()
294 ca->bic_K = 0; in bictcp_update()
295 ca->bic_origin_point = cwnd; in bictcp_update()
300 ca->bic_K = cubic_root(cube_factor in bictcp_update()
301 * (ca->last_max_cwnd - cwnd)); in bictcp_update()
302 ca->bic_origin_point = ca->last_max_cwnd; in bictcp_update()
320 t = (__s32)(tcp_jiffies32 - ca->epoch_start) * USEC_PER_JIFFY; in bictcp_update()
321 t += ca->delay_min; in bictcp_update()
326 if (t < ca->bic_K) /* t - K */ in bictcp_update()
327 offs = ca->bic_K - t; in bictcp_update()
329 offs = t - ca->bic_K; in bictcp_update()
333 if (t < ca->bic_K) /* below origin*/ in bictcp_update()
334 bic_target = ca->bic_origin_point - delta; in bictcp_update()
336 bic_target = ca->bic_origin_point + delta; in bictcp_update()
340 ca->cnt = cwnd / (bic_target - cwnd); in bictcp_update()
342 ca->cnt = 100 * cwnd; /* very small increment*/ in bictcp_update()
349 if (ca->last_max_cwnd == 0 && ca->cnt > 20) in bictcp_update()
350 ca->cnt = 20; /* increase cwnd 5% per RTT */ in bictcp_update()
360 if (ca->ack_cnt > delta && delta) { in bictcp_update()
361 n = ca->ack_cnt / delta; in bictcp_update()
362 ca->ack_cnt -= n * delta; in bictcp_update()
363 ca->tcp_cwnd += n; in bictcp_update()
366 if (ca->tcp_cwnd > cwnd) { /* if bic is slower than tcp */ in bictcp_update()
367 delta = ca->tcp_cwnd - cwnd; in bictcp_update()
369 if (ca->cnt > max_cnt) in bictcp_update()
370 ca->cnt = max_cnt; in bictcp_update()
377 ca->cnt = max(ca->cnt, 2U); in bictcp_update()
384 struct bictcp *ca = inet_csk_ca(sk); in BPF_STRUCT_OPS() local
390 if (hystart && after(ack, ca->end_seq)) in BPF_STRUCT_OPS()
396 bictcp_update(ca, tp->snd_cwnd, acked); in BPF_STRUCT_OPS()
397 tcp_cong_avoid_ai(tp, ca->cnt, acked); in BPF_STRUCT_OPS()
403 struct bictcp *ca = inet_csk_ca(sk); in BPF_STRUCT_OPS() local
405 ca->epoch_start = 0; /* end of epoch */ in BPF_STRUCT_OPS()
408 if (tp->snd_cwnd < ca->last_max_cwnd && fast_convergence) in BPF_STRUCT_OPS()
409 ca->last_max_cwnd = (tp->snd_cwnd * (BICTCP_BETA_SCALE + beta)) in BPF_STRUCT_OPS()
412 ca->last_max_cwnd = tp->snd_cwnd; in BPF_STRUCT_OPS()
450 struct bictcp *ca = inet_csk_ca(sk); in hystart_update() local
457 if ((__s32)(now - ca->last_ack) <= hystart_ack_delta_us) { in hystart_update()
458 ca->last_ack = now; in hystart_update()
460 threshold = ca->delay_min + hystart_ack_delay(sk); in hystart_update()
470 if ((__s32)(now - ca->round_start) > threshold) { in hystart_update()
471 ca->found = 1; in hystart_update()
479 if (ca->curr_rtt > delay) in hystart_update()
480 ca->curr_rtt = delay; in hystart_update()
481 if (ca->sample_cnt < HYSTART_MIN_SAMPLES) { in hystart_update()
482 ca->sample_cnt++; in hystart_update()
484 if (ca->curr_rtt > ca->delay_min + in hystart_update()
485 HYSTART_DELAY_THRESH(ca->delay_min >> 3)) { in hystart_update()
486 ca->found = 1; in hystart_update()
499 struct bictcp *ca = inet_csk_ca(sk); in BPF_STRUCT_OPS() local
508 if (ca->epoch_start && (__s32)(tcp_jiffies32 - ca->epoch_start) < HZ) in BPF_STRUCT_OPS()
516 if (ca->delay_min == 0 || ca->delay_min > delay) in BPF_STRUCT_OPS()
517 ca->delay_min = delay; in BPF_STRUCT_OPS()
520 if (!ca->found && tcp_in_slow_start(tp) && hystart && in BPF_STRUCT_OPS()