summaryrefslogtreecommitdiff
path: root/sys/netinet/tcp_usrreq.c
diff options
context:
space:
mode:
authorNiels Provos <provos@cvs.openbsd.org>2002-08-08 17:07:33 +0000
committerNiels Provos <provos@cvs.openbsd.org>2002-08-08 17:07:33 +0000
commit645bfcfc7a44cb3eef794f55a0f348cdbb48b20c (patch)
tree65348cbbc69a068876bfe2a31a3287f71b482d02 /sys/netinet/tcp_usrreq.c
parent3ab868adf3b73fcb169a2f03c12e12d299f6f672 (diff)
socket buf speedup from thorpej@netbsd, okay art@ ericj@:
Make insertion of data into socket buffers O(C): * Keep pointers to the first and last mbufs of the last record in the socket buffer. * Use the sb_lastrecord pointer in the sbappend*() family of functions to avoid traversing the packet chain to find the last record. * Add a new sbappend_stream() function for stream protocols which guarantee that there will never be more than one record in the socket buffer. This function uses the sb_mbtail pointer to perform the data insertion. Make TCP use sbappend_stream(). On a profiling run, this makes sbappend of a TCP transmission using a 1M socket buffer go from 50% of the time to .02% of the time. Thanks to Bill Sommerfeld and YAMAMOTO Takashi for their debugging assistance!
Diffstat (limited to 'sys/netinet/tcp_usrreq.c')
-rw-r--r--sys/netinet/tcp_usrreq.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c
index 48704cb5a35..c18409f60bf 100644
--- a/sys/netinet/tcp_usrreq.c
+++ b/sys/netinet/tcp_usrreq.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tcp_usrreq.c,v 1.63 2002/06/09 16:26:11 itojun Exp $ */
+/* $OpenBSD: tcp_usrreq.c,v 1.64 2002/08/08 17:07:32 provos Exp $ */
/* $NetBSD: tcp_usrreq.c,v 1.20 1996/02/13 23:44:16 christos Exp $ */
/*
@@ -409,7 +409,7 @@ tcp_usrreq(so, req, m, nam, control)
* marker if URG set. Possibly send more data.
*/
case PRU_SEND:
- sbappend(&so->so_snd, m);
+ sbappendstream(&so->so_snd, m);
error = tcp_output(tp);
break;
@@ -457,7 +457,7 @@ tcp_usrreq(so, req, m, nam, control)
* of data past the urgent section.
* Otherwise, snd_up should be one lower.
*/
- sbappend(&so->so_snd, m);
+ sbappendstream(&so->so_snd, m);
tp->snd_up = tp->snd_una + so->so_snd.sb_cc;
tp->t_force = 1;
error = tcp_output(tp);