Index: arch/macppc/dev/if_bm.c =================================================================== RCS file: /cvs/src/sys/arch/macppc/dev/if_bm.c,v retrieving revision 1.30 diff -u -p -r1.30 if_bm.c --- arch/macppc/dev/if_bm.c 8 Feb 2015 07:00:48 -0000 1.30 +++ arch/macppc/dev/if_bm.c 9 Feb 2015 00:54:07 -0000 @@ -500,6 +500,7 @@ bmac_rint(void *v) { struct bmac_softc *sc = v; struct ifnet *ifp = &sc->arpcom.ac_if; + struct mbuf_list = MBUF_LIST_INITIALIZER(); struct mbuf *m; dbdma_command_t *cmd; int status, resid, count, datalen; @@ -547,7 +548,7 @@ bmac_rint(void *v) goto next; } - if_input(ifp, m); + ml_enqueue(&ml, m); ifp->if_ipackets++; next: @@ -560,6 +561,7 @@ next: } dbdma_continue(sc->sc_rxdma); + if_input(ifp, &ml); return (1); } Index: arch/macppc/dev/if_mc.c =================================================================== RCS file: /cvs/src/sys/arch/macppc/dev/if_mc.c,v retrieving revision 1.19 diff -u -p -r1.19 if_mc.c --- arch/macppc/dev/if_mc.c 8 Feb 2015 07:00:48 -0000 1.19 +++ arch/macppc/dev/if_mc.c 9 Feb 2015 00:54:07 -0000 @@ -875,6 +875,7 @@ void mace_read(struct mc_softc *sc, caddr_t pkt, int len) { struct ifnet *ifp = &sc->sc_arpcom.ac_if; + struct mbuf_list ml = MBUF_LIST_INITIALIZER(); struct mbuf *m; if (len <= sizeof(struct ether_header) || @@ -893,7 +894,8 @@ mace_read(struct mc_softc *sc, caddr_t p return; } - if_input(ifp, m); + ml_enqueue(&ml, m); + if_input(ifp, &ml); ifp->if_ipackets++; } Index: dev/ic/gem.c =================================================================== RCS file: /cvs/src/sys/dev/ic/gem.c,v retrieving revision 1.109 diff -u -p -r1.109 gem.c --- dev/ic/gem.c 8 Feb 2015 06:02:03 -0000 1.109 +++ dev/ic/gem.c 9 Feb 2015 00:54:07 -0000 @@ -945,6 +945,7 @@ gem_rint(struct gem_softc *sc) bus_space_tag_t t = sc->sc_bustag; bus_space_handle_t h = sc->sc_h1; struct gem_rxsoft *rxs; + struct mbuf_list ml = MBUF_LIST_INITIALIZER(); struct mbuf *m; u_int64_t rxstat; int i, len; @@ -1000,7 +1001,7 @@ gem_rint(struct gem_softc *sc) ifp->if_ipackets++; m->m_pkthdr.len = m->m_len = len; - if_input(ifp, m); + ml_enqueue(&ml, m); } /* Update the receive pointer. */ @@ -1010,6 +1011,8 @@ gem_rint(struct gem_softc *sc) DPRINTF(sc, ("gem_rint: done sc->sc_rx_cons %d, complete %d\n", sc->sc_rx_cons, bus_space_read_4(t, h, GEM_RX_COMPLETION))); + + if_input(ifp, &ml); return (1); } Index: dev/ic/re.c =================================================================== RCS file: /cvs/src/sys/dev/ic/re.c,v retrieving revision 1.174 diff -u -p -r1.174 re.c --- dev/ic/re.c 8 Feb 2015 06:55:28 -0000 1.174 +++ dev/ic/re.c 9 Feb 2015 00:54:07 -0000 @@ -1272,6 +1272,7 @@ re_rx_list_fill(struct rl_softc *sc) int re_rxeof(struct rl_softc *sc) { + struct mbuf_list ml = MBUF_LIST_INITIALIZER(); struct mbuf *m; struct ifnet *ifp; int i, total_len, rx = 0; @@ -1421,11 +1422,13 @@ re_rxeof(struct rl_softc *sc) } #endif - if_input(ifp, m); + ml_enqueue(&ml, m); } sc->rl_ldata.rl_rx_considx = i; re_rx_list_fill(sc); + + if_input(ifp, &ml); return (rx); } Index: dev/pci/if_em.c =================================================================== RCS file: /cvs/src/sys/dev/pci/if_em.c,v retrieving revision 1.292 diff -u -p -r1.292 if_em.c --- dev/pci/if_em.c 8 Feb 2015 06:02:24 -0000 1.292 +++ dev/pci/if_em.c 9 Feb 2015 00:54:07 -0000 @@ -2844,6 +2844,7 @@ void em_rxeof(struct em_softc *sc) { struct ifnet *ifp = &sc->interface_data.ac_if; + struct mbuf_list ml = MBUF_LIST_INITIALIZER(); struct mbuf *m; u_int8_t accept_frame = 0; u_int8_t eop = 0; @@ -2969,8 +2970,7 @@ em_rxeof(struct em_softc *sc) m->m_flags |= M_VLANTAG; } #endif - - if_input(ifp, m); + ml_enqueue(&ml, m); sc->fmp = NULL; sc->lmp = NULL; @@ -2995,6 +2995,8 @@ em_rxeof(struct em_softc *sc) bus_dmamap_sync(sc->rxdma.dma_tag, sc->rxdma.dma_map, 0, sizeof(*desc) * sc->num_rx_desc, BUS_DMASYNC_PREREAD); + + if_input(ifp, &ml); sc->next_rx_desc_to_check = i; } Index: dev/pci/if_pcn.c =================================================================== RCS file: /cvs/src/sys/dev/pci/if_pcn.c,v retrieving revision 1.34 diff -u -p -r1.34 if_pcn.c --- dev/pci/if_pcn.c 8 Feb 2015 06:55:28 -0000 1.34 +++ dev/pci/if_pcn.c 9 Feb 2015 00:54:07 -0000 @@ -1298,8 +1298,10 @@ pcn_rxintr(struct pcn_softc *sc) struct ifnet *ifp = &sc->sc_arpcom.ac_if; struct pcn_rxsoft *rxs; struct mbuf *m; + struct mbuf_list ml = MBUF_LIST_INITIALIZER(); uint32_t rmd1; int i, len; + int rv = 0; for (i = sc->sc_rxptr;; i = PCN_NEXTRX(i)) { rxs = &sc->sc_rxsoft[i]; @@ -1324,7 +1326,8 @@ pcn_rxintr(struct pcn_softc *sc) (LE_R1_STP|LE_R1_ENP)) { printf("%s: packet spilled into next buffer\n", sc->sc_dev.dv_xname); - return (1); /* pcn_intr() will re-init */ + rv = 1; /* pcn_intr() will re-init */ + goto done; } /* @@ -1412,13 +1415,15 @@ pcn_rxintr(struct pcn_softc *sc) m->m_pkthdr.len = m->m_len = len; - if_input(ifp, m); + ml_enqueue(&ml, m); ifp->if_ipackets++; } /* Update the receive pointer. */ sc->sc_rxptr = i; - return (0); +done: + if_input(ifp, &ml); + return (rv); } /* Index: net/if.c =================================================================== RCS file: /cvs/src/sys/net/if.c,v retrieving revision 1.318 diff -u -p -r1.318 if.c --- net/if.c 9 Feb 2015 00:21:58 -0000 1.318 +++ net/if.c 9 Feb 2015 00:54:07 -0000 @@ -433,23 +433,26 @@ if_start(struct ifnet *ifp) } void -if_input(struct ifnet *ifp, struct mbuf *m) +if_input(struct ifnet *ifp, struct mbuf_list *ml) { + struct mbuf *m; struct ifih *ifih; splassert(IPL_NET); - m->m_pkthdr.rcvif = ifp; - m->m_pkthdr.ph_rtableid = ifp->if_rdomain; + while ((m = ml_dequeue(ml)) != NULL) { + m->m_pkthdr.rcvif = ifp; + m->m_pkthdr.ph_rtableid = ifp->if_rdomain; #if NBPFILTER > 0 - if (ifp->if_bpf) - bpf_mtap_ether(ifp->if_bpf, m, BPF_DIRECTION_IN); + if (ifp->if_bpf) + bpf_mtap_ether(ifp->if_bpf, m, BPF_DIRECTION_IN); #endif - SLIST_FOREACH(ifih, &ifp->if_inputs, ifih_next) { - if ((*ifih->ifih_input)(ifp, NULL, m)) - break; + SLIST_FOREACH(ifih, &ifp->if_inputs, ifih_next) { + if ((*ifih->ifih_input)(ifp, NULL, m)) + break; + } } } Index: net/if_var.h =================================================================== RCS file: /cvs/src/sys/net/if_var.h,v retrieving revision 1.19 diff -u -p -r1.19 if_var.h --- net/if_var.h 8 Feb 2015 06:00:52 -0000 1.19 +++ net/if_var.h 9 Feb 2015 00:54:07 -0000 @@ -69,6 +69,7 @@ #include struct mbuf; +struct mbuf_list; struct proc; struct rtentry; struct socket; @@ -396,7 +397,7 @@ extern struct ifnet_head ifnet; extern struct ifnet *lo0ifp; void if_start(struct ifnet *); -void if_input(struct ifnet *, struct mbuf *); +void if_input(struct ifnet *, struct mbuf_list *); #define ether_input_mbuf(ifp, m) ether_input((ifp), NULL, (m)) Index: net80211/ieee80211_input.c =================================================================== RCS file: /cvs/src/sys/net80211/ieee80211_input.c,v retrieving revision 1.131 diff -u -p -r1.131 ieee80211_input.c --- net80211/ieee80211_input.c 8 Feb 2015 06:03:07 -0000 1.131 +++ net80211/ieee80211_input.c 9 Feb 2015 00:54:07 -0000 @@ -870,8 +870,11 @@ ieee80211_deliver_data(struct ieee80211c bpf_mtap(ifp->if_bpf, m, BPF_DIRECTION_IN); #endif ieee80211_eapol_key_input(ic, m, ni); - } else - if_input(ifp, m); + } else { + struct mbuf_list ml = MBUF_LIST_INITIALIZER(); + ml_enqueue(&ml, m); + if_input(ifp, &ml); + } } }