Lines Matching refs:w
62 struct westwood *w = inet_csk_ca(sk); in tcp_westwood_init() local
64 w->bk = 0; in tcp_westwood_init()
65 w->bw_ns_est = 0; in tcp_westwood_init()
66 w->bw_est = 0; in tcp_westwood_init()
67 w->accounted = 0; in tcp_westwood_init()
68 w->cumul_ack = 0; in tcp_westwood_init()
69 w->reset_rtt_min = 1; in tcp_westwood_init()
70 w->rtt_min = w->rtt = TCP_WESTWOOD_INIT_RTT; in tcp_westwood_init()
71 w->rtt_win_sx = tcp_time_stamp; in tcp_westwood_init()
72 w->snd_una = tcp_sk(sk)->snd_una; in tcp_westwood_init()
73 w->first_ack = 1; in tcp_westwood_init()
85 static void westwood_filter(struct westwood *w, u32 delta) in westwood_filter() argument
88 if (w->bw_ns_est == 0 && w->bw_est == 0) { in westwood_filter()
89 w->bw_ns_est = w->bk / delta; in westwood_filter()
90 w->bw_est = w->bw_ns_est; in westwood_filter()
92 w->bw_ns_est = westwood_do_filter(w->bw_ns_est, w->bk / delta); in westwood_filter()
93 w->bw_est = westwood_do_filter(w->bw_est, w->bw_ns_est); in westwood_filter()
104 struct westwood *w = inet_csk_ca(sk); in tcp_westwood_pkts_acked() local
107 w->rtt = usecs_to_jiffies(rtt); in tcp_westwood_pkts_acked()
117 struct westwood *w = inet_csk_ca(sk); in westwood_update_window() local
118 s32 delta = tcp_time_stamp - w->rtt_win_sx; in westwood_update_window()
124 if (w->first_ack) { in westwood_update_window()
125 w->snd_una = tcp_sk(sk)->snd_una; in westwood_update_window()
126 w->first_ack = 0; in westwood_update_window()
138 if (w->rtt && delta > max_t(u32, w->rtt, TCP_WESTWOOD_RTT_MIN)) { in westwood_update_window()
139 westwood_filter(w, delta); in westwood_update_window()
141 w->bk = 0; in westwood_update_window()
142 w->rtt_win_sx = tcp_time_stamp; in westwood_update_window()
146 static inline void update_rtt_min(struct westwood *w) in update_rtt_min() argument
148 if (w->reset_rtt_min) { in update_rtt_min()
149 w->rtt_min = w->rtt; in update_rtt_min()
150 w->reset_rtt_min = 0; in update_rtt_min()
152 w->rtt_min = min(w->rtt, w->rtt_min); in update_rtt_min()
164 struct westwood *w = inet_csk_ca(sk); in westwood_fast_bw() local
168 w->bk += tp->snd_una - w->snd_una; in westwood_fast_bw()
169 w->snd_una = tp->snd_una; in westwood_fast_bw()
170 update_rtt_min(w); in westwood_fast_bw()
181 struct westwood *w = inet_csk_ca(sk); in westwood_acked_count() local
183 w->cumul_ack = tp->snd_una - w->snd_una; in westwood_acked_count()
188 if (!w->cumul_ack) { in westwood_acked_count()
189 w->accounted += tp->mss_cache; in westwood_acked_count()
190 w->cumul_ack = tp->mss_cache; in westwood_acked_count()
193 if (w->cumul_ack > tp->mss_cache) { in westwood_acked_count()
195 if (w->accounted >= w->cumul_ack) { in westwood_acked_count()
196 w->accounted -= w->cumul_ack; in westwood_acked_count()
197 w->cumul_ack = tp->mss_cache; in westwood_acked_count()
199 w->cumul_ack -= w->accounted; in westwood_acked_count()
200 w->accounted = 0; in westwood_acked_count()
204 w->snd_una = tp->snd_una; in westwood_acked_count()
206 return w->cumul_ack; in westwood_acked_count()
218 const struct westwood *w = inet_csk_ca(sk); in tcp_westwood_bw_rttmin() local
220 return max_t(u32, (w->bw_est * w->rtt_min) / tp->mss_cache, 2); in tcp_westwood_bw_rttmin()
226 struct westwood *w = inet_csk_ca(sk); in tcp_westwood_ack() local
229 w->bk += westwood_acked_count(sk); in tcp_westwood_ack()
231 update_rtt_min(w); in tcp_westwood_ack()
241 struct westwood *w = inet_csk_ca(sk); in tcp_westwood_event() local
250 w->reset_rtt_min = 1; in tcp_westwood_event()