Lines Matching +full:min +full:- +full:sample +full:- +full:time
1 // SPDX-License-Identifier: GPL-2.0-only
8 * IEEE Journal on Selected Areas in Communication, 13(8):1465--1480,
17 * using fine-grained timers, NewReno, and FACK.
19 * only every-other RTT during slow start, we increase during
27 * minimum RTT sample observed during the last RTT to calculate
29 * o When the sender re-starts from idle, it waits until it has
55 /* There are several situations when we must "re-start" Vegas:
65 * stale info -- both the saved cwnd and congestion feedback are
76 /* Begin taking Vegas samples next time we send something. */ in vegas_enable()
77 vegas->doing_vegas_now = 1; in vegas_enable()
80 vegas->beg_snd_nxt = tp->snd_nxt; in vegas_enable()
82 vegas->cntRTT = 0; in vegas_enable()
83 vegas->minRTT = 0x7fffffff; in vegas_enable()
91 vegas->doing_vegas_now = 0; in vegas_disable()
98 vegas->baseRTT = 0x7fffffff; in tcp_vegas_init()
105 * o min-filter RTT samples from within an RTT to get the current
106 * propagation delay + queuing delay (we are min-filtering to try to
108 * o min-filter RTT samples from a much longer window (forever for now)
111 void tcp_vegas_pkts_acked(struct sock *sk, const struct ack_sample *sample) in tcp_vegas_pkts_acked() argument
116 if (sample->rtt_us < 0) in tcp_vegas_pkts_acked()
120 vrtt = sample->rtt_us + 1; in tcp_vegas_pkts_acked()
123 if (vrtt < vegas->baseRTT) in tcp_vegas_pkts_acked()
124 vegas->baseRTT = vrtt; in tcp_vegas_pkts_acked()
126 /* Find the min RTT during the last RTT to find in tcp_vegas_pkts_acked()
129 vegas->minRTT = min(vegas->minRTT, vrtt); in tcp_vegas_pkts_acked()
130 vegas->cntRTT++; in tcp_vegas_pkts_acked()
162 return min(tp->snd_ssthresh, tp->snd_cwnd); in tcp_vegas_ssthresh()
170 if (!vegas->doing_vegas_now) { in tcp_vegas_cong_avoid()
175 if (after(ack, vegas->beg_snd_nxt)) { in tcp_vegas_cong_avoid()
176 /* Do the Vegas once-per-RTT cwnd adjustment. */ in tcp_vegas_cong_avoid()
181 vegas->beg_snd_nxt = tp->snd_nxt; in tcp_vegas_cong_avoid()
185 * at least one RTT sample that wasn't from a delayed ACK. in tcp_vegas_cong_avoid()
192 if (vegas->cntRTT <= 2) { in tcp_vegas_cong_avoid()
207 * calculations. This is the min RTT seen during the in tcp_vegas_cong_avoid()
208 * last RTT. Taking the min filters out the effects in tcp_vegas_cong_avoid()
212 rtt = vegas->minRTT; in tcp_vegas_cong_avoid()
220 target_cwnd = (u64)tp->snd_cwnd * vegas->baseRTT; in tcp_vegas_cong_avoid()
227 diff = tp->snd_cwnd * (rtt-vegas->baseRTT) / vegas->baseRTT; in tcp_vegas_cong_avoid()
230 /* Going too fast. Time to slow down in tcp_vegas_cong_avoid()
241 tp->snd_cwnd = min(tp->snd_cwnd, (u32)target_cwnd+1); in tcp_vegas_cong_avoid()
242 tp->snd_ssthresh = tcp_vegas_ssthresh(tp); in tcp_vegas_cong_avoid()
257 tp->snd_cwnd--; in tcp_vegas_cong_avoid()
258 tp->snd_ssthresh in tcp_vegas_cong_avoid()
264 tp->snd_cwnd++; in tcp_vegas_cong_avoid()
272 if (tp->snd_cwnd < 2) in tcp_vegas_cong_avoid()
273 tp->snd_cwnd = 2; in tcp_vegas_cong_avoid()
274 else if (tp->snd_cwnd > tp->snd_cwnd_clamp) in tcp_vegas_cong_avoid()
275 tp->snd_cwnd = tp->snd_cwnd_clamp; in tcp_vegas_cong_avoid()
277 tp->snd_ssthresh = tcp_current_ssthresh(sk); in tcp_vegas_cong_avoid()
281 vegas->cntRTT = 0; in tcp_vegas_cong_avoid()
282 vegas->minRTT = 0x7fffffff; in tcp_vegas_cong_avoid()
295 if (ext & (1 << (INET_DIAG_VEGASINFO - 1))) { in tcp_vegas_get_info()
296 info->vegas.tcpv_enabled = ca->doing_vegas_now; in tcp_vegas_get_info()
297 info->vegas.tcpv_rttcnt = ca->cntRTT; in tcp_vegas_get_info()
298 info->vegas.tcpv_rtt = ca->baseRTT; in tcp_vegas_get_info()
299 info->vegas.tcpv_minrtt = ca->minRTT; in tcp_vegas_get_info()