De-spl tcp_slowtimo; tcp_maxidle assignment is subject to possible

but unlikely races that could be corrected by having tcp_keepcnt
and tcp_keepintvl modifications go through handler functions via
sysctl, but probably is not worth doing.  Updates to multiple
sysctls within evaluation of a single addition are unlikely.

Annotate that tcp_canceltimers() is currently unused.

De-spl tcp_timer_delack().

De-spl tcp_timer_2msl().

MFC after:	2 weeks
This commit is contained in:
Robert Watson 2004-11-23 16:45:07 +00:00
parent 25a252899e
commit b42ff86e73
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=138024

View File

@ -130,11 +130,15 @@ int tcp_maxidle;
void
tcp_slowtimo()
{
int s;
s = splnet();
/*
* XXXRW: Note that there is a minor race issue associated with rapid
* modification of the two components of tcp_maxidle. This could be
* corrected by introducing sysctl handlers for those two fields,
* sliding this update of tcp_maxidle under the tcbinfo lock, and
* acquiring that lock in the handlers.
*/
tcp_maxidle = tcp_keepcnt * tcp_keepintvl;
splx(s);
INP_INFO_WLOCK(&tcbinfo);
(void) tcp_timer_2msl_tw(0);
INP_INFO_WUNLOCK(&tcbinfo);
@ -142,6 +146,8 @@ tcp_slowtimo()
/*
* Cancel all timers for TCP tp.
*
* XXXRW: This appears to be unused.
*/
void
tcp_canceltimers(tp)
@ -170,22 +176,18 @@ tcp_timer_delack(xtp)
void *xtp;
{
struct tcpcb *tp = xtp;
int s;
struct inpcb *inp;
s = splnet();
INP_INFO_RLOCK(&tcbinfo);
inp = tp->t_inpcb;
if (!inp) {
if (inp == NULL) {
INP_INFO_RUNLOCK(&tcbinfo);
splx(s);
return;
}
INP_LOCK(inp);
INP_INFO_RUNLOCK(&tcbinfo);
if (callout_pending(tp->tt_delack) || !callout_active(tp->tt_delack)) {
INP_UNLOCK(inp);
splx(s);
return;
}
callout_deactivate(tp->tt_delack);
@ -194,7 +196,6 @@ tcp_timer_delack(xtp)
tcpstat.tcps_delack++;
(void) tcp_output(tp);
INP_UNLOCK(inp);
splx(s);
}
void
@ -202,19 +203,16 @@ tcp_timer_2msl(xtp)
void *xtp;
{
struct tcpcb *tp = xtp;
int s;
struct inpcb *inp;
#ifdef TCPDEBUG
int ostate;
ostate = tp->t_state;
#endif
s = splnet();
INP_INFO_WLOCK(&tcbinfo);
inp = tp->t_inpcb;
if (!inp) {
if (inp == NULL) {
INP_INFO_WUNLOCK(&tcbinfo);
splx(s);
return;
}
INP_LOCK(inp);
@ -222,7 +220,6 @@ tcp_timer_2msl(xtp)
if (callout_pending(tp->tt_2msl) || !callout_active(tp->tt_2msl)) {
INP_UNLOCK(tp->t_inpcb);
INP_INFO_WUNLOCK(&tcbinfo);
splx(s);
return;
}
callout_deactivate(tp->tt_2msl);
@ -247,7 +244,6 @@ tcp_timer_2msl(xtp)
if (tp)
INP_UNLOCK(inp);
INP_INFO_WUNLOCK(&tcbinfo);
splx(s);
}
struct twlist {