Lines Matching refs:ca

142 	struct cdg *ca = inet_csk_ca(sk);  in tcp_cdg_hystart_update()  local
145 ca->delay_min = min_not_zero(ca->delay_min, ca->rtt.min); in tcp_cdg_hystart_update()
146 if (ca->delay_min == 0) in tcp_cdg_hystart_update()
152 if (ca->last_ack == 0 || !tcp_is_cwnd_limited(sk)) { in tcp_cdg_hystart_update()
153 ca->last_ack = now_us; in tcp_cdg_hystart_update()
154 ca->round_start = now_us; in tcp_cdg_hystart_update()
155 } else if (before(now_us, ca->last_ack + 3000)) { in tcp_cdg_hystart_update()
156 u32 base_owd = max(ca->delay_min / 2U, 125U); in tcp_cdg_hystart_update()
158 ca->last_ack = now_us; in tcp_cdg_hystart_update()
159 if (after(now_us, ca->round_start + base_owd)) { in tcp_cdg_hystart_update()
172 if (ca->sample_cnt < 8) { in tcp_cdg_hystart_update()
173 ca->sample_cnt++; in tcp_cdg_hystart_update()
175 s32 thresh = max(ca->delay_min + ca->delay_min / 8U, in tcp_cdg_hystart_update()
178 if (ca->rtt.min > thresh) { in tcp_cdg_hystart_update()
190 static s32 tcp_cdg_grad(struct cdg *ca) in tcp_cdg_grad() argument
192 s32 gmin = ca->rtt.min - ca->rtt_prev.min; in tcp_cdg_grad()
193 s32 gmax = ca->rtt.max - ca->rtt_prev.max; in tcp_cdg_grad()
196 if (ca->gradients) { in tcp_cdg_grad()
197 ca->gsum.min += gmin - ca->gradients[ca->tail].min; in tcp_cdg_grad()
198 ca->gsum.max += gmax - ca->gradients[ca->tail].max; in tcp_cdg_grad()
199 ca->gradients[ca->tail].min = gmin; in tcp_cdg_grad()
200 ca->gradients[ca->tail].max = gmax; in tcp_cdg_grad()
201 ca->tail = (ca->tail + 1) & (window - 1); in tcp_cdg_grad()
202 gmin = ca->gsum.min; in tcp_cdg_grad()
203 gmax = ca->gsum.max; in tcp_cdg_grad()
215 if (!ca->gfilled) { in tcp_cdg_grad()
216 if (!ca->gradients && window > 1) in tcp_cdg_grad()
218 else if (ca->tail == 0) in tcp_cdg_grad()
219 ca->gfilled = true; in tcp_cdg_grad()
221 grad = (grad * window) / (int)ca->tail; in tcp_cdg_grad()
226 ca->backoff_cnt = 0; in tcp_cdg_grad()
234 ca->state = CDG_FULL; in tcp_cdg_grad()
236 ca->state = CDG_NONFULL; in tcp_cdg_grad()
243 struct cdg *ca = inet_csk_ca(sk); in tcp_cdg_backoff() local
250 ca->backoff_cnt++; in tcp_cdg_backoff()
251 if (ca->backoff_cnt > use_ineff) in tcp_cdg_backoff()
255 ca->shadow_wnd = max(ca->shadow_wnd, tcp_snd_cwnd(tp)); in tcp_cdg_backoff()
256 ca->state = CDG_BACKOFF; in tcp_cdg_backoff()
264 struct cdg *ca = inet_csk_ca(sk); in tcp_cdg_cong_avoid() local
272 if (after(ack, ca->rtt_seq) && ca->rtt.v64) { in tcp_cdg_cong_avoid()
275 if (ca->rtt_prev.v64) in tcp_cdg_cong_avoid()
276 grad = tcp_cdg_grad(ca); in tcp_cdg_cong_avoid()
277 ca->rtt_seq = tp->snd_nxt; in tcp_cdg_cong_avoid()
278 ca->rtt_prev = ca->rtt; in tcp_cdg_cong_avoid()
279 ca->rtt.v64 = 0; in tcp_cdg_cong_avoid()
280 ca->last_ack = 0; in tcp_cdg_cong_avoid()
281 ca->sample_cnt = 0; in tcp_cdg_cong_avoid()
288 ca->shadow_wnd = min(ca->shadow_wnd, tcp_snd_cwnd(tp)); in tcp_cdg_cong_avoid()
296 ca->shadow_wnd = max(ca->shadow_wnd, ca->shadow_wnd + incr); in tcp_cdg_cong_avoid()
301 struct cdg *ca = inet_csk_ca(sk); in tcp_cdg_acked() local
312 if (sample->pkts_acked == 1 && ca->delack) { in tcp_cdg_acked()
316 ca->rtt.min = min(ca->rtt.min, sample->rtt_us); in tcp_cdg_acked()
317 ca->delack--; in tcp_cdg_acked()
319 } else if (sample->pkts_acked > 1 && ca->delack < 5) { in tcp_cdg_acked()
320 ca->delack++; in tcp_cdg_acked()
324 ca->rtt.min = min_not_zero(ca->rtt.min, sample->rtt_us); in tcp_cdg_acked()
325 ca->rtt.max = max(ca->rtt.max, sample->rtt_us); in tcp_cdg_acked()
330 struct cdg *ca = inet_csk_ca(sk); in tcp_cdg_ssthresh() local
333 if (ca->state == CDG_BACKOFF) in tcp_cdg_ssthresh()
336 if (ca->state == CDG_NONFULL && use_tolerance) in tcp_cdg_ssthresh()
339 ca->shadow_wnd = min(ca->shadow_wnd >> 1, tcp_snd_cwnd(tp)); in tcp_cdg_ssthresh()
341 return max3(2U, ca->shadow_wnd, tcp_snd_cwnd(tp) >> 1); in tcp_cdg_ssthresh()
347 struct cdg *ca = inet_csk_ca(sk); in tcp_cdg_cwnd_event() local
353 gradients = ca->gradients; in tcp_cdg_cwnd_event()
356 memset(ca, 0, sizeof(*ca)); in tcp_cdg_cwnd_event()
358 ca->gradients = gradients; in tcp_cdg_cwnd_event()
359 ca->rtt_seq = tp->snd_nxt; in tcp_cdg_cwnd_event()
360 ca->shadow_wnd = tcp_snd_cwnd(tp); in tcp_cdg_cwnd_event()
363 ca->state = CDG_UNKNOWN; in tcp_cdg_cwnd_event()
364 ca->rtt_seq = tp->snd_nxt; in tcp_cdg_cwnd_event()
365 ca->rtt_prev = ca->rtt; in tcp_cdg_cwnd_event()
366 ca->rtt.v64 = 0; in tcp_cdg_cwnd_event()
375 struct cdg *ca = inet_csk_ca(sk); in tcp_cdg_init() local
378 ca->gradients = NULL; in tcp_cdg_init()
381 ca->gradients = kcalloc(window, sizeof(ca->gradients[0]), in tcp_cdg_init()
383 ca->rtt_seq = tp->snd_nxt; in tcp_cdg_init()
384 ca->shadow_wnd = tcp_snd_cwnd(tp); in tcp_cdg_init()
389 struct cdg *ca = inet_csk_ca(sk); in tcp_cdg_release() local
391 kfree(ca->gradients); in tcp_cdg_release()
392 ca->gradients = NULL; in tcp_cdg_release()