Lines Matching defs:ca

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