diff options
Diffstat (limited to 'include/linux/tcp.h')
-rw-r--r-- | include/linux/tcp.h | 50 |
1 files changed, 11 insertions, 39 deletions
diff --git a/include/linux/tcp.h b/include/linux/tcp.h index 97a7c9e03df5..dfd93d03f5d2 100644 --- a/include/linux/tcp.h +++ b/include/linux/tcp.h | |||
@@ -127,6 +127,7 @@ enum { | |||
127 | #define TCP_WINDOW_CLAMP 10 /* Bound advertised window */ | 127 | #define TCP_WINDOW_CLAMP 10 /* Bound advertised window */ |
128 | #define TCP_INFO 11 /* Information about this connection. */ | 128 | #define TCP_INFO 11 /* Information about this connection. */ |
129 | #define TCP_QUICKACK 12 /* Block/reenable quick acks */ | 129 | #define TCP_QUICKACK 12 /* Block/reenable quick acks */ |
130 | #define TCP_CONGESTION 13 /* Congestion control algorithm */ | ||
130 | 131 | ||
131 | #define TCPI_OPT_TIMESTAMPS 1 | 132 | #define TCPI_OPT_TIMESTAMPS 1 |
132 | #define TCPI_OPT_SACK 2 | 133 | #define TCPI_OPT_SACK 2 |
@@ -203,13 +204,6 @@ struct tcp_sack_block { | |||
203 | __u32 end_seq; | 204 | __u32 end_seq; |
204 | }; | 205 | }; |
205 | 206 | ||
206 | enum tcp_congestion_algo { | ||
207 | TCP_RENO=0, | ||
208 | TCP_VEGAS, | ||
209 | TCP_WESTWOOD, | ||
210 | TCP_BIC, | ||
211 | }; | ||
212 | |||
213 | struct tcp_options_received { | 207 | struct tcp_options_received { |
214 | /* PAWS/RTTM data */ | 208 | /* PAWS/RTTM data */ |
215 | long ts_recent_stamp;/* Time we stored ts_recent (for aging) */ | 209 | long ts_recent_stamp;/* Time we stored ts_recent (for aging) */ |
@@ -305,7 +299,7 @@ struct tcp_sock { | |||
305 | __u8 reordering; /* Packet reordering metric. */ | 299 | __u8 reordering; /* Packet reordering metric. */ |
306 | __u8 frto_counter; /* Number of new acks after RTO */ | 300 | __u8 frto_counter; /* Number of new acks after RTO */ |
307 | 301 | ||
308 | __u8 adv_cong; /* Using Vegas, Westwood, or BIC */ | 302 | __u8 unused; |
309 | __u8 defer_accept; /* User waits for some data after accept() */ | 303 | __u8 defer_accept; /* User waits for some data after accept() */ |
310 | 304 | ||
311 | /* RTT measurement */ | 305 | /* RTT measurement */ |
@@ -401,37 +395,10 @@ struct tcp_sock { | |||
401 | __u32 time; | 395 | __u32 time; |
402 | } rcvq_space; | 396 | } rcvq_space; |
403 | 397 | ||
404 | /* TCP Westwood structure */ | 398 | /* Pluggable TCP congestion control hook */ |
405 | struct { | 399 | struct tcp_congestion_ops *ca_ops; |
406 | __u32 bw_ns_est; /* first bandwidth estimation..not too smoothed 8) */ | 400 | u32 ca_priv[16]; |
407 | __u32 bw_est; /* bandwidth estimate */ | 401 | #define TCP_CA_PRIV_SIZE (16*sizeof(u32)) |
408 | __u32 rtt_win_sx; /* here starts a new evaluation... */ | ||
409 | __u32 bk; | ||
410 | __u32 snd_una; /* used for evaluating the number of acked bytes */ | ||
411 | __u32 cumul_ack; | ||
412 | __u32 accounted; | ||
413 | __u32 rtt; | ||
414 | __u32 rtt_min; /* minimum observed RTT */ | ||
415 | } westwood; | ||
416 | |||
417 | /* Vegas variables */ | ||
418 | struct { | ||
419 | __u32 beg_snd_nxt; /* right edge during last RTT */ | ||
420 | __u32 beg_snd_una; /* left edge during last RTT */ | ||
421 | __u32 beg_snd_cwnd; /* saves the size of the cwnd */ | ||
422 | __u8 doing_vegas_now;/* if true, do vegas for this RTT */ | ||
423 | __u16 cntRTT; /* # of RTTs measured within last RTT */ | ||
424 | __u32 minRTT; /* min of RTTs measured within last RTT (in usec) */ | ||
425 | __u32 baseRTT; /* the min of all Vegas RTT measurements seen (in usec) */ | ||
426 | } vegas; | ||
427 | |||
428 | /* BI TCP Parameters */ | ||
429 | struct { | ||
430 | __u32 cnt; /* increase cwnd by 1 after this number of ACKs */ | ||
431 | __u32 last_max_cwnd; /* last maximium snd_cwnd */ | ||
432 | __u32 last_cwnd; /* the last snd_cwnd */ | ||
433 | __u32 last_stamp; /* time when updated last_cwnd */ | ||
434 | } bictcp; | ||
435 | }; | 402 | }; |
436 | 403 | ||
437 | static inline struct tcp_sock *tcp_sk(const struct sock *sk) | 404 | static inline struct tcp_sock *tcp_sk(const struct sock *sk) |
@@ -439,6 +406,11 @@ static inline struct tcp_sock *tcp_sk(const struct sock *sk) | |||
439 | return (struct tcp_sock *)sk; | 406 | return (struct tcp_sock *)sk; |
440 | } | 407 | } |
441 | 408 | ||
409 | static inline void *tcp_ca(const struct tcp_sock *tp) | ||
410 | { | ||
411 | return (void *) tp->ca_priv; | ||
412 | } | ||
413 | |||
442 | #endif | 414 | #endif |
443 | 415 | ||
444 | #endif /* _LINUX_TCP_H */ | 416 | #endif /* _LINUX_TCP_H */ |