diff options
author | andre <andre@FreeBSD.org> | 2006-06-17 17:32:38 +0000 |
---|---|---|
committer | andre <andre@FreeBSD.org> | 2006-06-17 17:32:38 +0000 |
commit | ac46e67460f602e046baf28a353657a3b70ad920 (patch) | |
tree | d8dc2a06eaa5537313b0f67ab450da574dbb930b /sys/netinet/tcp_input.c | |
parent | ec1f5f0be1b7084ae9ae008429d0b18d5a95d929 (diff) | |
download | FreeBSD-src-ac46e67460f602e046baf28a353657a3b70ad920.zip FreeBSD-src-ac46e67460f602e046baf28a353657a3b70ad920.tar.gz |
Add locking to TCP syncache and drop the global tcpinfo lock as early
as possible for the syncache_add() case. The syncache timer no longer
aquires the tcpinfo lock and timeout/retransmit runs can happen in
parallel with bucket granularity.
On a P4 the additional locks cause a slight degression of 0.7% in tcp
connections per second. When IP and TCP input are deserialized and
can run in parallel this little overhead can be neglected. The syncookie
handling still leaves room for improvement and its random salts may be
moved to the syncache bucket head structures to remove the second lock
operation currently required for it. However this would be a more
involved change from the way syncookies work at the moment.
Reviewed by: rwatson
Tested by: rwatson, ps (earlier version)
Sponsored by: TCP/IP Optimization Fundraise 2005
Diffstat (limited to 'sys/netinet/tcp_input.c')
-rw-r--r-- | sys/netinet/tcp_input.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index 90957ce..70b524c 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -973,18 +973,18 @@ findpcb: (void *)tcp_saveipgen, &tcp_savetcp, 0); #endif tcp_dooptions(&to, optp, optlen, 1); - if (!syncache_add(&inc, &to, th, &so, m)) - goto drop; + if (!syncache_add(&inc, &to, th, inp, &so, m)) + goto drop; /* XXX: does not happen */ if (so == NULL) { /* * Entry added to syncache, mbuf used to - * send SYN,ACK packet. + * send SYN,ACK packet. Everything unlocked + * already. */ - KASSERT(headlocked, ("headlocked")); - INP_UNLOCK(inp); - INP_INFO_WUNLOCK(&tcbinfo); return; } + panic("T/TCP not supported at the moment"); +#if 0 /* T/TCP */ /* * Segment passed TAO tests. * XXX: Can't happen at the moment. @@ -1011,6 +1011,7 @@ findpcb: tcpstat.tcps_connects++; soisconnected(so); goto trimthenstep6; +#endif /* T/TCP */ } goto drop; } @@ -1437,7 +1438,9 @@ after_listen: tp->t_state = TCPS_SYN_RECEIVED; } +#if 0 /* T/TCP */ trimthenstep6: +#endif KASSERT(headlocked, ("tcp_input: trimthenstep6: head not " "locked")); INP_LOCK_ASSERT(inp); |