diff options
author | rwatson <rwatson@FreeBSD.org> | 2004-06-20 21:44:50 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2004-06-20 21:44:50 +0000 |
commit | 8a0f58ccf06632bb6df85e702dc815203c70ed14 (patch) | |
tree | 09e8321c815240cc804b18aa41751aa67927a260 | |
parent | ffabeb722910b0f8175a5d9e4005595590359ddc (diff) | |
download | FreeBSD-src-8a0f58ccf06632bb6df85e702dc815203c70ed14.zip FreeBSD-src-8a0f58ccf06632bb6df85e702dc815203c70ed14.tar.gz |
If debug.mpsafenet is set, initialize TCP callouts as CALLOUT_MPSAFE.
-rw-r--r-- | sys/netinet/tcp_subr.c | 17 | ||||
-rw-r--r-- | sys/netinet/tcp_timewait.c | 17 |
2 files changed, 24 insertions, 10 deletions
diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index 3b478d6..b5cfd43 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -576,6 +576,7 @@ tcp_newtcpcb(inp) #ifdef INET6 int isipv6 = (inp->inp_vflag & INP_IPV6) != 0; #endif /* INET6 */ + int callout_flag; tm = uma_zalloc(tcpcb_zone, M_NOWAIT | M_ZERO); if (tm == NULL) @@ -589,11 +590,17 @@ tcp_newtcpcb(inp) tcp_mssdflt; /* Set up our timeouts. */ - callout_init(tp->tt_rexmt = &tm->tcpcb_mem_rexmt, 0); - callout_init(tp->tt_persist = &tm->tcpcb_mem_persist, 0); - callout_init(tp->tt_keep = &tm->tcpcb_mem_keep, 0); - callout_init(tp->tt_2msl = &tm->tcpcb_mem_2msl, 0); - callout_init(tp->tt_delack = &tm->tcpcb_mem_delack, 0); + /* + * XXXRW: Are these actually MPSAFE? I think so, but need to + * review the timed wait code, as it has some list variables, + * etc, that are global. + */ + callout_flag = debug_mpsafenet ? CALLOUT_MPSAFE : 0; + callout_init(tp->tt_rexmt = &tm->tcpcb_mem_rexmt, callout_flag); + callout_init(tp->tt_persist = &tm->tcpcb_mem_persist, callout_flag); + callout_init(tp->tt_keep = &tm->tcpcb_mem_keep, callout_flag); + callout_init(tp->tt_2msl = &tm->tcpcb_mem_2msl, callout_flag); + callout_init(tp->tt_delack = &tm->tcpcb_mem_delack, callout_flag); if (tcp_do_rfc1323) tp->t_flags = (TF_REQ_SCALE|TF_REQ_TSTMP); diff --git a/sys/netinet/tcp_timewait.c b/sys/netinet/tcp_timewait.c index 3b478d6..b5cfd43 100644 --- a/sys/netinet/tcp_timewait.c +++ b/sys/netinet/tcp_timewait.c @@ -576,6 +576,7 @@ tcp_newtcpcb(inp) #ifdef INET6 int isipv6 = (inp->inp_vflag & INP_IPV6) != 0; #endif /* INET6 */ + int callout_flag; tm = uma_zalloc(tcpcb_zone, M_NOWAIT | M_ZERO); if (tm == NULL) @@ -589,11 +590,17 @@ tcp_newtcpcb(inp) tcp_mssdflt; /* Set up our timeouts. */ - callout_init(tp->tt_rexmt = &tm->tcpcb_mem_rexmt, 0); - callout_init(tp->tt_persist = &tm->tcpcb_mem_persist, 0); - callout_init(tp->tt_keep = &tm->tcpcb_mem_keep, 0); - callout_init(tp->tt_2msl = &tm->tcpcb_mem_2msl, 0); - callout_init(tp->tt_delack = &tm->tcpcb_mem_delack, 0); + /* + * XXXRW: Are these actually MPSAFE? I think so, but need to + * review the timed wait code, as it has some list variables, + * etc, that are global. + */ + callout_flag = debug_mpsafenet ? CALLOUT_MPSAFE : 0; + callout_init(tp->tt_rexmt = &tm->tcpcb_mem_rexmt, callout_flag); + callout_init(tp->tt_persist = &tm->tcpcb_mem_persist, callout_flag); + callout_init(tp->tt_keep = &tm->tcpcb_mem_keep, callout_flag); + callout_init(tp->tt_2msl = &tm->tcpcb_mem_2msl, callout_flag); + callout_init(tp->tt_delack = &tm->tcpcb_mem_delack, callout_flag); if (tcp_do_rfc1323) tp->t_flags = (TF_REQ_SCALE|TF_REQ_TSTMP); |