netisr: Function renaming; no functional changes
authorSepherosa Ziehau <sephe@dragonflybsd.org>
Sun, 28 Apr 2013 08:12:58 +0000 (16:12 +0800)
committerSepherosa Ziehau <sephe@dragonflybsd.org>
Sun, 28 Apr 2013 08:17:22 +0000 (16:17 +0800)
This cleans up code for keeping input packets' hash instead of masking
the hash with ncpus2_mask.  netisr_hashport(), which maps packet hash
to netisr port, will be added soon.

33 files changed:
sys/dev/acpica/acpi_cpu_pstate.c
sys/kern/uipc_socket.c
sys/kern/uipc_socket2.c
sys/net/bpf.c
sys/net/bridge/if_bridge.c
sys/net/bridge/if_bridgevar.h
sys/net/dummynet/ip_dummynet.c
sys/net/dummynet/ip_dummynet_glue.c
sys/net/if.c
sys/net/if_ethersubr.c
sys/net/if_poll.c
sys/net/ipfw/ip_fw2.h
sys/net/netisr.c
sys/net/netisr.h
sys/net/pf/pf.c
sys/net/pfil.c
sys/net/rtsock.c
sys/net/vlan/if_vlan.c
sys/netinet/if_ether.c
sys/netinet/in.c
sys/netinet/ip_carp.c
sys/netinet/ip_demux.c
sys/netinet/ip_divert.c
sys/netinet/ip_flow.c
sys/netinet/ip_input.c
sys/netinet/tcp_output.c
sys/netinet/tcp_subr.c
sys/netinet/tcp_syncache.c
sys/netinet/tcp_usrreq.c
sys/netinet/udp_usrreq.c
sys/netinet6/ip6_input.c
sys/netinet6/udp6_usrreq.c
tools/tools/netrate/pktgen/pktgen.c

index aa0e588..ab0bec4 100644 (file)
@@ -1045,7 +1045,7 @@ acpi_pst_check_csr(struct acpi_pst_softc *sc)
        msg.ctrl = &sc->pst_creg;
        msg.status = &sc->pst_sreg;
 
-       return lwkt_domsg(netisr_portfn(sc->pst_cpuid), &msg.base.lmsg, 0);
+       return lwkt_domsg(netisr_cpuport(sc->pst_cpuid), &msg.base.lmsg, 0);
 }
 
 static void
@@ -1068,7 +1068,7 @@ acpi_pst_check_pstates(struct acpi_pst_softc *sc)
        netmsg_init(&msg, NULL, &curthread->td_msgport,
                    MSGF_PRIORITY, acpi_pst_check_pstates_handler);
 
-       return lwkt_domsg(netisr_portfn(sc->pst_cpuid), &msg.lmsg, 0);
+       return lwkt_domsg(netisr_cpuport(sc->pst_cpuid), &msg.lmsg, 0);
 }
 
 static void
@@ -1094,7 +1094,7 @@ acpi_pst_init(struct acpi_pst_softc *sc)
        msg.ctrl = &sc->pst_creg;
        msg.status = &sc->pst_sreg;
 
-       return lwkt_domsg(netisr_portfn(sc->pst_cpuid), &msg.base.lmsg, 0);
+       return lwkt_domsg(netisr_cpuport(sc->pst_cpuid), &msg.base.lmsg, 0);
 }
 
 static void
@@ -1121,7 +1121,7 @@ acpi_pst_set_pstate(struct acpi_pst_softc *sc, const struct acpi_pstate *pstate)
        msg.ctrl = &sc->pst_creg;
        msg.status = &sc->pst_sreg;
 
-       return lwkt_domsg(netisr_portfn(sc->pst_cpuid), &msg.base.lmsg, 0);
+       return lwkt_domsg(netisr_cpuport(sc->pst_cpuid), &msg.base.lmsg, 0);
 }
 
 static void
@@ -1148,7 +1148,7 @@ acpi_pst_get_pstate(struct acpi_pst_softc *sc)
                    MSGF_PRIORITY, acpi_pst_get_pstate_handler);
        msg.status = &sc->pst_sreg;
 
-       lwkt_domsg(netisr_portfn(sc->pst_cpuid), &msg.base.lmsg, 0);
+       lwkt_domsg(netisr_cpuport(sc->pst_cpuid), &msg.base.lmsg, 0);
        return msg.base.lmsg.u.ms_resultp;
 }
 
index 354fd6d..62a52be 100644 (file)
@@ -240,7 +240,7 @@ socreate(int dom, struct socket **aso, int type,
        if (prp->pr_flags & PR_SYNC_PORT)
                so->so_port = &netisr_sync_port;
        else
-               so->so_port = netisr_portfn(0);
+               so->so_port = netisr_cpuport(0);
 
        TAILQ_INIT(&so->so_incomp);
        TAILQ_INIT(&so->so_comp);
index 7982538..9b292db 100644 (file)
@@ -350,7 +350,7 @@ sonewconn_faddr(struct socket *head, int connstatus,
        if (head->so_proto->pr_flags & PR_SYNC_PORT)
                sosetport(so, &netisr_sync_port);
        else
-               sosetport(so, netisr_portfn(mycpu->gd_cpuid));
+               sosetport(so, netisr_cpuport(mycpuid));
        if ((head->so_options & SO_ACCEPTFILTER) != 0)
                connstatus = 0;
        so->so_head = head;
index a75f421..d0d47de 100644 (file)
@@ -608,7 +608,7 @@ bpfwrite(struct dev_write_args *ap)
        bmsg.nm_ifp = ifp;
        bmsg.nm_dst = &dst;
 
-       ret = lwkt_domsg(netisr_portfn(0), &bmsg.base.lmsg, 0);
+       ret = lwkt_domsg(netisr_cpuport(0), &bmsg.base.lmsg, 0);
        lwkt_reltoken(&bpf_token);
 
        return ret;
index 2a7f66c..0e1e793 100644 (file)
@@ -1930,7 +1930,7 @@ bridge_enqueue(struct ifnet *dst_ifp, struct mbuf *m)
        nmp->nm_packet = m;
        nmp->base.lmsg.u.ms_resultp = dst_ifp;
 
-       lwkt_sendmsg(netisr_portfn(mycpu->gd_cpuid), &nmp->base.lmsg);
+       lwkt_sendmsg(netisr_cpuport(mycpuid), &nmp->base.lmsg);
 }
 
 /*
index 0beb9ed..8b3e90f 100644 (file)
@@ -379,7 +379,7 @@ struct bridge_softc {
 #define sc_if                   sc_arp.ac_if
 
 #define BRIDGE_CFGCPU          0
-#define BRIDGE_CFGPORT         netisr_portfn(BRIDGE_CFGCPU)
+#define BRIDGE_CFGPORT         netisr_cpuport(BRIDGE_CFGCPU)
 
 extern const uint8_t bstp_etheraddr[];
 
index a72efd2..5a0b8a6 100644 (file)
@@ -1876,7 +1876,7 @@ dummynet_clock(systimer_t info __unused, int in_ipi __unused,
 
     crit_enter();
     if (DUMMYNET_LOADED && (dn_netmsg.lmsg.ms_flags & MSGF_DONE))
-       lwkt_sendmsg(netisr_portfn(mycpuid), &dn_netmsg.lmsg);
+       lwkt_sendmsg(netisr_cpuport(mycpuid), &dn_netmsg.lmsg);
     crit_exit();
 }
 
@@ -1961,7 +1961,7 @@ ip_dn_init(void)
 
     netmsg_init(&smsg, NULL, &curthread->td_msgport,
                0, ip_dn_init_dispatch);
-    lwkt_domsg(netisr_portfn(ip_dn_cpu), &smsg.lmsg, 0);
+    lwkt_domsg(netisr_cpuport(ip_dn_cpu), &smsg.lmsg, 0);
     return smsg.lmsg.ms_error;
 }
 
@@ -1991,7 +1991,7 @@ ip_dn_stop(void)
 
     netmsg_init(&smsg, NULL, &curthread->td_msgport,
                0, ip_dn_stop_dispatch);
-    lwkt_domsg(netisr_portfn(ip_dn_cpu), &smsg.lmsg, 0);
+    lwkt_domsg(netisr_cpuport(ip_dn_cpu), &smsg.lmsg, 0);
 
     netmsg_service_sync();
 }
index fd91e00..fa80131 100644 (file)
@@ -92,7 +92,7 @@ ip_dn_queue(struct mbuf *m)
                    0, ip_dn_dispatch);
        nmp->nm_packet = m;
 
-       port = netisr_portfn(ip_dn_cpu);
+       port = netisr_cpuport(ip_dn_cpu);
        lwkt_sendmsg(port, &nmp->base.lmsg);
 }
 
@@ -469,7 +469,7 @@ ip_dn_sockopt_flush(struct sockopt *sopt)
        netmsg_init(&smsg, NULL, &curthread->td_msgport,
                    0, ip_dn_sockopt_dispatch);
        smsg.lmsg.u.ms_resultp = &dn_sopt;
-       lwkt_domsg(netisr_portfn(ip_dn_cpu), &smsg.lmsg, 0);
+       lwkt_domsg(netisr_cpuport(ip_dn_cpu), &smsg.lmsg, 0);
 
        return smsg.lmsg.ms_error;
 }
@@ -487,7 +487,7 @@ ip_dn_sockopt_get(struct sockopt *sopt)
        netmsg_init(&smsg, NULL, &curthread->td_msgport,
                    0, ip_dn_sockopt_dispatch);
        smsg.lmsg.u.ms_resultp = &dn_sopt;
-       lwkt_domsg(netisr_portfn(ip_dn_cpu), &smsg.lmsg, 0);
+       lwkt_domsg(netisr_cpuport(ip_dn_cpu), &smsg.lmsg, 0);
 
        error = smsg.lmsg.ms_error;
        if (error) {
@@ -522,7 +522,7 @@ ip_dn_sockopt_config(struct sockopt *sopt)
        netmsg_init(&smsg, NULL, &curthread->td_msgport,
                    0, ip_dn_sockopt_dispatch);
        smsg.lmsg.u.ms_resultp = &dn_sopt;
-       lwkt_domsg(netisr_portfn(ip_dn_cpu), &smsg.lmsg, 0);
+       lwkt_domsg(netisr_cpuport(ip_dn_cpu), &smsg.lmsg, 0);
 
        return smsg.lmsg.ms_error;
 }
index 61ef50a..504184f 100644 (file)
@@ -230,7 +230,7 @@ ifsq_ifstart_ipifunc(void *arg)
 
        crit_enter();
        if (lmsg->ms_flags & MSGF_DONE)
-               lwkt_sendmsg(netisr_portfn(mycpuid), lmsg);
+               lwkt_sendmsg(netisr_cpuport(mycpuid), lmsg);
        crit_exit();
 }
 
@@ -754,7 +754,7 @@ ifq_stage_detach(struct ifaltq *ifq)
        base.lmsg.u.ms_resultp = ifq;
 
        for (cpu = 0; cpu < ncpus; ++cpu)
-               lwkt_domsg(netisr_portfn(cpu), &base.lmsg, 0);
+               lwkt_domsg(netisr_cpuport(cpu), &base.lmsg, 0);
 }
 
 /*
index fda9871..072a395 100644 (file)
@@ -1183,7 +1183,8 @@ post_stats:
        }
 
        if (m->m_flags & M_HASH) {
-               if (&curthread->td_msgport == netisr_portfn(m->m_pkthdr.hash)) {
+               if (&curthread->td_msgport ==
+                   netisr_cpuport(m->m_pkthdr.hash)) {
                        netisr_handle(isr, m);
                        return;
                } else {
@@ -1434,7 +1435,7 @@ ether_dispatch(int isr, struct mbuf *m)
        pmsg->base.lmsg.u.ms_result = isr;
 
        logether(disp_beg, NULL);
-       lwkt_sendmsg(netisr_portfn(m->m_pkthdr.hash), &pmsg->base.lmsg);
+       lwkt_sendmsg(netisr_cpuport(m->m_pkthdr.hash), &pmsg->base.lmsg);
        logether(disp_end, NULL);
 }
 
@@ -1640,7 +1641,7 @@ ether_demux(struct mbuf *m)
        pmsg->nm_packet = m;
        pmsg->base.lmsg.u.ms_result = isr;
 
-       lwkt_sendmsg(netisr_portfn(m->m_pkthdr.hash), &pmsg->base.lmsg);
+       lwkt_sendmsg(netisr_cpuport(m->m_pkthdr.hash), &pmsg->base.lmsg);
 }
 
 boolean_t
index 1a8937b..f4e392a 100644 (file)
@@ -291,7 +291,7 @@ static __inline void
 ifpoll_sendmsg_oncpu(netmsg_t msg)
 {
        if (msg->lmsg.ms_flags & MSGF_DONE)
-               lwkt_sendmsg(netisr_portfn(mycpuid), &msg->lmsg);
+               lwkt_sendmsg(netisr_cpuport(mycpuid), &msg->lmsg);
 }
 
 static __inline void
@@ -389,7 +389,7 @@ ifpoll_register(struct ifnet *ifp)
                    0, ifpoll_register_handler);
        nmsg.lmsg.u.ms_resultp = info;
 
-       error = lwkt_domsg(netisr_portfn(0), &nmsg.lmsg, 0);
+       error = lwkt_domsg(netisr_cpuport(0), &nmsg.lmsg, 0);
        if (error) {
                if (!ifpoll_deregister(ifp)) {
                        if_printf(ifp, "ifpoll_register: "
@@ -424,7 +424,7 @@ ifpoll_deregister(struct ifnet *ifp)
                    0, ifpoll_deregister_handler);
        nmsg.lmsg.u.ms_resultp = ifp;
 
-       error = lwkt_domsg(netisr_portfn(0), &nmsg.lmsg, 0);
+       error = lwkt_domsg(netisr_cpuport(0), &nmsg.lmsg, 0);
        if (!error) {
                ifnet_serialize_all(ifp);
                ifp->if_npoll(ifp, NULL);
@@ -441,7 +441,7 @@ ifpoll_register_handler(netmsg_t nmsg)
        int error;
 
        KKASSERT(cpuid < ncpus2);
-       KKASSERT(&curthread->td_msgport == netisr_portfn(cpuid));
+       KKASSERT(&curthread->td_msgport == netisr_cpuport(cpuid));
 
        if (cpuid == 0) {
                error = stpoll_register(info->ifpi_ifp, &info->ifpi_status);
@@ -464,7 +464,7 @@ ifpoll_register_handler(netmsg_t nmsg)
 
        nextcpu = cpuid + 1;
        if (nextcpu < ncpus2)
-               lwkt_forwardmsg(netisr_portfn(nextcpu), &nmsg->lmsg);
+               lwkt_forwardmsg(netisr_cpuport(nextcpu), &nmsg->lmsg);
        else
                lwkt_replymsg(&nmsg->lmsg, 0);
        return;
@@ -479,7 +479,7 @@ ifpoll_deregister_handler(netmsg_t nmsg)
        int cpuid = mycpuid, nextcpu;
 
        KKASSERT(cpuid < ncpus2);
-       KKASSERT(&curthread->td_msgport == netisr_portfn(cpuid));
+       KKASSERT(&curthread->td_msgport == netisr_cpuport(cpuid));
 
        /* Ignore errors */
        if (cpuid == 0)
@@ -492,7 +492,7 @@ ifpoll_deregister_handler(netmsg_t nmsg)
 
        nextcpu = cpuid + 1;
        if (nextcpu < ncpus2)
-               lwkt_forwardmsg(netisr_portfn(nextcpu), &nmsg->lmsg);
+               lwkt_forwardmsg(netisr_cpuport(nextcpu), &nmsg->lmsg);
        else
                lwkt_replymsg(&nmsg->lmsg, 0);
 }
@@ -529,7 +529,7 @@ stpoll_handler(netmsg_t msg)
        struct thread *td = curthread;
        int i;
 
-       KKASSERT(&td->td_msgport == netisr_portfn(0));
+       KKASSERT(&td->td_msgport == netisr_cpuport(0));
 
        crit_enter_quick(td);
 
@@ -578,7 +578,7 @@ stpoll_register(struct ifnet *ifp, const struct ifpoll_status *st_rec)
        struct stpoll_ctx *st_ctx = &stpoll_context;
        int error;
 
-       KKASSERT(&curthread->td_msgport == netisr_portfn(0));
+       KKASSERT(&curthread->td_msgport == netisr_cpuport(0));
 
        if (st_rec->status_func == NULL)
                return 0;
@@ -621,7 +621,7 @@ stpoll_deregister(struct ifnet *ifp)
        struct stpoll_ctx *st_ctx = &stpoll_context;
        int i, error;
 
-       KKASSERT(&curthread->td_msgport == netisr_portfn(0));
+       KKASSERT(&curthread->td_msgport == netisr_cpuport(0));
 
        for (i = 0; i < st_ctx->poll_handlers; ++i) {
                if (st_ctx->pr[i].ifp == ifp) /* Found it */
@@ -806,7 +806,7 @@ rxpoll_handler(netmsg_t msg)
        int i, cycles;
 
        io_ctx = msg->lmsg.u.ms_resultp;
-       KKASSERT(&td->td_msgport == netisr_portfn(io_ctx->poll_cpuid));
+       KKASSERT(&td->td_msgport == netisr_cpuport(io_ctx->poll_cpuid));
 
        crit_enter_quick(td);
 
@@ -863,7 +863,7 @@ txpoll_handler(netmsg_t msg)
        int i;
 
        io_ctx = msg->lmsg.u.ms_resultp;
-       KKASSERT(&td->td_msgport == netisr_portfn(io_ctx->poll_cpuid));
+       KKASSERT(&td->td_msgport == netisr_cpuport(io_ctx->poll_cpuid));
 
        crit_enter_quick(td);
 
@@ -927,7 +927,7 @@ rxpollmore_handler(netmsg_t msg)
        uint32_t pending_polls;
 
        io_ctx = msg->lmsg.u.ms_resultp;
-       KKASSERT(&td->td_msgport == netisr_portfn(io_ctx->poll_cpuid));
+       KKASSERT(&td->td_msgport == netisr_cpuport(io_ctx->poll_cpuid));
 
        crit_enter_quick(td);
 
@@ -992,7 +992,7 @@ txpollmore_handler(netmsg_t msg)
        uint32_t pending_polls;
 
        io_ctx = msg->lmsg.u.ms_resultp;
-       KKASSERT(&td->td_msgport == netisr_portfn(io_ctx->poll_cpuid));
+       KKASSERT(&td->td_msgport == netisr_cpuport(io_ctx->poll_cpuid));
 
        crit_enter_quick(td);
 
@@ -1082,7 +1082,7 @@ sysctl_burstmax_handler(netmsg_t nmsg)
        struct iopoll_ctx *io_ctx;
 
        io_ctx = msg->ctx;
-       KKASSERT(&curthread->td_msgport == netisr_portfn(io_ctx->poll_cpuid));
+       KKASSERT(&curthread->td_msgport == netisr_cpuport(io_ctx->poll_cpuid));
 
        io_ctx->poll_burst_max = nmsg->lmsg.u.ms_result;
        if (io_ctx->poll_each_burst > io_ctx->poll_burst_max)
@@ -1117,7 +1117,8 @@ sysctl_burstmax(SYSCTL_HANDLER_ARGS)
        msg.base.lmsg.u.ms_result = burst_max;
        msg.ctx = io_ctx;
 
-       return lwkt_domsg(netisr_portfn(io_ctx->poll_cpuid), &msg.base.lmsg, 0);
+       return lwkt_domsg(netisr_cpuport(io_ctx->poll_cpuid),
+           &msg.base.lmsg, 0);
 }
 
 static void
@@ -1128,7 +1129,7 @@ sysctl_eachburst_handler(netmsg_t nmsg)
        uint32_t each_burst;
 
        io_ctx = msg->ctx;
-       KKASSERT(&curthread->td_msgport == netisr_portfn(io_ctx->poll_cpuid));
+       KKASSERT(&curthread->td_msgport == netisr_cpuport(io_ctx->poll_cpuid));
 
        each_burst = nmsg->lmsg.u.ms_result;
        if (each_burst > io_ctx->poll_burst_max)
@@ -1158,7 +1159,8 @@ sysctl_eachburst(SYSCTL_HANDLER_ARGS)
        msg.base.lmsg.u.ms_result = each_burst;
        msg.ctx = io_ctx;
 
-       return lwkt_domsg(netisr_portfn(io_ctx->poll_cpuid), &msg.base.lmsg, 0);
+       return lwkt_domsg(netisr_cpuport(io_ctx->poll_cpuid),
+           &msg.base.lmsg, 0);
 }
 
 static int
@@ -1167,7 +1169,7 @@ iopoll_register(struct ifnet *ifp, struct iopoll_ctx *io_ctx,
 {
        int error;
 
-       KKASSERT(&curthread->td_msgport == netisr_portfn(io_ctx->poll_cpuid));
+       KKASSERT(&curthread->td_msgport == netisr_cpuport(io_ctx->poll_cpuid));
 
        if (io_rec->poll_func == NULL)
                return 0;
@@ -1209,7 +1211,7 @@ iopoll_deregister(struct ifnet *ifp, struct iopoll_ctx *io_ctx)
 {
        int i, error;
 
-       KKASSERT(&curthread->td_msgport == netisr_portfn(io_ctx->poll_cpuid));
+       KKASSERT(&curthread->td_msgport == netisr_cpuport(io_ctx->poll_cpuid));
 
        for (i = 0; i < io_ctx->poll_handlers; ++i) {
                if (io_ctx->pr[i].ifp == ifp) /* Found it */
@@ -1343,7 +1345,7 @@ poll_comm_adjust_pollhz(struct poll_comm *comm)
        uint32_t handlers;
        int pollhz = 1;
 
-       KKASSERT(&curthread->td_msgport == netisr_portfn(comm->poll_cpuid));
+       KKASSERT(&curthread->td_msgport == netisr_cpuport(comm->poll_cpuid));
 
        /*
         * If there is no polling handler registered, set systimer
@@ -1380,7 +1382,7 @@ sysctl_pollhz(SYSCTL_HANDLER_ARGS)
                    0, sysctl_pollhz_handler);
        nmsg.lmsg.u.ms_result = phz;
 
-       return lwkt_domsg(netisr_portfn(comm->poll_cpuid), &nmsg.lmsg, 0);
+       return lwkt_domsg(netisr_cpuport(comm->poll_cpuid), &nmsg.lmsg, 0);
 }
 
 static void
@@ -1388,7 +1390,7 @@ sysctl_pollhz_handler(netmsg_t nmsg)
 {
        struct poll_comm *comm = poll_common[mycpuid];
 
-       KKASSERT(&curthread->td_msgport == netisr_portfn(comm->poll_cpuid));
+       KKASSERT(&curthread->td_msgport == netisr_cpuport(comm->poll_cpuid));
 
        /* Save polling frequency */
        comm->pollhz = poll_comm_pollhz_div(comm, nmsg->lmsg.u.ms_result);
@@ -1428,7 +1430,7 @@ sysctl_stfrac(SYSCTL_HANDLER_ARGS)
                    0, sysctl_stfrac_handler);
        nmsg.lmsg.u.ms_result = stfrac - 1;
 
-       return lwkt_domsg(netisr_portfn(comm->poll_cpuid), &nmsg.lmsg, 0);
+       return lwkt_domsg(netisr_cpuport(comm->poll_cpuid), &nmsg.lmsg, 0);
 }
 
 static void
@@ -1437,7 +1439,7 @@ sysctl_stfrac_handler(netmsg_t nmsg)
        struct poll_comm *comm = poll_common[mycpuid];
        int stfrac = nmsg->lmsg.u.ms_result;
 
-       KKASSERT(&curthread->td_msgport == netisr_portfn(comm->poll_cpuid));
+       KKASSERT(&curthread->td_msgport == netisr_cpuport(comm->poll_cpuid));
 
        crit_enter();
        comm->poll_stfrac = stfrac;
@@ -1466,7 +1468,7 @@ sysctl_txfrac(SYSCTL_HANDLER_ARGS)
                    0, sysctl_txfrac_handler);
        nmsg.lmsg.u.ms_result = txfrac - 1;
 
-       return lwkt_domsg(netisr_portfn(comm->poll_cpuid), &nmsg.lmsg, 0);
+       return lwkt_domsg(netisr_cpuport(comm->poll_cpuid), &nmsg.lmsg, 0);
 }
 
 static void
@@ -1475,7 +1477,7 @@ sysctl_txfrac_handler(netmsg_t nmsg)
        struct poll_comm *comm = poll_common[mycpuid];
        int txfrac = nmsg->lmsg.u.ms_result;
 
-       KKASSERT(&curthread->td_msgport == netisr_portfn(comm->poll_cpuid));
+       KKASSERT(&curthread->td_msgport == netisr_cpuport(comm->poll_cpuid));
 
        crit_enter();
        comm->poll_txfrac = txfrac;
index 1d9caf7..1ccd986 100644 (file)
@@ -413,7 +413,7 @@ extern int ip_fw_loaded;
 #define        IPFW_LOADED     (ip_fw_loaded)
 
 #define IPFW_CFGCPUID  0
-#define IPFW_CFGPORT   netisr_portfn(IPFW_CFGCPUID)
+#define IPFW_CFGPORT   netisr_cpuport(IPFW_CFGCPUID)
 #define IPFW_ASSERT_CFGPORT(msgport)   \
        KASSERT((msgport) == IPFW_CFGPORT, ("not IPFW CFGPORT"))
 
index cdf2701..06ebdcc 100644 (file)
@@ -370,7 +370,7 @@ netisr_queue(int num, struct mbuf *m)
         * Get the protocol port based on the packet hash, initialize
         * the netmsg, and send it off.
         */
-       port = netisr_portfn(m->m_pkthdr.hash);
+       port = netisr_cpuport(m->m_pkthdr.hash);
        pmsg = &m->m_hdr.mh_netmsg;
        netmsg_init(&pmsg->base, NULL, &netisr_apanic_rport,
                    0, ni->ni_handler);
@@ -397,7 +397,7 @@ netisr_handle(int num, struct mbuf *m)
         * Get the protocol port based on the packet hash
         */
        KASSERT((m->m_flags & M_HASH), ("packet not characterized"));
-       port = netisr_portfn(m->m_pkthdr.hash);
+       port = netisr_cpuport(m->m_pkthdr.hash);
        KASSERT(&curthread->td_msgport == port, ("wrong msgport"));
 
        KASSERT((num > 0 && num <= NELEM(netisrs)), ("bad isr %d", num));
@@ -529,7 +529,7 @@ netisr_register_rollup(netisr_ru_t ru_func, int prio)
  * thread for a particular cpu.
  */
 lwkt_port_t
-netisr_portfn(int cpu)
+netisr_cpuport(int cpu)
 {
        KKASSERT(cpu >= 0 && cpu < ncpus);
        return (&netisr_cpu[cpu].td_msgport);
@@ -541,7 +541,7 @@ netisr_portfn(int cpu)
 lwkt_port_t
 netisr_curport(void)
 {
-       return(netisr_portfn(mycpu->gd_cpuid));
+       return(netisr_cpuport(mycpuid));
 }
 
 /*
@@ -654,7 +654,7 @@ netisr_barrier_set(struct netisr_barrier *br)
        volatile cpumask_t other_cpumask;
        int i, cur_cpuid;
 
-       KKASSERT(&curthread->td_msgport == netisr_portfn(0));
+       KKASSERT(&curthread->td_msgport == netisr_cpuport(0));
        KKASSERT(!br->br_isset);
 
        other_cpumask = mycpu->gd_other_cpus & smp_active_mask;
@@ -680,7 +680,7 @@ netisr_barrier_set(struct netisr_barrier *br)
        for (i = 0; i < ncpus; ++i) {
                if (i == cur_cpuid)
                        continue;
-               lwkt_sendmsg(netisr_portfn(i), &br->br_msgs[i]->base.lmsg);
+               lwkt_sendmsg(netisr_cpuport(i), &br->br_msgs[i]->base.lmsg);
        }
 
        while (other_cpumask != 0) {
@@ -696,7 +696,7 @@ netisr_barrier_rem(struct netisr_barrier *br)
 {
        int i, cur_cpuid;
 
-       KKASSERT(&curthread->td_msgport == netisr_portfn(0));
+       KKASSERT(&curthread->td_msgport == netisr_cpuport(0));
        KKASSERT(br->br_isset);
 
        cur_cpuid = mycpuid;
index c203a48..05af905 100644 (file)
@@ -165,7 +165,7 @@ extern lwkt_port netisr_afree_free_so_rport;
 extern lwkt_port netisr_apanic_rport;
 extern lwkt_port netisr_sync_port;
 
-lwkt_port_t    netisr_portfn(int cpu);
+lwkt_port_t    netisr_cpuport(int cpu);
 lwkt_port_t    netisr_curport(void);
 
 void           netisr_register(int, netisr_fn_t, netisr_cpufn_t);
index e4a3193..c57e3d9 100644 (file)
@@ -2963,7 +2963,7 @@ pf_socket_lookup(int direction, struct pf_pdesc *pd)
 #endif /* INET6 */
        case AF_INET:
                if (msg != NULL) {
-                       lwkt_domsg(netisr_portfn(pi_cpu),
+                       lwkt_domsg(netisr_cpuport(pi_cpu),
                                     &msg->base.lmsg, 0);
                } else
                {
index 31d9c02..2241cf5 100644 (file)
@@ -43,7 +43,7 @@
 #include <net/netmsg2.h>
 #include <sys/mplock2.h>
 
-#define PFIL_CFGPORT   netisr_portfn(0)
+#define PFIL_CFGPORT   netisr_cpuport(0)
 
 #define PFIL_GETMPLOCK(pfh) \
 do { \
index cf171f9..791b0d0 100644 (file)
@@ -363,7 +363,7 @@ rts_input_skip(struct mbuf *m, sa_family_t family, struct rawcb *skip)
 
        M_ASSERTPKTHDR(m);
 
-       port = netisr_portfn(0);        /* XXX same as for routing socket */
+       port = netisr_cpuport(0);       /* XXX same as for routing socket */
        pmsg = &m->m_hdr.mh_netmsg;
        netmsg_init(&pmsg->base, NULL, &netisr_apanic_rport,
                    0, rts_input_handler);
index 0d241b6..b8f14ec 100644 (file)
@@ -425,7 +425,7 @@ vlan_ifdetach(void *arg __unused, struct ifnet *ifp)
                    0, vlan_ifdetach_dispatch);
        vmsg.nv_ifp_p = ifp;
 
-       lwkt_domsg(netisr_portfn(0), &vmsg.base.lmsg, 0);
+       lwkt_domsg(netisr_cpuport(0), &vmsg.base.lmsg, 0);
 }
 
 static int
@@ -515,7 +515,7 @@ vlan_start(struct ifnet *ifp, struct ifaltq_subque *ifsq)
        if ((ifp->if_flags & IFF_RUNNING) == 0)
                return;
 
-       p_port = netisr_portfn(
+       p_port = netisr_cpuport(
            ifsq_get_cpuid(ifq_get_subq_default(&ifp_p->if_snd)));
        for (;;) {
                struct netmsg_packet *nmp;
@@ -768,7 +768,7 @@ vlan_config(struct ifvlan *ifv, const char *parent_name, uint16_t vlantag)
        vmsg.nv_parent_name = parent_name;
        vmsg.nv_vlantag = vlantag;
 
-       return lwkt_domsg(netisr_portfn(0), &vmsg.base.lmsg, 0);
+       return lwkt_domsg(netisr_cpuport(0), &vmsg.base.lmsg, 0);
 }
 
 static void
@@ -906,7 +906,7 @@ vlan_unconfig(struct ifvlan *ifv)
                    0, vlan_unconfig_dispatch);
        vmsg.nv_ifv = ifv;
 
-       return lwkt_domsg(netisr_portfn(0), &vmsg.base.lmsg, 0);
+       return lwkt_domsg(netisr_cpuport(0), &vmsg.base.lmsg, 0);
 }
 
 static int
@@ -1048,7 +1048,7 @@ vlan_config_multi(struct ifvlan *ifv)
                    0, vlan_multi_dispatch);
        vmsg.nv_ifv = ifv;
 
-       return lwkt_domsg(netisr_portfn(0), &vmsg.base.lmsg, 0);
+       return lwkt_domsg(netisr_cpuport(0), &vmsg.base.lmsg, 0);
 }
 
 static void
@@ -1080,5 +1080,5 @@ vlan_config_flags(struct ifvlan *ifv)
                    0, vlan_flags_dispatch);
        vmsg.nv_ifv = ifv;
 
-       return lwkt_domsg(netisr_portfn(0), &vmsg.base.lmsg, 0);
+       return lwkt_domsg(netisr_cpuport(0), &vmsg.base.lmsg, 0);
 }
index 50ad3cf..9b13314 100644 (file)
@@ -463,7 +463,7 @@ arprequest_async(struct ifnet *ifp, const struct in_addr *sip,
        pmsg->nm_packet = m;
        pmsg->base.lmsg.u.ms_resultp = ifp;
 
-       lwkt_sendmsg(netisr_portfn(mycpuid), &pmsg->base.lmsg);
+       lwkt_sendmsg(netisr_cpuport(mycpuid), &pmsg->base.lmsg);
 }
 
 /*
@@ -1092,7 +1092,7 @@ arp_update_msghandler(netmsg_t msg)
                rmsg->saddr = saddr;
                rmsg->taddr = taddr;
                rmsg->myaddr = myaddr;
-               lwkt_sendmsg(netisr_portfn(0), &rmsg->base.lmsg);
+               lwkt_sendmsg(netisr_cpuport(0), &rmsg->base.lmsg);
        }
 }
 
index 8ef9cce..6ee859c 100644 (file)
@@ -243,7 +243,7 @@ in_control_redispatch(u_long cmd, caddr_t data, struct ifnet *ifp,
                msg.nm_data = data;
                msg.nm_ifp = ifp;
                msg.nm_td = td;
-               lwkt_domsg(netisr_portfn(0), &msg.base.lmsg, 0);
+               lwkt_domsg(netisr_cpuport(0), &msg.base.lmsg, 0);
                error = msg.base.lmsg.ms_error;
                break;
 
index 97489c6..7c0e511 100644 (file)
@@ -691,7 +691,7 @@ carp_clone_destroy(struct ifnet *ifp)
            carp_clone_destroy_dispatch);
        cmsg.nc_softc = sc;
 
-       lwkt_domsg(netisr_portfn(0), &cmsg.base.lmsg, 0);
+       lwkt_domsg(netisr_cpuport(0), &cmsg.base.lmsg, 0);
 
        lwkt_gettoken(&carp_listtok);
        LIST_REMOVE(sc, sc_next);
@@ -896,7 +896,7 @@ carp_ifdetach(void *arg __unused, struct ifnet *ifp)
            carp_ifdetach_dispatch);
        cmsg.nc_carpdev = ifp;
 
-       lwkt_domsg(netisr_portfn(0), &cmsg.base.lmsg, 0);
+       lwkt_domsg(netisr_cpuport(0), &cmsg.base.lmsg, 0);
 }
 
 /*
@@ -1277,7 +1277,7 @@ carp_send_ad_timeout(void *xsc)
 
        crit_enter();
        if (cmsg->base.lmsg.ms_flags & MSGF_DONE)
-               lwkt_sendmsg(netisr_portfn(0), &cmsg->base.lmsg);
+               lwkt_sendmsg(netisr_cpuport(0), &cmsg->base.lmsg);
        crit_exit();
 }
 
@@ -1583,7 +1583,7 @@ carp_iamatch(const struct in_ifaddr *ia)
 {
        const struct carp_softc *sc = ia->ia_ifp->if_softc;
 
-       KASSERT(&curthread->td_msgport == netisr_portfn(0),
+       KASSERT(&curthread->td_msgport == netisr_cpuport(0),
            ("not in netisr0"));
 
 #ifdef notyet
@@ -1693,7 +1693,7 @@ carp_master_down_timeout(void *xsc)
 
        crit_enter();
        if (cmsg->base.lmsg.ms_flags & MSGF_DONE)
-               lwkt_sendmsg(netisr_portfn(0), &cmsg->base.lmsg);
+               lwkt_sendmsg(netisr_cpuport(0), &cmsg->base.lmsg);
        crit_exit();
 }
 
@@ -1925,7 +1925,7 @@ carp_ioctl_getvhaddr(struct carp_softc *sc, struct ifdrv *ifd)
        cmsg.nc_softc = sc;
        cmsg.nc_datalen = ifd->ifd_len;
 
-       error = lwkt_domsg(netisr_portfn(0), &cmsg.base.lmsg, 0);
+       error = lwkt_domsg(netisr_cpuport(0), &cmsg.base.lmsg, 0);
 
        if (!error) {
                if (cmsg.nc_data != NULL) {
@@ -2353,7 +2353,7 @@ carp_ioctl_stop(struct carp_softc *sc)
            carp_ioctl_stop_dispatch);
        cmsg.nc_softc = sc;
 
-       lwkt_domsg(netisr_portfn(0), &cmsg.base.lmsg, 0);
+       lwkt_domsg(netisr_cpuport(0), &cmsg.base.lmsg, 0);
 
        ifnet_serialize_all(ifp);
 }
@@ -2464,7 +2464,7 @@ carp_ioctl_setvh(struct carp_softc *sc, void *udata, struct ucred *cr)
        cmsg.nc_softc = sc;
        cmsg.nc_data = &carpr;
 
-       error = lwkt_domsg(netisr_portfn(0), &cmsg.base.lmsg, 0);
+       error = lwkt_domsg(netisr_cpuport(0), &cmsg.base.lmsg, 0);
 
 back:
        ifnet_serialize_all(ifp);
@@ -2504,7 +2504,7 @@ carp_ioctl_getvh(struct carp_softc *sc, void *udata, struct ucred *cr)
        cmsg.nc_softc = sc;
        cmsg.nc_data = &carpr;
 
-       lwkt_domsg(netisr_portfn(0), &cmsg.base.lmsg, 0);
+       lwkt_domsg(netisr_cpuport(0), &cmsg.base.lmsg, 0);
 
        error = priv_check_cred(cr, PRIV_ROOT, NULL_CRED_OKAY);
        if (error)
@@ -2551,7 +2551,7 @@ carp_ioctl_getdevname(struct carp_softc *sc, struct ifdrv *ifd)
        cmsg.nc_softc = sc;
        cmsg.nc_data = devname;
 
-       lwkt_domsg(netisr_portfn(0), &cmsg.base.lmsg, 0);
+       lwkt_domsg(netisr_cpuport(0), &cmsg.base.lmsg, 0);
 
        error = copyout(devname, ifd->ifd_data, sizeof(devname));
 
@@ -2589,7 +2589,7 @@ carp_init(void *xsc)
            carp_init_dispatch);
        cmsg.nc_softc = sc;
 
-       lwkt_domsg(netisr_portfn(0), &cmsg.base.lmsg, 0);
+       lwkt_domsg(netisr_cpuport(0), &cmsg.base.lmsg, 0);
 
        ifnet_serialize_all(ifp);
 }
@@ -2969,7 +2969,7 @@ carp_ifaddr(void *arg __unused, struct ifnet *ifp,
        if (ifa->ifa_addr->sa_family != AF_INET)
                return;
 
-       KASSERT(&curthread->td_msgport == netisr_portfn(0),
+       KASSERT(&curthread->td_msgport == netisr_cpuport(0),
            ("not in netisr0"));
 
        if (ifp->if_type == IFT_CARP) {
index 6edfd3c..7a462d9 100644 (file)
@@ -412,25 +412,25 @@ tcp_ctlport(int cmd, struct sockaddr *sa, void *vip)
                cpu = tcp_addrcpu(faddr.s_addr, th->th_dport,
                                  ip->ip_src.s_addr, th->th_sport);
        }
-       return(netisr_portfn(cpu));
+       return(netisr_cpuport(cpu));
 }
 
 lwkt_port_t
 tcp_addrport(in_addr_t faddr, in_port_t fport, in_addr_t laddr, in_port_t lport)
 {
-       return(netisr_portfn(tcp_addrcpu(faddr, fport, laddr, lport)));
+       return(netisr_cpuport(tcp_addrcpu(faddr, fport, laddr, lport)));
 }
 
 lwkt_port_t
 tcp_addrport0(void)
 {
-       return(netisr_portfn(0));
+       return(netisr_cpuport(0));
 }
 
 lwkt_port_t
 udp_addrport(in_addr_t faddr, in_port_t fport, in_addr_t laddr, in_port_t lport)
 {
-       return(netisr_portfn(udp_addrcpu(faddr, fport, laddr, lport)));
+       return(netisr_cpuport(udp_addrcpu(faddr, fport, laddr, lport)));
 }
 
 /*
@@ -467,5 +467,5 @@ udp_ctlport(int cmd, struct sockaddr *sa, void *vip)
                cpu = udp_addrcpu(faddr.s_addr, ip->ip_src.s_addr,
                                  uh->uh_dport, uh->uh_sport);
        }
-       return (netisr_portfn(cpu));
+       return (netisr_cpuport(cpu));
 }
index 0bde56b..ea7aaf0 100644 (file)
@@ -309,7 +309,7 @@ divert_packet(struct mbuf *m, int incoming)
                else
                        nmp->base.lmsg.u.ms_result32 |= DIV_OUTPUT;
 
-               lwkt_sendmsg(netisr_portfn(0), &nmp->base.lmsg);
+               lwkt_sendmsg(netisr_cpuport(0), &nmp->base.lmsg);
        } else {
                div_packet(m, incoming, port);
        }
@@ -402,7 +402,7 @@ div_attach(netmsg_t msg)
        if (error)
                goto out;
        lwkt_gettoken(&div_token);
-       sosetport(so, netisr_portfn(0));
+       sosetport(so, netisr_cpuport(0));
        error = in_pcballoc(so, &divcbinfo);
        if (error) {
                lwkt_reltoken(&div_token);
index 885eea3..33722b8 100644 (file)
@@ -424,7 +424,7 @@ ipflow_timo_ipi(void *arg __unused)
 
        crit_enter();
        if (msg->ms_flags & MSGF_DONE)
-               lwkt_sendmsg(netisr_portfn(mycpuid), msg);
+               lwkt_sendmsg(netisr_cpuport(mycpuid), msg);
        crit_exit();
 }
 
index 5d0bff3..c549f44 100644 (file)
@@ -943,7 +943,7 @@ DPRINTF(("ip_input: no SP, packet discarded\n"));/*XXX*/
                ip->ip_off = ntohs(ip->ip_off);
                KKASSERT(m->m_flags & M_HASH);
        }
-       port = netisr_portfn(m->m_pkthdr.hash);
+       port = netisr_cpuport(m->m_pkthdr.hash);
 
        if (port != &curthread->td_msgport) {
                struct netmsg_packet *pmsg;
index d052b73..a542ce4 100644 (file)
@@ -1467,7 +1467,7 @@ tcp_output_sched(struct tcpcb *tp)
 {
        crit_enter();
        if (tp->tt_sndmore->lmsg.ms_flags & MSGF_DONE)
-               lwkt_sendmsg(netisr_portfn(mycpuid), &tp->tt_sndmore->lmsg);
+               lwkt_sendmsg(netisr_cpuport(mycpuid), &tp->tt_sndmore->lmsg);
        crit_exit();
 }
 
index 8166f8a..093e4fd 100644 (file)
@@ -802,7 +802,7 @@ tcp_listen_detach_handler(netmsg_t msg)
 
        nextcpu = cpu + 1;
        if (nextcpu < ncpus2)
-               lwkt_forwardmsg(netisr_portfn(nextcpu), &nmsg->base.lmsg);
+               lwkt_forwardmsg(netisr_cpuport(nextcpu), &nmsg->base.lmsg);
        else
                lwkt_replymsg(&nmsg->base.lmsg, 0);
 }
@@ -849,14 +849,14 @@ tcp_close(struct tcpcb *tp)
        if (inp->inp_flags & INP_WILDCARD_MP) {
                struct netmsg_listen_detach nmsg;
 
-               KKASSERT(so->so_port == netisr_portfn(0));
-               KKASSERT(&curthread->td_msgport == netisr_portfn(0));
+               KKASSERT(so->so_port == netisr_cpuport(0));
+               KKASSERT(&curthread->td_msgport == netisr_cpuport(0));
                KKASSERT(inp->inp_pcbinfo == &tcbinfo[0]);
 
                netmsg_init(&nmsg.base, NULL, &curthread->td_msgport,
                            MSGF_PRIORITY, tcp_listen_detach_handler);
                nmsg.nm_tp = tp;
-               lwkt_domsg(netisr_portfn(1), &nmsg.base.lmsg, 0);
+               lwkt_domsg(netisr_cpuport(1), &nmsg.base.lmsg, 0);
 
                inp->inp_flags &= ~INP_WILDCARD_MP;
        }
@@ -1098,7 +1098,7 @@ tcp_drain(void)
                        netmsg_init(&nm->base, NULL, &netisr_afree_rport,
                                    0, tcp_drain_handler);
                        nm->nm_head = &tcbinfo[cpu].pcblisthead;
-                       lwkt_sendmsg(netisr_portfn(cpu), &nm->base.lmsg);
+                       lwkt_sendmsg(netisr_cpuport(cpu), &nm->base.lmsg);
                }
        }
 }
@@ -1347,7 +1347,7 @@ tcp_notifyall_oncpu(netmsg_t msg)
 
        nextcpu = mycpuid + 1;
        if (nextcpu < ncpus2)
-               lwkt_forwardmsg(netisr_portfn(nextcpu), &nm->base.lmsg);
+               lwkt_forwardmsg(netisr_cpuport(nextcpu), &nm->base.lmsg);
        else
                lwkt_replymsg(&nm->base.lmsg, 0);
 }
@@ -1426,7 +1426,7 @@ tcp_ctlinput(netmsg_t msg)
        } else {
                struct netmsg_tcp_notify *nm;
 
-               KKASSERT(&curthread->td_msgport == netisr_portfn(0));
+               KKASSERT(&curthread->td_msgport == netisr_cpuport(0));
                nm = kmalloc(sizeof(*nm), M_LWKTMSG, M_INTWAIT);
                netmsg_init(&nm->base, NULL, &netisr_afree_rport,
                            0, tcp_notifyall_oncpu);
@@ -1434,7 +1434,7 @@ tcp_ctlinput(netmsg_t msg)
                nm->nm_arg = arg;
                nm->nm_notify = notify;
 
-               lwkt_sendmsg(netisr_portfn(0), &nm->base.lmsg);
+               lwkt_sendmsg(netisr_cpuport(0), &nm->base.lmsg);
        }
 done:
        lwkt_replymsg(&msg->lmsg, 0);
index 5834d0c..3df6eb0 100644 (file)
@@ -352,7 +352,7 @@ syncache_init(void)
                        callout_init_mp(&syncache_percpu->tt_timerq[i]);
 
                        syncache_percpu->mrec[i].slot = i;
-                       syncache_percpu->mrec[i].port = netisr_portfn(cpu);
+                       syncache_percpu->mrec[i].port = netisr_cpuport(cpu);
                        syncache_percpu->mrec[i].msg.nm_mrec =
                                    &syncache_percpu->mrec[i];
                        netmsg_init(&syncache_percpu->mrec[i].msg.base,
index 6fe2263..959c256 100644 (file)
@@ -372,7 +372,7 @@ in_pcbinswildcardhash_handler(netmsg_t msg)
 
        nextcpu = cpu + 1;
        if (nextcpu < ncpus2)
-               lwkt_forwardmsg(netisr_portfn(nextcpu), &nm->base.lmsg);
+               lwkt_forwardmsg(netisr_cpuport(nextcpu), &nm->base.lmsg);
        else
                lwkt_replymsg(&nm->base.lmsg, 0);
 }
@@ -418,14 +418,14 @@ tcp_usr_listen(netmsg_t msg)
                        ("already on MP wildcardhash"));
                inp->inp_flags |= INP_WILDCARD_MP;
 
-               KKASSERT(so->so_port == netisr_portfn(0));
-               KKASSERT(&curthread->td_msgport == netisr_portfn(0));
+               KKASSERT(so->so_port == netisr_cpuport(0));
+               KKASSERT(&curthread->td_msgport == netisr_cpuport(0));
                KKASSERT(inp->inp_pcbinfo == &tcbinfo[0]);
 
                netmsg_init(&nm.base, NULL, &curthread->td_msgport,
                            MSGF_PRIORITY, in_pcbinswildcardhash_handler);
                nm.nm_inp = inp;
-               lwkt_domsg(netisr_portfn(1), &nm.base.lmsg, 0);
+               lwkt_domsg(netisr_cpuport(1), &nm.base.lmsg, 0);
        }
        in_pcbinswildcardhash(inp);
        COMMON_END(PRU_LISTEN);
@@ -475,14 +475,14 @@ tcp6_usr_listen(netmsg_t msg)
                        ("already on MP wildcardhash"));
                inp->inp_flags |= INP_WILDCARD_MP;
 
-               KKASSERT(so->so_port == netisr_portfn(0));
-               KKASSERT(&curthread->td_msgport == netisr_portfn(0));
+               KKASSERT(so->so_port == netisr_cpuport(0));
+               KKASSERT(&curthread->td_msgport == netisr_cpuport(0));
                KKASSERT(inp->inp_pcbinfo == &tcbinfo[0]);
 
                netmsg_init(&nm.base, NULL, &curthread->td_msgport,
                            MSGF_PRIORITY, in_pcbinswildcardhash_handler);
                nm.nm_inp = inp;
-               lwkt_domsg(netisr_portfn(1), &nm.base.lmsg, 0);
+               lwkt_domsg(netisr_cpuport(1), &nm.base.lmsg, 0);
        }
        in_pcbinswildcardhash(inp);
        COMMON_END(PRU_LISTEN);
index f93cdb5..9a25834 100644 (file)
@@ -667,7 +667,7 @@ udp_notifyall_oncpu(netmsg_t msg)
        /* XXX currently udp only runs on cpu 0 */
        nextcpu = mycpuid + 1;
        if (nextcpu < ncpus2)
-               lwkt_forwardmsg(netisr_portfn(nextcpu), &nm->base.lmsg);
+               lwkt_forwardmsg(netisr_cpuport(nextcpu), &nm->base.lmsg);
        else
                lwkt_replymsg(&nmsg->base.lmsg, 0);
 #endif
@@ -698,7 +698,7 @@ udp_ctlinput(netmsg_t msg)
        struct in_addr faddr;
        struct inpcb *inp;
 
-       KKASSERT(&curthread->td_msgport == netisr_portfn(0));
+       KKASSERT(&curthread->td_msgport == netisr_cpuport(0));
 
        faddr = ((struct sockaddr_in *)sa)->sin_addr;
        if (sa->sa_family != AF_INET || faddr.s_addr == INADDR_ANY)
@@ -722,20 +722,20 @@ udp_ctlinput(netmsg_t msg)
        } else if (PRC_IS_REDIRECT(cmd)) {
                struct netmsg_udp_notify *nm;
 
-               KKASSERT(&curthread->td_msgport == netisr_portfn(0));
+               KKASSERT(&curthread->td_msgport == netisr_cpuport(0));
                nm = kmalloc(sizeof(*nm), M_LWKTMSG, M_INTWAIT);
                netmsg_init(&nm->base, NULL, &netisr_afree_rport,
                            0, udp_notifyall_oncpu);
                nm->nm_faddr = faddr;
                nm->nm_arg = inetctlerrmap[cmd];
                nm->nm_notify = notify;
-               lwkt_sendmsg(netisr_portfn(0), &nm->base.lmsg);
+               lwkt_sendmsg(netisr_cpuport(0), &nm->base.lmsg);
        } else {
                /*
                 * XXX We should forward msg upon PRC_HOSTHEAD and ip == NULL,
                 * once UDP inpcbs are CPU localized
                 */
-               KKASSERT(&curthread->td_msgport == netisr_portfn(0));
+               KKASSERT(&curthread->td_msgport == netisr_cpuport(0));
                in_pcbnotifyall(&udbinfo.pcblisthead, faddr, inetctlerrmap[cmd],
                                notify);
        }
@@ -991,7 +991,7 @@ udp_abort(netmsg_t msg)
        struct inpcb *inp;
        int error;
 
-       KKASSERT(&curthread->td_msgport == netisr_portfn(0));
+       KKASSERT(&curthread->td_msgport == netisr_cpuport(0));
 
        inp = so->so_pcb;
        if (inp) {
@@ -1015,7 +1015,7 @@ udp_attach(netmsg_t msg)
        struct inpcb *inp;
        int error;
 
-       KKASSERT(&curthread->td_msgport == netisr_portfn(0));
+       KKASSERT(&curthread->td_msgport == netisr_cpuport(0));
 
        inp = so->so_pcb;
        if (inp != NULL) {
@@ -1036,7 +1036,7 @@ udp_attach(netmsg_t msg)
        /*
         * Set default port for protocol processing prior to bind/connect.
         */
-       sosetport(so, netisr_portfn(0));
+       sosetport(so, netisr_cpuport(0));
 
        inp = (struct inpcb *)so->so_pcb;
        inp->inp_vflag |= INP_IPV4;
@@ -1085,7 +1085,7 @@ udp_connect(netmsg_t msg)
        lwkt_port_t port;
        int error;
 
-       KKASSERT(&curthread->td_msgport == netisr_portfn(0));
+       KKASSERT(&curthread->td_msgport == netisr_cpuport(0));
 
        inp = so->so_pcb;
        if (inp == NULL) {
@@ -1213,7 +1213,7 @@ udp_detach(netmsg_t msg)
        struct inpcb *inp;
        int error;
 
-       KKASSERT(&curthread->td_msgport == netisr_portfn(0));
+       KKASSERT(&curthread->td_msgport == netisr_cpuport(0));
 
        inp = so->so_pcb;
        if (inp) {
@@ -1235,7 +1235,7 @@ udp_disconnect(netmsg_t msg)
        struct inpcb *inp;
        int error;
 
-       KKASSERT(&curthread->td_msgport == netisr_portfn(0));
+       KKASSERT(&curthread->td_msgport == netisr_cpuport(0));
 
        inp = so->so_pcb;
        if (inp == NULL) {
@@ -1275,7 +1275,7 @@ udp_send(netmsg_t msg)
        struct inpcb *inp;
        int error;
 
-       KKASSERT(&curthread->td_msgport == netisr_portfn(0));
+       KKASSERT(&curthread->td_msgport == netisr_cpuport(0));
        KKASSERT(msg->send.nm_control == NULL);
 
        inp = so->so_pcb;
@@ -1305,7 +1305,7 @@ udp_shutdown(netmsg_t msg)
        struct inpcb *inp;
        int error;
 
-       KKASSERT(&curthread->td_msgport == netisr_portfn(0));
+       KKASSERT(&curthread->td_msgport == netisr_cpuport(0));
 
        inp = so->so_pcb;
        if (inp) {
index 99d08d3..cf373e9 100644 (file)
@@ -852,7 +852,7 @@ hbhcheck:
                        struct netmsg_packet *pmsg;
                        lwkt_port_t port;
 
-                       port = netisr_portfn(0); /* XXX */
+                       port = netisr_cpuport(0); /* XXX */
                        KKASSERT(port != NULL);
                        pmsg = &m->m_hdr.mh_netmsg;
                        netmsg_init(&pmsg->base, NULL,
index c00d961..042d339 100644 (file)
@@ -594,7 +594,7 @@ udp6_attach(netmsg_t msg)
        if (error)
                goto out;
 
-       sosetport(so, netisr_portfn(0));
+       sosetport(so, netisr_cpuport(0));
        inp = (struct inpcb *)so->so_pcb;
        inp->inp_vflag |= INP_IPV6;
        if (!ip6_v6only)
index d86444a..441c34c 100644 (file)
@@ -375,7 +375,7 @@ pktgen_start_ifsq(struct pktgen *pktg, struct ifaltq_subque *ifsq)
        np->np_pktg = pktg;
        np->np_ifsq = ifsq;
 
-       lwkt_sendmsg(netisr_portfn(ifsq_get_cpuid(ifsq)), &np->np_base.lmsg);
+       lwkt_sendmsg(netisr_cpuport(ifsq_get_cpuid(ifsq)), &np->np_base.lmsg);
 }
 
 static int
@@ -569,7 +569,7 @@ pktgen_buf_send(netmsg_t msg)
        struct pktgen_buf *pb = (struct pktgen_buf *)msg;
        struct mbuf *m;
 
-       KKASSERT(&curthread->td_msgport == netisr_portfn(pb->pb_cpuid));
+       KKASSERT(&curthread->td_msgport == netisr_cpuport(pb->pb_cpuid));
 
        crit_enter();
        lwkt_replymsg(&pb->pb_nmsg.lmsg, 0);
@@ -603,11 +603,11 @@ pktgen_buf_free(void *arg)
                return;
        }
 
-       if (&curthread->td_msgport != netisr_portfn(pb->pb_cpuid)) {
+       if (&curthread->td_msgport != netisr_cpuport(pb->pb_cpuid)) {
                KKASSERT(pb->pb_cpuid == mycpuid);
                crit_enter();
                KKASSERT(pb->pb_nmsg.lmsg.ms_flags & MSGF_DONE);
-               lwkt_sendmsg(netisr_portfn(pb->pb_cpuid), &pb->pb_nmsg.lmsg);
+               lwkt_sendmsg(netisr_cpuport(pb->pb_cpuid), &pb->pb_nmsg.lmsg);
                crit_exit();
                return;
        }