Mark all msgs used by polling(4) as MPSAFE ones
authorSepherosa Ziehau <sephe@dragonflybsd.org>
Wed, 24 Sep 2008 12:07:19 +0000 (12:07 +0000)
committerSepherosa Ziehau <sephe@dragonflybsd.org>
Wed, 24 Sep 2008 12:07:19 +0000 (12:07 +0000)
sys/kern/kern_poll.c

index eb6316a..c4c1005 100644 (file)
@@ -25,7 +25,7 @@
  * SUCH DAMAGE.
  *
  * $FreeBSD: src/sys/kern/kern_poll.c,v 1.2.2.4 2002/06/27 23:26:33 luigi Exp $
- * $DragonFly: src/sys/kern/kern_poll.c,v 1.47 2008/09/23 14:14:20 sephe Exp $
+ * $DragonFly: src/sys/kern/kern_poll.c,v 1.48 2008/09/24 12:07:19 sephe Exp $
  */
 
 #include "opt_polling.h"
@@ -257,13 +257,13 @@ init_device_poll_pcpu(int cpuid)
        pctx->poll_cpuid = cpuid;
        poll_reset_state(pctx);
 
-       netmsg_init(&pctx->poll_netmsg, &netisr_adone_rport, 0,
+       netmsg_init(&pctx->poll_netmsg, &netisr_adone_rport, MSGF_MPSAFE,
                    netisr_poll);
 #ifdef INVARIANTS
        pctx->poll_netmsg.nm_lmsg.u.ms_resultp = pctx;
 #endif
 
-       netmsg_init(&pctx->poll_more_netmsg, &netisr_adone_rport, 0,
+       netmsg_init(&pctx->poll_more_netmsg, &netisr_adone_rport, MSGF_MPSAFE,
                    netisr_pollmore);
 #ifdef INVARIANTS
        pctx->poll_more_netmsg.nm_lmsg.u.ms_resultp = pctx;
@@ -341,7 +341,8 @@ sysctl_pollhz(SYSCTL_HANDLER_ARGS)
        else if (phz > DEVICE_POLLING_FREQ_MAX)
                phz = DEVICE_POLLING_FREQ_MAX;
 
-       netmsg_init(&msg, &curthread->td_msgport, 0, poll_sysctl_pollhz);
+       netmsg_init(&msg, &curthread->td_msgport, MSGF_MPSAFE,
+                   poll_sysctl_pollhz);
        msg.nm_lmsg.u.ms_result = phz;
 
        port = cpu_portfn(pctx->poll_cpuid);
@@ -365,7 +366,8 @@ sysctl_polling(SYSCTL_HANDLER_ARGS)
        if (error || req->newptr == NULL)
                return error;
 
-       netmsg_init(&msg, &curthread->td_msgport, 0, poll_sysctl_polling);
+       netmsg_init(&msg, &curthread->td_msgport, MSGF_MPSAFE,
+                   poll_sysctl_polling);
        msg.nm_lmsg.u.ms_result = enabled;
 
        port = cpu_portfn(pctx->poll_cpuid);
@@ -387,7 +389,8 @@ sysctl_regfrac(SYSCTL_HANDLER_ARGS)
        if (error || req->newptr == NULL)
                return error;
 
-       netmsg_init(&msg, &curthread->td_msgport, 0, poll_sysctl_regfrac);
+       netmsg_init(&msg, &curthread->td_msgport, MSGF_MPSAFE,
+                   poll_sysctl_regfrac);
        msg.nm_lmsg.u.ms_result = reg_frac;
 
        port = cpu_portfn(pctx->poll_cpuid);
@@ -413,7 +416,8 @@ sysctl_burstmax(SYSCTL_HANDLER_ARGS)
        else if (burst_max > MAX_POLL_BURST_MAX)
                burst_max = MAX_POLL_BURST_MAX;
 
-       netmsg_init(&msg, &curthread->td_msgport, 0, poll_sysctl_burstmax);
+       netmsg_init(&msg, &curthread->td_msgport, MSGF_MPSAFE,
+                   poll_sysctl_burstmax);
        msg.nm_lmsg.u.ms_result = burst_max;
 
        port = cpu_portfn(pctx->poll_cpuid);
@@ -435,7 +439,8 @@ sysctl_eachburst(SYSCTL_HANDLER_ARGS)
        if (error || req->newptr == NULL)
                return error;
 
-       netmsg_init(&msg, &curthread->td_msgport, 0, poll_sysctl_eachburst);
+       netmsg_init(&msg, &curthread->td_msgport, MSGF_MPSAFE,
+                   poll_sysctl_eachburst);
        msg.nm_lmsg.u.ms_result = each_burst;
 
        port = cpu_portfn(pctx->poll_cpuid);
@@ -761,7 +766,7 @@ ether_pollcpu_register(struct ifnet *ifp, int cpuid)
                ifp->if_poll(ifp, POLL_REGISTER, 0);
        lwkt_serialize_exit(ifp->if_serializer);
 
-       netmsg_init(&msg, &curthread->td_msgport, 0, poll_register);
+       netmsg_init(&msg, &curthread->td_msgport, MSGF_MPSAFE, poll_register);
        msg.nm_lmsg.u.ms_resultp = ifp;
 
        port = cpu_portfn(cpuid);
@@ -854,7 +859,7 @@ ether_poll_deregister(struct ifnet *ifp)
        ifp->if_poll_cpuid = -1;
        lwkt_serialize_exit(ifp->if_serializer);
 
-       netmsg_init(&msg, &curthread->td_msgport, 0, poll_deregister);
+       netmsg_init(&msg, &curthread->td_msgport, MSGF_MPSAFE, poll_deregister);
        msg.nm_lmsg.u.ms_resultp = ifp;
 
        port = cpu_portfn(cpuid);