diff options
author | Andre Oppermann <andre@FreeBSD.org> | 2007-02-01 17:39:18 +0000 |
---|---|---|
committer | Andre Oppermann <andre@FreeBSD.org> | 2007-02-01 17:39:18 +0000 |
commit | 087b55ea59aa039e88c0f675ce16a5d70948227c (patch) | |
tree | 997d5976c92bdd0ed0325563e1ec45738a2a3a73 /sys/netinet/tcp_usrreq.c | |
parent | 103fcbb3ba6f111f4bb55ebf03ae5200cd78a5a1 (diff) | |
download | src-087b55ea59aa039e88c0f675ce16a5d70948227c.tar.gz src-087b55ea59aa039e88c0f675ce16a5d70948227c.zip |
Change the way the advertized TCP window scaling is computed. Instead of
upper-bounding it to the size of the initial socket buffer lower-bound it
to the smallest MSS we accept. Ideally we'd use the actual MSS information
here but it is not available yet.
For socket buffer auto sizing to be effective we need room to grow the
receive window. The window scale shift is determined at connection setup
and can't be changed afterwards. The previous, original, method effectively
just did a power of two roundup of the socket buffer size at connection
setup severely limiting the headroom for larger socket buffers.
Tested by: many (as part of the socket buffer auto sizing patch)
MFC after: 1 month
Notes
Notes:
svn path=/head/; revision=166403
Diffstat (limited to 'sys/netinet/tcp_usrreq.c')
-rw-r--r-- | sys/netinet/tcp_usrreq.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c index fa522b4e5ca9..35536617b78c 100644 --- a/sys/netinet/tcp_usrreq.c +++ b/sys/netinet/tcp_usrreq.c @@ -1131,9 +1131,14 @@ tcp_connect(tp, nam, td) inp->inp_laddr = laddr; in_pcbrehash(inp); - /* Compute window scaling to request. */ + /* + * Compute window scaling to request: + * Scale to fit into sweet spot. See tcp_syncache.c. + * XXX: This should move to tcp_output(). + * XXX: This should be based on the actual MSS. + */ while (tp->request_r_scale < TCP_MAX_WINSHIFT && - (TCP_MAXWIN << tp->request_r_scale) < so->so_rcv.sb_hiwat) + (0x1 << tp->request_r_scale) < tcp_minmss) tp->request_r_scale++; soisconnecting(so); |