Stephen Hemminger | 8727076 | 2005-06-23 12:24:09 -0700 | [diff] [blame] | 1 | /* |
Luca De Cicco | b7d7a9e | 2006-06-11 23:01:39 -0700 | [diff] [blame] | 2 | * TCP Westwood+: end-to-end bandwidth estimation for TCP |
Stephen Hemminger | 8727076 | 2005-06-23 12:24:09 -0700 | [diff] [blame] | 3 | * |
Luca De Cicco | b7d7a9e | 2006-06-11 23:01:39 -0700 | [diff] [blame] | 4 | * Angelo Dell'Aera: author of the first version of TCP Westwood+ in Linux 2.4 |
| 5 | * |
| 6 | * Support at http://c3lab.poliba.it/index.php/Westwood |
| 7 | * Main references in literature: |
| 8 | * |
| 9 | * - Mascolo S, Casetti, M. Gerla et al. |
| 10 | * "TCP Westwood: bandwidth estimation for TCP" Proc. ACM Mobicom 2001 |
| 11 | * |
| 12 | * - A. Grieco, s. Mascolo |
| 13 | * "Performance evaluation of New Reno, Vegas, Westwood+ TCP" ACM Computer |
| 14 | * Comm. Review, 2004 |
| 15 | * |
| 16 | * - A. Dell'Aera, L. Grieco, S. Mascolo. |
| 17 | * "Linux 2.4 Implementation of Westwood+ TCP with Rate-Halving : |
| 18 | * A Performance Evaluation Over the Internet" (ICC 2004), Paris, June 2004 |
| 19 | * |
| 20 | * Westwood+ employs end-to-end bandwidth measurement to set cwnd and |
| 21 | * ssthresh after packet loss. The probing phase is as the original Reno. |
Stephen Hemminger | 8727076 | 2005-06-23 12:24:09 -0700 | [diff] [blame] | 22 | */ |
| 23 | |
Stephen Hemminger | 8727076 | 2005-06-23 12:24:09 -0700 | [diff] [blame] | 24 | #include <linux/mm.h> |
| 25 | #include <linux/module.h> |
| 26 | #include <linux/skbuff.h> |
Arnaldo Carvalho de Melo | a8c2190 | 2005-08-12 12:56:38 -0300 | [diff] [blame] | 27 | #include <linux/inet_diag.h> |
Stephen Hemminger | 8727076 | 2005-06-23 12:24:09 -0700 | [diff] [blame] | 28 | #include <net/tcp.h> |
| 29 | |
| 30 | /* TCP Westwood structure */ |
| 31 | struct westwood { |
| 32 | u32 bw_ns_est; /* first bandwidth estimation..not too smoothed 8) */ |
| 33 | u32 bw_est; /* bandwidth estimate */ |
| 34 | u32 rtt_win_sx; /* here starts a new evaluation... */ |
| 35 | u32 bk; |
| 36 | u32 snd_una; /* used for evaluating the number of acked bytes */ |
| 37 | u32 cumul_ack; |
| 38 | u32 accounted; |
| 39 | u32 rtt; |
| 40 | u32 rtt_min; /* minimum observed RTT */ |
Stephen Hemminger | f61e290 | 2006-06-11 23:01:02 -0700 | [diff] [blame] | 41 | u8 first_ack; /* flag which infers that this is the first ack */ |
Luca De Cicco | bc726a7 | 2006-06-11 23:02:19 -0700 | [diff] [blame] | 42 | u8 reset_rtt_min; /* Reset RTT min to next RTT sample*/ |
Stephen Hemminger | 8727076 | 2005-06-23 12:24:09 -0700 | [diff] [blame] | 43 | }; |
| 44 | |
Stephen Hemminger | 8727076 | 2005-06-23 12:24:09 -0700 | [diff] [blame] | 45 | /* TCP Westwood functions and constants */ |
| 46 | #define TCP_WESTWOOD_RTT_MIN (HZ/20) /* 50ms */ |
| 47 | #define TCP_WESTWOOD_INIT_RTT (20*HZ) /* maybe too conservative?! */ |
| 48 | |
| 49 | /* |
| 50 | * @tcp_westwood_create |
| 51 | * This function initializes fields used in TCP Westwood+, |
| 52 | * it is called after the initial SYN, so the sequence numbers |
| 53 | * are correct but new passive connections we have no |
| 54 | * information about RTTmin at this time so we simply set it to |
| 55 | * TCP_WESTWOOD_INIT_RTT. This value was chosen to be too conservative |
| 56 | * since in this way we're sure it will be updated in a consistent |
| 57 | * way as soon as possible. It will reasonably happen within the first |
| 58 | * RTT period of the connection lifetime. |
| 59 | */ |
Arnaldo Carvalho de Melo | 6687e98 | 2005-08-10 04:03:31 -0300 | [diff] [blame] | 60 | static void tcp_westwood_init(struct sock *sk) |
Stephen Hemminger | 8727076 | 2005-06-23 12:24:09 -0700 | [diff] [blame] | 61 | { |
Arnaldo Carvalho de Melo | 6687e98 | 2005-08-10 04:03:31 -0300 | [diff] [blame] | 62 | struct westwood *w = inet_csk_ca(sk); |
Stephen Hemminger | 8727076 | 2005-06-23 12:24:09 -0700 | [diff] [blame] | 63 | |
| 64 | w->bk = 0; |
YOSHIFUJI Hideaki | e905a9e | 2007-02-09 23:24:47 +0900 | [diff] [blame] | 65 | w->bw_ns_est = 0; |
| 66 | w->bw_est = 0; |
| 67 | w->accounted = 0; |
| 68 | w->cumul_ack = 0; |
Luca De Cicco | bc726a7 | 2006-06-11 23:02:19 -0700 | [diff] [blame] | 69 | w->reset_rtt_min = 1; |
Stephen Hemminger | 8727076 | 2005-06-23 12:24:09 -0700 | [diff] [blame] | 70 | w->rtt_min = w->rtt = TCP_WESTWOOD_INIT_RTT; |
Eric Dumazet | ad5ad69 | 2017-05-16 14:00:11 -0700 | [diff] [blame] | 71 | w->rtt_win_sx = tcp_jiffies32; |
Arnaldo Carvalho de Melo | 6687e98 | 2005-08-10 04:03:31 -0300 | [diff] [blame] | 72 | w->snd_una = tcp_sk(sk)->snd_una; |
Stephen Hemminger | f61e290 | 2006-06-11 23:01:02 -0700 | [diff] [blame] | 73 | w->first_ack = 1; |
Stephen Hemminger | 8727076 | 2005-06-23 12:24:09 -0700 | [diff] [blame] | 74 | } |
| 75 | |
| 76 | /* |
| 77 | * @westwood_do_filter |
| 78 | * Low-pass filter. Implemented using constant coefficients. |
| 79 | */ |
| 80 | static inline u32 westwood_do_filter(u32 a, u32 b) |
| 81 | { |
Eric Dumazet | a02cec2 | 2010-09-22 20:43:57 +0000 | [diff] [blame] | 82 | return ((7 * a) + b) >> 3; |
Stephen Hemminger | 8727076 | 2005-06-23 12:24:09 -0700 | [diff] [blame] | 83 | } |
| 84 | |
Luca De Cicco | b3a92ea | 2006-06-11 23:01:59 -0700 | [diff] [blame] | 85 | static void westwood_filter(struct westwood *w, u32 delta) |
Stephen Hemminger | 8727076 | 2005-06-23 12:24:09 -0700 | [diff] [blame] | 86 | { |
Luca De Cicco | b3a92ea | 2006-06-11 23:01:59 -0700 | [diff] [blame] | 87 | /* If the filter is empty fill it with the first sample of bandwidth */ |
| 88 | if (w->bw_ns_est == 0 && w->bw_est == 0) { |
| 89 | w->bw_ns_est = w->bk / delta; |
| 90 | w->bw_est = w->bw_ns_est; |
| 91 | } else { |
| 92 | w->bw_ns_est = westwood_do_filter(w->bw_ns_est, w->bk / delta); |
| 93 | w->bw_est = westwood_do_filter(w->bw_est, w->bw_ns_est); |
| 94 | } |
Stephen Hemminger | 8727076 | 2005-06-23 12:24:09 -0700 | [diff] [blame] | 95 | } |
| 96 | |
| 97 | /* |
| 98 | * @westwood_pkts_acked |
| 99 | * Called after processing group of packets. |
| 100 | * but all westwood needs is the last sample of srtt. |
| 101 | */ |
Lawrence Brakmo | 756ee17 | 2016-05-11 10:02:13 -0700 | [diff] [blame] | 102 | static void tcp_westwood_pkts_acked(struct sock *sk, |
| 103 | const struct ack_sample *sample) |
Stephen Hemminger | 8727076 | 2005-06-23 12:24:09 -0700 | [diff] [blame] | 104 | { |
Arnaldo Carvalho de Melo | 6687e98 | 2005-08-10 04:03:31 -0300 | [diff] [blame] | 105 | struct westwood *w = inet_csk_ca(sk); |
Stephen Hemminger | 30cfd0b | 2007-07-25 23:49:34 -0700 | [diff] [blame] | 106 | |
Lawrence Brakmo | 756ee17 | 2016-05-11 10:02:13 -0700 | [diff] [blame] | 107 | if (sample->rtt_us > 0) |
| 108 | w->rtt = usecs_to_jiffies(sample->rtt_us); |
Stephen Hemminger | 8727076 | 2005-06-23 12:24:09 -0700 | [diff] [blame] | 109 | } |
| 110 | |
| 111 | /* |
| 112 | * @westwood_update_window |
| 113 | * It updates RTT evaluation window if it is the right moment to do |
| 114 | * it. If so it calls filter for evaluating bandwidth. |
| 115 | */ |
Arnaldo Carvalho de Melo | 6687e98 | 2005-08-10 04:03:31 -0300 | [diff] [blame] | 116 | static void westwood_update_window(struct sock *sk) |
Stephen Hemminger | 8727076 | 2005-06-23 12:24:09 -0700 | [diff] [blame] | 117 | { |
Arnaldo Carvalho de Melo | 6687e98 | 2005-08-10 04:03:31 -0300 | [diff] [blame] | 118 | struct westwood *w = inet_csk_ca(sk); |
Eric Dumazet | ad5ad69 | 2017-05-16 14:00:11 -0700 | [diff] [blame] | 119 | s32 delta = tcp_jiffies32 - w->rtt_win_sx; |
Stephen Hemminger | 8727076 | 2005-06-23 12:24:09 -0700 | [diff] [blame] | 120 | |
Luca De Cicco | b7d7a9e | 2006-06-11 23:01:39 -0700 | [diff] [blame] | 121 | /* Initialize w->snd_una with the first acked sequence number in order |
Stephen Hemminger | f61e290 | 2006-06-11 23:01:02 -0700 | [diff] [blame] | 122 | * to fix mismatch between tp->snd_una and w->snd_una for the first |
| 123 | * bandwidth sample |
| 124 | */ |
YOSHIFUJI Hideaki | e905a9e | 2007-02-09 23:24:47 +0900 | [diff] [blame] | 125 | if (w->first_ack) { |
Stephen Hemminger | f61e290 | 2006-06-11 23:01:02 -0700 | [diff] [blame] | 126 | w->snd_una = tcp_sk(sk)->snd_una; |
| 127 | w->first_ack = 0; |
| 128 | } |
| 129 | |
Stephen Hemminger | 8727076 | 2005-06-23 12:24:09 -0700 | [diff] [blame] | 130 | /* |
| 131 | * See if a RTT-window has passed. |
| 132 | * Be careful since if RTT is less than |
| 133 | * 50ms we don't filter but we continue 'building the sample'. |
| 134 | * This minimum limit was chosen since an estimation on small |
| 135 | * time intervals is better to avoid... |
| 136 | * Obviously on a LAN we reasonably will always have |
| 137 | * right_bound = left_bound + WESTWOOD_RTT_MIN |
| 138 | */ |
| 139 | if (w->rtt && delta > max_t(u32, w->rtt, TCP_WESTWOOD_RTT_MIN)) { |
| 140 | westwood_filter(w, delta); |
| 141 | |
| 142 | w->bk = 0; |
Eric Dumazet | ad5ad69 | 2017-05-16 14:00:11 -0700 | [diff] [blame] | 143 | w->rtt_win_sx = tcp_jiffies32; |
Stephen Hemminger | 8727076 | 2005-06-23 12:24:09 -0700 | [diff] [blame] | 144 | } |
| 145 | } |
| 146 | |
Luca De Cicco | bc726a7 | 2006-06-11 23:02:19 -0700 | [diff] [blame] | 147 | static inline void update_rtt_min(struct westwood *w) |
| 148 | { |
| 149 | if (w->reset_rtt_min) { |
| 150 | w->rtt_min = w->rtt; |
YOSHIFUJI Hideaki | e905a9e | 2007-02-09 23:24:47 +0900 | [diff] [blame] | 151 | w->reset_rtt_min = 0; |
Luca De Cicco | bc726a7 | 2006-06-11 23:02:19 -0700 | [diff] [blame] | 152 | } else |
| 153 | w->rtt_min = min(w->rtt, w->rtt_min); |
| 154 | } |
| 155 | |
Stephen Hemminger | 8727076 | 2005-06-23 12:24:09 -0700 | [diff] [blame] | 156 | /* |
| 157 | * @westwood_fast_bw |
| 158 | * It is called when we are in fast path. In particular it is called when |
| 159 | * header prediction is successful. In such case in fact update is |
| 160 | * straight forward and doesn't need any particular care. |
| 161 | */ |
Arnaldo Carvalho de Melo | 6687e98 | 2005-08-10 04:03:31 -0300 | [diff] [blame] | 162 | static inline void westwood_fast_bw(struct sock *sk) |
Stephen Hemminger | 8727076 | 2005-06-23 12:24:09 -0700 | [diff] [blame] | 163 | { |
Arnaldo Carvalho de Melo | 6687e98 | 2005-08-10 04:03:31 -0300 | [diff] [blame] | 164 | const struct tcp_sock *tp = tcp_sk(sk); |
| 165 | struct westwood *w = inet_csk_ca(sk); |
Stephen Hemminger | 8727076 | 2005-06-23 12:24:09 -0700 | [diff] [blame] | 166 | |
Arnaldo Carvalho de Melo | 6687e98 | 2005-08-10 04:03:31 -0300 | [diff] [blame] | 167 | westwood_update_window(sk); |
Stephen Hemminger | 8727076 | 2005-06-23 12:24:09 -0700 | [diff] [blame] | 168 | |
| 169 | w->bk += tp->snd_una - w->snd_una; |
| 170 | w->snd_una = tp->snd_una; |
Luca De Cicco | bc726a7 | 2006-06-11 23:02:19 -0700 | [diff] [blame] | 171 | update_rtt_min(w); |
Stephen Hemminger | 8727076 | 2005-06-23 12:24:09 -0700 | [diff] [blame] | 172 | } |
| 173 | |
| 174 | /* |
| 175 | * @westwood_acked_count |
| 176 | * This function evaluates cumul_ack for evaluating bk in case of |
| 177 | * delayed or partial acks. |
| 178 | */ |
Arnaldo Carvalho de Melo | 6687e98 | 2005-08-10 04:03:31 -0300 | [diff] [blame] | 179 | static inline u32 westwood_acked_count(struct sock *sk) |
Stephen Hemminger | 8727076 | 2005-06-23 12:24:09 -0700 | [diff] [blame] | 180 | { |
Arnaldo Carvalho de Melo | 6687e98 | 2005-08-10 04:03:31 -0300 | [diff] [blame] | 181 | const struct tcp_sock *tp = tcp_sk(sk); |
| 182 | struct westwood *w = inet_csk_ca(sk); |
Stephen Hemminger | 8727076 | 2005-06-23 12:24:09 -0700 | [diff] [blame] | 183 | |
| 184 | w->cumul_ack = tp->snd_una - w->snd_una; |
| 185 | |
YOSHIFUJI Hideaki | e905a9e | 2007-02-09 23:24:47 +0900 | [diff] [blame] | 186 | /* If cumul_ack is 0 this is a dupack since it's not moving |
| 187 | * tp->snd_una. |
| 188 | */ |
| 189 | if (!w->cumul_ack) { |
Stephen Hemminger | 8727076 | 2005-06-23 12:24:09 -0700 | [diff] [blame] | 190 | w->accounted += tp->mss_cache; |
| 191 | w->cumul_ack = tp->mss_cache; |
| 192 | } |
| 193 | |
YOSHIFUJI Hideaki | e905a9e | 2007-02-09 23:24:47 +0900 | [diff] [blame] | 194 | if (w->cumul_ack > tp->mss_cache) { |
Stephen Hemminger | 8727076 | 2005-06-23 12:24:09 -0700 | [diff] [blame] | 195 | /* Partial or delayed ack */ |
| 196 | if (w->accounted >= w->cumul_ack) { |
| 197 | w->accounted -= w->cumul_ack; |
| 198 | w->cumul_ack = tp->mss_cache; |
| 199 | } else { |
| 200 | w->cumul_ack -= w->accounted; |
| 201 | w->accounted = 0; |
| 202 | } |
| 203 | } |
| 204 | |
| 205 | w->snd_una = tp->snd_una; |
| 206 | |
| 207 | return w->cumul_ack; |
| 208 | } |
| 209 | |
Stephen Hemminger | 8727076 | 2005-06-23 12:24:09 -0700 | [diff] [blame] | 210 | /* |
| 211 | * TCP Westwood |
| 212 | * Here limit is evaluated as Bw estimation*RTTmin (for obtaining it |
| 213 | * in packets we use mss_cache). Rttmin is guaranteed to be >= 2 |
| 214 | * so avoids ever returning 0. |
| 215 | */ |
Stephen Hemminger | 72dc5b9 | 2006-06-05 17:30:08 -0700 | [diff] [blame] | 216 | static u32 tcp_westwood_bw_rttmin(const struct sock *sk) |
Stephen Hemminger | 8727076 | 2005-06-23 12:24:09 -0700 | [diff] [blame] | 217 | { |
Stephen Hemminger | 72dc5b9 | 2006-06-05 17:30:08 -0700 | [diff] [blame] | 218 | const struct tcp_sock *tp = tcp_sk(sk); |
| 219 | const struct westwood *w = inet_csk_ca(sk); |
stephen hemminger | 688d194 | 2014-08-29 23:32:05 -0700 | [diff] [blame] | 220 | |
Stephen Hemminger | 72dc5b9 | 2006-06-05 17:30:08 -0700 | [diff] [blame] | 221 | return max_t(u32, (w->bw_est * w->rtt_min) / tp->mss_cache, 2); |
Stephen Hemminger | 8727076 | 2005-06-23 12:24:09 -0700 | [diff] [blame] | 222 | } |
| 223 | |
Florian Westphal | 7354c8c | 2014-09-26 22:37:34 +0200 | [diff] [blame] | 224 | static void tcp_westwood_ack(struct sock *sk, u32 ack_flags) |
| 225 | { |
| 226 | if (ack_flags & CA_ACK_SLOWPATH) { |
| 227 | struct westwood *w = inet_csk_ca(sk); |
| 228 | |
| 229 | westwood_update_window(sk); |
| 230 | w->bk += westwood_acked_count(sk); |
| 231 | |
| 232 | update_rtt_min(w); |
| 233 | return; |
| 234 | } |
| 235 | |
| 236 | westwood_fast_bw(sk); |
| 237 | } |
| 238 | |
Arnaldo Carvalho de Melo | 6687e98 | 2005-08-10 04:03:31 -0300 | [diff] [blame] | 239 | static void tcp_westwood_event(struct sock *sk, enum tcp_ca_event event) |
Stephen Hemminger | 8727076 | 2005-06-23 12:24:09 -0700 | [diff] [blame] | 240 | { |
Arnaldo Carvalho de Melo | 6687e98 | 2005-08-10 04:03:31 -0300 | [diff] [blame] | 241 | struct tcp_sock *tp = tcp_sk(sk); |
| 242 | struct westwood *w = inet_csk_ca(sk); |
Luca De Cicco | b7d7a9e | 2006-06-11 23:01:39 -0700 | [diff] [blame] | 243 | |
Stephen Hemminger | 2de979b | 2007-03-08 20:45:19 -0800 | [diff] [blame] | 244 | switch (event) { |
Stephen Hemminger | 8727076 | 2005-06-23 12:24:09 -0700 | [diff] [blame] | 245 | case CA_EVENT_COMPLETE_CWR: |
Stephen Hemminger | 72dc5b9 | 2006-06-05 17:30:08 -0700 | [diff] [blame] | 246 | tp->snd_cwnd = tp->snd_ssthresh = tcp_westwood_bw_rttmin(sk); |
Stephen Hemminger | 8727076 | 2005-06-23 12:24:09 -0700 | [diff] [blame] | 247 | break; |
Yuchung Cheng | 9b44190 | 2013-03-20 13:32:58 +0000 | [diff] [blame] | 248 | case CA_EVENT_LOSS: |
Stephen Hemminger | 72dc5b9 | 2006-06-05 17:30:08 -0700 | [diff] [blame] | 249 | tp->snd_ssthresh = tcp_westwood_bw_rttmin(sk); |
YOSHIFUJI Hideaki | e905a9e | 2007-02-09 23:24:47 +0900 | [diff] [blame] | 250 | /* Update RTT_min when next ack arrives */ |
Luca De Cicco | bc726a7 | 2006-06-11 23:02:19 -0700 | [diff] [blame] | 251 | w->reset_rtt_min = 1; |
Stephen Hemminger | 8727076 | 2005-06-23 12:24:09 -0700 | [diff] [blame] | 252 | break; |
Stephen Hemminger | 8727076 | 2005-06-23 12:24:09 -0700 | [diff] [blame] | 253 | default: |
| 254 | /* don't care */ |
| 255 | break; |
| 256 | } |
| 257 | } |
| 258 | |
Stephen Hemminger | 8727076 | 2005-06-23 12:24:09 -0700 | [diff] [blame] | 259 | /* Extract info for Tcp socket info provided via netlink. */ |
Eric Dumazet | 31ccd0e | 2015-04-29 16:20:58 -0700 | [diff] [blame] | 260 | static size_t tcp_westwood_info(struct sock *sk, u32 ext, int *attr, |
| 261 | union tcp_cc_info *info) |
Stephen Hemminger | 8727076 | 2005-06-23 12:24:09 -0700 | [diff] [blame] | 262 | { |
Arnaldo Carvalho de Melo | 6687e98 | 2005-08-10 04:03:31 -0300 | [diff] [blame] | 263 | const struct westwood *ca = inet_csk_ca(sk); |
stephen hemminger | 688d194 | 2014-08-29 23:32:05 -0700 | [diff] [blame] | 264 | |
Arnaldo Carvalho de Melo | 73c1f4a | 2005-08-12 12:51:49 -0300 | [diff] [blame] | 265 | if (ext & (1 << (INET_DIAG_VEGASINFO - 1))) { |
Eric Dumazet | 31ccd0e | 2015-04-29 16:20:58 -0700 | [diff] [blame] | 266 | info->vegas.tcpv_enabled = 1; |
| 267 | info->vegas.tcpv_rttcnt = 0; |
chun Long | be7164c | 2017-03-14 15:26:24 +0800 | [diff] [blame] | 268 | info->vegas.tcpv_rtt = jiffies_to_usecs(ca->rtt); |
| 269 | info->vegas.tcpv_minrtt = jiffies_to_usecs(ca->rtt_min); |
Stephen Hemminger | 8727076 | 2005-06-23 12:24:09 -0700 | [diff] [blame] | 270 | |
Eric Dumazet | 31ccd0e | 2015-04-29 16:20:58 -0700 | [diff] [blame] | 271 | *attr = INET_DIAG_VEGASINFO; |
| 272 | return sizeof(struct tcpvegas_info); |
Stephen Hemminger | 8727076 | 2005-06-23 12:24:09 -0700 | [diff] [blame] | 273 | } |
Eric Dumazet | 521f1cf | 2015-04-16 18:10:35 -0700 | [diff] [blame] | 274 | return 0; |
Stephen Hemminger | 8727076 | 2005-06-23 12:24:09 -0700 | [diff] [blame] | 275 | } |
| 276 | |
Stephen Hemminger | a252beb | 2011-03-10 00:40:17 -0800 | [diff] [blame] | 277 | static struct tcp_congestion_ops tcp_westwood __read_mostly = { |
Stephen Hemminger | 8727076 | 2005-06-23 12:24:09 -0700 | [diff] [blame] | 278 | .init = tcp_westwood_init, |
| 279 | .ssthresh = tcp_reno_ssthresh, |
| 280 | .cong_avoid = tcp_reno_cong_avoid, |
Florian Westphal | e979918 | 2016-11-21 14:18:38 +0100 | [diff] [blame] | 281 | .undo_cwnd = tcp_reno_undo_cwnd, |
Stephen Hemminger | 8727076 | 2005-06-23 12:24:09 -0700 | [diff] [blame] | 282 | .cwnd_event = tcp_westwood_event, |
Florian Westphal | 7354c8c | 2014-09-26 22:37:34 +0200 | [diff] [blame] | 283 | .in_ack_event = tcp_westwood_ack, |
Stephen Hemminger | 8727076 | 2005-06-23 12:24:09 -0700 | [diff] [blame] | 284 | .get_info = tcp_westwood_info, |
| 285 | .pkts_acked = tcp_westwood_pkts_acked, |
| 286 | |
| 287 | .owner = THIS_MODULE, |
| 288 | .name = "westwood" |
| 289 | }; |
| 290 | |
| 291 | static int __init tcp_westwood_register(void) |
| 292 | { |
Alexey Dobriyan | 74975d4 | 2006-08-25 17:10:33 -0700 | [diff] [blame] | 293 | BUILD_BUG_ON(sizeof(struct westwood) > ICSK_CA_PRIV_SIZE); |
Stephen Hemminger | 8727076 | 2005-06-23 12:24:09 -0700 | [diff] [blame] | 294 | return tcp_register_congestion_control(&tcp_westwood); |
| 295 | } |
| 296 | |
| 297 | static void __exit tcp_westwood_unregister(void) |
| 298 | { |
| 299 | tcp_unregister_congestion_control(&tcp_westwood); |
| 300 | } |
| 301 | |
| 302 | module_init(tcp_westwood_register); |
| 303 | module_exit(tcp_westwood_unregister); |
| 304 | |
| 305 | MODULE_AUTHOR("Stephen Hemminger, Angelo Dell'Aera"); |
| 306 | MODULE_LICENSE("GPL"); |
| 307 | MODULE_DESCRIPTION("TCP Westwood+"); |