diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2010-09-24 02:59:47 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2010-09-24 02:59:47 +0000 |
commit | 31e2f59e8c8a6fa052489381e45a195e88ce638c (patch) | |
tree | 986bd8c580c587575ac30f491bb3ca9e441f0d75 /sys/netinet/tcp_var.h | |
parent | 1e5d893cfbeb506fb1db4168cecd4a2484185f27 (diff) |
TCP send and recv buffer scaling.
Send buffer is scaled by not accounting unacknowledged on the wire
data against the buffer limit. Receive buffer scaling is done similar
to FreeBSD -- measure the delay * bandwith product and base the
buffer on that. The problem is that our RTT measurment is coarse
so it overshoots on low delay links. This does not matter that much
since the recvbuffer is almost always empty.
Add a back pressure mechanism to control the amount of memory
assigned to socketbuffers that kicks in when 80% of the cluster
pool is used.
Increases the download speed from 300kB/s to 4.4MB/s on ftp.eu.openbsd.org.
Based on work by markus@ and djm@.
OK dlg@, henning@, put it in deraadt@
Diffstat (limited to 'sys/netinet/tcp_var.h')
-rw-r--r-- | sys/netinet/tcp_var.h | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/sys/netinet/tcp_var.h b/sys/netinet/tcp_var.h index 1558747c0fd..dcca8ad53a9 100644 --- a/sys/netinet/tcp_var.h +++ b/sys/netinet/tcp_var.h @@ -1,4 +1,4 @@ -/* $OpenBSD: tcp_var.h,v 1.95 2010/07/09 16:58:06 reyk Exp $ */ +/* $OpenBSD: tcp_var.h,v 1.96 2010/09/24 02:59:46 claudio Exp $ */ /* $NetBSD: tcp_var.h,v 1.17 1996/02/13 23:44:24 christos Exp $ */ /* @@ -151,6 +151,11 @@ struct tcpcb { * for slow start exponential to * linear switch */ + +/* auto-sizing variables */ + u_int rfbuf_cnt; /* recv buffer autoscaling byte count */ + u_int32_t rfbuf_ts; /* recv buffer autoscaling time stamp */ + u_short t_maxopd; /* mss plus options */ u_short t_peermss; /* peer's maximum segment size */ @@ -476,8 +481,8 @@ struct tcpstat { { "keepintvl", CTLTYPE_INT }, \ { "slowhz", CTLTYPE_INT }, \ { "baddynamic", CTLTYPE_STRUCT }, \ - { "recvspace", CTLTYPE_INT }, \ - { "sendspace", CTLTYPE_INT }, \ + { NULL, 0 }, \ + { NULL, 0 }, \ { "ident", CTLTYPE_STRUCT }, \ { "sack", CTLTYPE_INT }, \ { "mssdflt", CTLTYPE_INT }, \ @@ -501,8 +506,8 @@ struct tcpstat { &tcp_keepintvl, \ NULL, \ NULL, \ - &tcp_recvspace, \ - &tcp_sendspace, \ + NULL, \ + NULL, \ NULL, \ NULL, \ &tcp_mssdflt, \ @@ -590,6 +595,8 @@ void tcp_rscale(struct tcpcb *, u_long); void tcp_respond(struct tcpcb *, caddr_t, struct tcphdr *, tcp_seq, tcp_seq, int, u_int); void tcp_setpersist(struct tcpcb *); +void tcp_update_sndspace(struct tcpcb *); +void tcp_update_rcvspace(struct tcpcb *); void tcp_slowtimo(void); struct mbuf * tcp_template(struct tcpcb *); |