25 #include <linux/module.h>
27 #include <linux/inet_diag.h>
47 #define TCP_WESTWOOD_RTT_MIN (HZ/20)
48 #define TCP_WESTWOOD_INIT_RTT (20*HZ)
61 static void tcp_westwood_init(
struct sock *
sk)
73 w->
snd_una = tcp_sk(sk)->snd_una;
83 return ((7 * a) + b) >> 3;
105 struct westwood *w = inet_csk_ca(sk);
116 static void westwood_update_window(
struct sock *sk)
118 struct westwood *w = inet_csk_ca(sk);
126 w->
snd_una = tcp_sk(sk)->snd_una;
140 westwood_filter(w, delta);
147 static inline void update_rtt_min(
struct westwood *w)
163 static inline void westwood_fast_bw(
struct sock *sk)
165 const struct tcp_sock *tp = tcp_sk(sk);
166 struct westwood *w = inet_csk_ca(sk);
168 westwood_update_window(sk);
180 static inline u32 westwood_acked_count(
struct sock *sk)
182 const struct tcp_sock *tp = tcp_sk(sk);
183 struct westwood *w = inet_csk_ca(sk);
218 static u32 tcp_westwood_bw_rttmin(
const struct sock *sk)
220 const struct tcp_sock *tp = tcp_sk(sk);
221 const struct westwood *w = inet_csk_ca(sk);
228 struct westwood *w = inet_csk_ca(sk);
232 westwood_fast_bw(sk);
246 westwood_update_window(sk);
247 w->
bk += westwood_acked_count(sk);
259 static void tcp_westwood_info(
struct sock *sk,
u32 ext,
276 .init = tcp_westwood_init,
279 .min_cwnd = tcp_westwood_bw_rttmin,
280 .cwnd_event = tcp_westwood_event,
281 .get_info = tcp_westwood_info,
282 .pkts_acked = tcp_westwood_pkts_acked,
288 static int __init tcp_westwood_register(
void)
294 static void __exit tcp_westwood_unregister(
void)