diff --git a/sys/net/bpf.c b/sys/net/bpf.c index 1381b06a634d..1678d1198068 100644 --- a/sys/net/bpf.c +++ b/sys/net/bpf.c @@ -356,7 +356,7 @@ bpfopen(dev, flags, fmt, td) mac_create_bpfdesc(td->td_ucred, d); #endif mtx_init(&d->bd_mtx, devtoname(dev), "bpf cdev lock", MTX_DEF); - callout_init(&d->bd_callout, debug_mpsafenet ? CALLOUT_MPSAFE : 0); + callout_init(&d->bd_callout, NET_CALLOUT_MPSAFE); knlist_init(&d->bd_sel.si_note, &d->bd_mtx); return (0); diff --git a/sys/net/bridge.c b/sys/net/bridge.c index 63dfb36a31ce..2461088de763 100644 --- a/sys/net/bridge.c +++ b/sys/net/bridge.c @@ -1220,7 +1220,7 @@ bdginit(void) bdgtakeifaces_ptr(); /* XXX does this do anything? */ - callout_init(&bdg_callout, debug_mpsafenet ? CALLOUT_MPSAFE : 0); + callout_init(&bdg_callout, NET_CALLOUT_MPSAFE); bdg_timeout(0); return 0 ; } diff --git a/sys/netinet/ip_dummynet.c b/sys/netinet/ip_dummynet.c index fea5981d5591..3adbc69ee122 100644 --- a/sys/netinet/ip_dummynet.c +++ b/sys/netinet/ip_dummynet.c @@ -2034,7 +2034,7 @@ ip_dn_init(void) ip_dn_io_ptr = dummynet_io; ip_dn_ruledel_ptr = dn_rule_delete; - callout_init(&dn_timeout, debug_mpsafenet ? CALLOUT_MPSAFE : 0); + callout_init(&dn_timeout, NET_CALLOUT_MPSAFE); callout_reset(&dn_timeout, 1, dummynet, NULL); } diff --git a/sys/netinet/ip_fw2.c b/sys/netinet/ip_fw2.c index 9752fa659b1e..a72a63049ffc 100644 --- a/sys/netinet/ip_fw2.c +++ b/sys/netinet/ip_fw2.c @@ -3534,7 +3534,7 @@ ipfw_init(void) sizeof(ipfw_dyn_rule), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0); IPFW_DYN_LOCK_INIT(); - callout_init(&ipfw_timeout, debug_mpsafenet ? CALLOUT_MPSAFE : 0); + callout_init(&ipfw_timeout, NET_CALLOUT_MPSAFE); bzero(&default_rule, sizeof default_rule); diff --git a/sys/netinet/ip_mroute.c b/sys/netinet/ip_mroute.c index 0df480754bad..00c0a6c19b85 100644 --- a/sys/netinet/ip_mroute.c +++ b/sys/netinet/ip_mroute.c @@ -598,23 +598,20 @@ get_vif_cnt(struct sioc_vif_req *req) static void ip_mrouter_reset(void) { - int callout_flag; - bzero((caddr_t)mfctable, sizeof(mfctable)); bzero((caddr_t)nexpire, sizeof(nexpire)); pim_assert = 0; mrt_api_config = 0; - callout_flag = debug_mpsafenet ? CALLOUT_MPSAFE : 0; - callout_init(&expire_upcalls_ch, callout_flag); + callout_init(&expire_upcalls_ch, NET_CALLOUT_MPSAFE); bw_upcalls_n = 0; bzero((caddr_t)bw_meter_timers, sizeof(bw_meter_timers)); - callout_init(&bw_upcalls_ch, callout_flag); - callout_init(&bw_meter_ch, callout_flag); + callout_init(&bw_upcalls_ch, NET_CALLOUT_MPSAFE); + callout_init(&bw_meter_ch, NET_CALLOUT_MPSAFE); - callout_init(&tbf_reprocess_ch, callout_flag); + callout_init(&tbf_reprocess_ch, NET_CALLOUT_MPSAFE); } static struct mtx mrouter_mtx; /* used to synch init/done work */ diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index fa4489b575c6..ed5eab35ad27 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -582,7 +582,6 @@ 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) @@ -596,12 +595,11 @@ tcp_newtcpcb(inp) tcp_mssdflt; /* Set up our timeouts. */ - 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); + callout_init(tp->tt_rexmt = &tm->tcpcb_mem_rexmt, NET_CALLOUT_MPSAFE); + callout_init(tp->tt_persist = &tm->tcpcb_mem_persist, NET_CALLOUT_MPSAFE); + callout_init(tp->tt_keep = &tm->tcpcb_mem_keep, NET_CALLOUT_MPSAFE); + callout_init(tp->tt_2msl = &tm->tcpcb_mem_2msl, NET_CALLOUT_MPSAFE); + callout_init(tp->tt_delack = &tm->tcpcb_mem_delack, NET_CALLOUT_MPSAFE); if (tcp_do_rfc1323) tp->t_flags = (TF_REQ_SCALE|TF_REQ_TSTMP); diff --git a/sys/netinet/tcp_syncache.c b/sys/netinet/tcp_syncache.c index 8a95a4fe61cb..b95efb66c20a 100644 --- a/sys/netinet/tcp_syncache.c +++ b/sys/netinet/tcp_syncache.c @@ -245,8 +245,7 @@ syncache_init(void) /* Initialize the timer queues. */ for (i = 0; i <= SYNCACHE_MAXREXMTS; i++) { TAILQ_INIT(&tcp_syncache.timerq[i]); - callout_init(&tcp_syncache.tt_timerq[i], - debug_mpsafenet ? CALLOUT_MPSAFE : 0); + callout_init(&tcp_syncache.tt_timerq[i], NET_CALLOUT_MPSAFE); } /* diff --git a/sys/netinet/tcp_timewait.c b/sys/netinet/tcp_timewait.c index fa4489b575c6..ed5eab35ad27 100644 --- a/sys/netinet/tcp_timewait.c +++ b/sys/netinet/tcp_timewait.c @@ -582,7 +582,6 @@ 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) @@ -596,12 +595,11 @@ tcp_newtcpcb(inp) tcp_mssdflt; /* Set up our timeouts. */ - 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); + callout_init(tp->tt_rexmt = &tm->tcpcb_mem_rexmt, NET_CALLOUT_MPSAFE); + callout_init(tp->tt_persist = &tm->tcpcb_mem_persist, NET_CALLOUT_MPSAFE); + callout_init(tp->tt_keep = &tm->tcpcb_mem_keep, NET_CALLOUT_MPSAFE); + callout_init(tp->tt_2msl = &tm->tcpcb_mem_2msl, NET_CALLOUT_MPSAFE); + callout_init(tp->tt_delack = &tm->tcpcb_mem_delack, NET_CALLOUT_MPSAFE); if (tcp_do_rfc1323) tp->t_flags = (TF_REQ_SCALE|TF_REQ_TSTMP);