aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@osdl.org>2005-06-23 15:19:55 -0400
committerDavid S. Miller <davem@davemloft.net>2005-06-23 15:19:55 -0400
commit317a76f9a44b437d6301718f4e5d08bd93f98da7 (patch)
treecaeba9839dee264f59b035b81c3d13d6c61b638e /include/linux
parenta8ad86f2dc46356f87be1327dabc18bdbda32f50 (diff)
[TCP]: Add pluggable congestion control algorithm infrastructure.
Allow TCP to have multiple pluggable congestion control algorithms. Algorithms are defined by a set of operations and can be built in or modules. The legacy "new RENO" algorithm is used as a starting point and fallback. Signed-off-by: Stephen Hemminger <shemminger@osdl.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/sysctl.h9
-rw-r--r--include/linux/tcp.h49
2 files changed, 11 insertions, 47 deletions
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h
index 614e939c78a4..72965bfe6cfb 100644
--- a/include/linux/sysctl.h
+++ b/include/linux/sysctl.h
@@ -333,21 +333,14 @@ enum
333 NET_TCP_FRTO=92, 333 NET_TCP_FRTO=92,
334 NET_TCP_LOW_LATENCY=93, 334 NET_TCP_LOW_LATENCY=93,
335 NET_IPV4_IPFRAG_SECRET_INTERVAL=94, 335 NET_IPV4_IPFRAG_SECRET_INTERVAL=94,
336 NET_TCP_WESTWOOD=95,
337 NET_IPV4_IGMP_MAX_MSF=96, 336 NET_IPV4_IGMP_MAX_MSF=96,
338 NET_TCP_NO_METRICS_SAVE=97, 337 NET_TCP_NO_METRICS_SAVE=97,
339 NET_TCP_VEGAS=98,
340 NET_TCP_VEGAS_ALPHA=99,
341 NET_TCP_VEGAS_BETA=100,
342 NET_TCP_VEGAS_GAMMA=101,
343 NET_TCP_BIC=102,
344 NET_TCP_BIC_FAST_CONVERGENCE=103,
345 NET_TCP_BIC_LOW_WINDOW=104,
346 NET_TCP_DEFAULT_WIN_SCALE=105, 338 NET_TCP_DEFAULT_WIN_SCALE=105,
347 NET_TCP_MODERATE_RCVBUF=106, 339 NET_TCP_MODERATE_RCVBUF=106,
348 NET_TCP_TSO_WIN_DIVISOR=107, 340 NET_TCP_TSO_WIN_DIVISOR=107,
349 NET_TCP_BIC_BETA=108, 341 NET_TCP_BIC_BETA=108,
350 NET_IPV4_ICMP_ERRORS_USE_INBOUND_IFADDR=109, 342 NET_IPV4_ICMP_ERRORS_USE_INBOUND_IFADDR=109,
343 NET_TCP_CONG_CONTROL=110,
351}; 344};
352 345
353enum { 346enum {
diff --git a/include/linux/tcp.h b/include/linux/tcp.h
index 97a7c9e03df5..3ea75dd6640a 100644
--- a/include/linux/tcp.h
+++ b/include/linux/tcp.h
@@ -203,13 +203,6 @@ struct tcp_sack_block {
203 __u32 end_seq; 203 __u32 end_seq;
204}; 204};
205 205
206enum tcp_congestion_algo {
207 TCP_RENO=0,
208 TCP_VEGAS,
209 TCP_WESTWOOD,
210 TCP_BIC,
211};
212
213struct tcp_options_received { 206struct tcp_options_received {
214/* PAWS/RTTM data */ 207/* PAWS/RTTM data */
215 long ts_recent_stamp;/* Time we stored ts_recent (for aging) */ 208 long ts_recent_stamp;/* Time we stored ts_recent (for aging) */
@@ -305,7 +298,7 @@ struct tcp_sock {
305 __u8 reordering; /* Packet reordering metric. */ 298 __u8 reordering; /* Packet reordering metric. */
306 __u8 frto_counter; /* Number of new acks after RTO */ 299 __u8 frto_counter; /* Number of new acks after RTO */
307 300
308 __u8 adv_cong; /* Using Vegas, Westwood, or BIC */ 301 __u8 unused;
309 __u8 defer_accept; /* User waits for some data after accept() */ 302 __u8 defer_accept; /* User waits for some data after accept() */
310 303
311/* RTT measurement */ 304/* RTT measurement */
@@ -401,37 +394,10 @@ struct tcp_sock {
401 __u32 time; 394 __u32 time;
402 } rcvq_space; 395 } rcvq_space;
403 396
404/* TCP Westwood structure */ 397 /* Pluggable TCP congestion control hook */
405 struct { 398 struct tcp_congestion_ops *ca_ops;
406 __u32 bw_ns_est; /* first bandwidth estimation..not too smoothed 8) */ 399 u32 ca_priv[16];
407 __u32 bw_est; /* bandwidth estimate */ 400#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}; 401};
436 402
437static inline struct tcp_sock *tcp_sk(const struct sock *sk) 403static inline struct tcp_sock *tcp_sk(const struct sock *sk)
@@ -439,6 +405,11 @@ static inline struct tcp_sock *tcp_sk(const struct sock *sk)
439 return (struct tcp_sock *)sk; 405 return (struct tcp_sock *)sk;
440} 406}
441 407
408static inline void *tcp_ca(const struct tcp_sock *tp)
409{
410 return (void *) tp->ca_priv;
411}
412
442#endif 413#endif
443 414
444#endif /* _LINUX_TCP_H */ 415#endif /* _LINUX_TCP_H */