-/* $OpenBSD: if_age.c,v 1.26 2015/03/14 03:38:48 jsg Exp $ */
+/* $OpenBSD: if_age.c,v 1.27 2015/04/30 07:51:07 mpi Exp $ */
/*-
* Copyright (c) 2008, Pyun YongHyeon <yongari@FreeBSD.org>
struct ifnet *ifp = &sc->sc_arpcom.ac_if;
struct age_rxdesc *rxd;
struct rx_desc *desc;
+ struct mbuf_list ml = MBUF_LIST_INITIALIZER();
struct mbuf *mp, *m;
uint32_t status, index;
int count, nsegs, pktlen;
m = sc->age_cdata.age_rxhead;
m->m_flags |= M_PKTHDR;
- m->m_pkthdr.rcvif = ifp;
m->m_pkthdr.len = sc->age_cdata.age_rxlen;
/* Set the first mbuf length. */
m->m_len = sc->age_cdata.age_rxlen - pktlen;
}
#endif
-#if NBPFILTER > 0
- if (ifp->if_bpf)
- bpf_mtap_ether(ifp->if_bpf, m,
- BPF_DIRECTION_IN);
-#endif
- /* Pass it on. */
- ether_input_mbuf(ifp, m);
+ ml_enqueue(&ml, m);
/* Reset mbuf chains. */
AGE_RXCHAIN_RESET(sc);
}
}
+ if_input(ifp, &ml);
+
if (count != nsegs) {
sc->age_cdata.age_rx_cons += nsegs;
sc->age_cdata.age_rx_cons %= AGE_RX_RING_CNT;
-/* $OpenBSD: if_et.c,v 1.26 2015/03/14 03:38:48 jsg Exp $ */
+/* $OpenBSD: if_et.c,v 1.27 2015/04/30 07:51:07 mpi Exp $ */
/*
* Copyright (c) 2007 The DragonFly Project. All rights reserved.
*
et_rxeof(struct et_softc *sc)
{
struct ifnet *ifp = &sc->sc_arpcom.ac_if;
+ struct mbuf_list ml = MBUF_LIST_INITIALIZER();
struct et_rxstatus_data *rxsd = &sc->sc_rx_status;
struct et_rxstat_ring *rxst_ring = &sc->sc_rxstat_ring;
uint32_t rxs_stat_ring;
} else {
m->m_pkthdr.len = m->m_len = buflen -
ETHER_CRC_LEN;
- m->m_pkthdr.rcvif = ifp;
-
-#if NBPFILTER > 0
- if (ifp->if_bpf != NULL)
- bpf_mtap(ifp->if_bpf, m,
- BPF_DIRECTION_IN);
-#endif
-
+ ml_enqueue(&ml, m);
ifp->if_ipackets++;
- ether_input_mbuf(ifp, m);
}
} else {
ifp->if_ierrors++;
rxring_pos |= ET_RX_RING_POS_WRAP;
CSR_WRITE_4(sc, rx_ring->rr_posreg, rxring_pos);
}
+
+ if_input(ifp, &ml);
}
int
***************************************************************************/
-/* $OpenBSD: if_ixgb.c,v 1.63 2014/12/22 02:28:52 tedu Exp $ */
+/* $OpenBSD: if_ixgb.c,v 1.64 2015/04/30 07:51:07 mpi Exp $ */
#include <dev/pci/if_ixgb.h>
ixgb_rxeof(struct ixgb_softc *sc, int count)
{
struct ifnet *ifp;
+ struct mbuf_list ml = MBUF_LIST_INITIALIZER();
struct mbuf *mp;
int eop = 0;
int len;
if (eop) {
eop_desc = i;
- sc->fmp->m_pkthdr.rcvif = ifp;
ifp->if_ipackets++;
ixgb_receive_checksum(sc, current_desc, sc->fmp);
}
#endif
-#if NBPFILTER > 0
- /*
- * Handle BPF listeners. Let the BPF
- * user see the packet.
- */
- if (ifp->if_bpf)
- bpf_mtap_ether(ifp->if_bpf, sc->fmp,
- BPF_DIRECTION_IN);
-#endif
- ether_input_mbuf(ifp, sc->fmp);
+ ml_enqueue(&ml, sc->fmp);
sc->fmp = NULL;
sc->lmp = NULL;
}
next_to_use = (sc->num_rx_desc - 1);
/* Advance the IXGB's Receive Queue #0 "Tail Pointer" */
IXGB_WRITE_REG(&sc->hw, RDT, next_to_use);
+
+ if_input(ifp, &ml);
}
/*********************************************************************
-/* $OpenBSD: if_msk.c,v 1.113 2015/03/14 03:38:48 jsg Exp $ */
+/* $OpenBSD: if_msk.c,v 1.114 2015/04/30 07:51:07 mpi Exp $ */
/*
* Copyright (c) 1997, 1998, 1999, 2000
{
struct sk_softc *sc = sc_if->sk_softc;
struct ifnet *ifp = &sc_if->arpcom.ac_if;
+ struct mbuf_list ml = MBUF_LIST_INITIALIZER();
struct mbuf *m;
struct sk_chain *cur_rx;
int i, cur, total_len = len;
return;
}
- m->m_pkthdr.rcvif = ifp;
m->m_pkthdr.len = m->m_len = total_len;
+ ml_enqueue(&ml, m);
ifp->if_ipackets++;
-#if NBPFILTER > 0
- if (ifp->if_bpf)
- bpf_mtap(ifp->if_bpf, m, BPF_DIRECTION_IN);
-#endif
-
- /* pass it on. */
- ether_input_mbuf(ifp, m);
+ if_input(ifp, &ml);
}
void
-/* $OpenBSD: if_oce.c,v 1.82 2015/03/14 03:38:48 jsg Exp $ */
+/* $OpenBSD: if_oce.c,v 1.83 2015/04/30 07:51:07 mpi Exp $ */
/*
* Copyright (c) 2012 Mike Belopuhov
struct oce_softc *sc = rq->sc;
struct oce_pkt *pkt = NULL;
struct ifnet *ifp = &sc->sc_ac.ac_if;
+ struct mbuf_list ml = MBUF_LIST_INITIALIZER();
struct mbuf *m = NULL, *tail = NULL;
int i, len, frag_len;
uint16_t vtag;
goto exit;
}
- m->m_pkthdr.rcvif = ifp;
-
#if NVLAN > 0
/* This determines if vlan tag is valid */
if (oce_vtp_valid(sc, cqe)) {
}
#endif
-#if NBPFILTER > 0
- if (ifp->if_bpf)
- bpf_mtap_ether(ifp->if_bpf, m, BPF_DIRECTION_IN);
-#endif
-
- ether_input_mbuf(ifp, m);
+ ml_enqueue(&ml, m);
}
exit:
- return;
+ if_input(ifp, &ml);
}
void
-/* $OpenBSD: if_se.c,v 1.11 2015/03/14 03:38:48 jsg Exp $ */
+/* $OpenBSD: if_se.c,v 1.12 2015/04/30 07:51:07 mpi Exp $ */
/*-
* Copyright (c) 2009, 2010 Christopher Zimmermann <madroach@zakweb.de>
se_rxeof(struct se_softc *sc)
{
struct mbuf *m;
+ struct mbuf_list ml = MBUF_LIST_INITIALIZER();
struct ifnet *ifp = &sc->sc_ac.ac_if;
struct se_list_data *ld = &sc->se_ldata;
struct se_chain_data *cd = &sc->se_cdata;
m->m_pkthdr.len = m->m_len =
SE_RX_BYTES(rxstat) - SE_RX_PAD_BYTES;
+ ml_enqueue(&ml, m);
ifp->if_ipackets++;
- m->m_pkthdr.rcvif = ifp;
-
-#if NBPFILTER > 0
- if (ifp->if_bpf)
- bpf_mtap(ifp->if_bpf, m, BPF_DIRECTION_IN);
-#endif
- ether_input_mbuf(ifp, m);
}
+ if_input(ifp, &ml);
+
cd->se_rx_prod = i;
}
-/* $OpenBSD: if_stge.c,v 1.59 2015/03/14 03:38:48 jsg Exp $ */
+/* $OpenBSD: if_stge.c,v 1.60 2015/04/30 07:51:07 mpi Exp $ */
/* $NetBSD: if_stge.c,v 1.27 2005/05/16 21:35:32 bouyer Exp $ */
/*-
struct ifnet *ifp = &sc->sc_arpcom.ac_if;
struct stge_descsoft *ds;
struct mbuf *m, *tailm;
+ struct mbuf_list ml = MBUF_LIST_INITIALIZER();
uint64_t status;
int i, len;
}
#endif
- m->m_pkthdr.rcvif = ifp;
m->m_pkthdr.len = len;
-#if NBPFILTER > 0
- /*
- * Pass this up to any BPF listeners, but only
- * pass if up the stack if it's for us.
- */
- if (ifp->if_bpf)
- bpf_mtap_ether(ifp->if_bpf, m, BPF_DIRECTION_IN);
-#endif /* NBPFILTER > 0 */
-
- /* Pass it on. */
- ether_input_mbuf(ifp, m);
+ ml_enqueue(&ml, m);
}
/* Update the receive pointer. */
sc->sc_rxptr = i;
+
+ if_input(ifp, &ml);
}
/*
-/* $OpenBSD: if_tht.c,v 1.130 2015/03/14 03:38:48 jsg Exp $ */
+/* $OpenBSD: if_tht.c,v 1.131 2015/04/30 07:51:07 mpi Exp $ */
/*
* Copyright (c) 2007 David Gwynne <dlg@openbsd.org>
struct tht_rx_desc rxd;
struct tht_pkt *pkt;
struct mbuf *m;
+ struct mbuf_list ml = MBUF_LIST_INITIALIZER();
int bc;
u_int32_t flags;
bus_dmamap_unload(dmat, dmap);
m = pkt->tp_m;
- m->m_pkthdr.rcvif = ifp;
m->m_pkthdr.len = m->m_len = letoh16(rxd.len);
/* XXX process type 3 rx descriptors */
-#if NBPFILTER > 0
- if (ifp->if_bpf)
- bpf_mtap(ifp->if_bpf, m, BPF_DIRECTION_IN);
-#endif
-
- ether_input_mbuf(ifp, m);
+ ml_enqueue(&ml, m);
tht_pkt_put(&sc->sc_rx_list, pkt);
tht_fifo_post(sc, &sc->sc_rxd);
+ if_input(ifp, &ml);
+
/* put more pkts on the fifo */
tht_rxf_fill(sc, 0);
}
-/* $OpenBSD: if_tl.c,v 1.62 2015/04/01 14:29:54 mpi Exp $ */
+/* $OpenBSD: if_tl.c,v 1.63 2015/04/30 07:51:07 mpi Exp $ */
/*
* Copyright (c) 1997, 1998
int r = 0, total_len = 0;
struct ether_header *eh;
struct mbuf *m;
+ struct mbuf_list ml = MBUF_LIST_INITIALIZER();
struct ifnet *ifp;
struct tl_chain_onefrag *cur_rx;
sc->tl_cdata.tl_rx_tail = cur_rx;
eh = mtod(m, struct ether_header *);
- m->m_pkthdr.rcvif = ifp;
/*
* Note: when the ThunderLAN chip is in 'capture all
}
m->m_pkthdr.len = m->m_len = total_len;
-#if NBPFILTER > 0
- if (ifp->if_bpf)
- bpf_mtap(ifp->if_bpf, m, BPF_DIRECTION_IN);
-#endif
- /* pass it on. */
- ether_input_mbuf(ifp, m);
+ ml_enqueue(&ml, m);
}
+ if_input(ifp, &ml);
+
return(r);
}
-/* $OpenBSD: if_txp.c,v 1.114 2015/03/14 03:38:48 jsg Exp $ */
+/* $OpenBSD: if_txp.c,v 1.115 2015/04/30 07:51:07 mpi Exp $ */
/*
* Copyright (c) 2001
struct ifnet *ifp = &sc->sc_arpcom.ac_if;
struct txp_rx_desc *rxd;
struct mbuf *m;
+ struct mbuf_list ml = MBUF_LIST_INITIALIZER();
struct txp_swdesc *sd;
u_int32_t roff, woff;
int idx;
goto next;
}
}
- mnew->m_pkthdr.rcvif = ifp;
mnew->m_pkthdr.len = mnew->m_len = m->m_len;
mnew->m_data += 2;
bcopy(m->m_data, mnew->m_data, m->m_len);
}
#endif
-#if NBPFILTER > 0
- /*
- * Handle BPF listeners. Let the BPF user see the packet.
- */
- if (ifp->if_bpf)
- bpf_mtap_ether(ifp->if_bpf, m, BPF_DIRECTION_IN);
-#endif
-
if (rxd->rx_stat & htole32(RX_STAT_IPCKSUMBAD))
sumflags |= M_IPV4_CSUM_IN_BAD;
else if (rxd->rx_stat & htole32(RX_STAT_IPCKSUMGOOD))
m->m_pkthdr.csum_flags = sumflags;
- ether_input_mbuf(ifp, m);
+ ml_enqueue(&ml, m);
next:
bus_dmamap_sync(sc->sc_dmat, dma->dma_map,
woff = letoh32(*r->r_woff);
}
+ if_input(ifp, &ml);
+
*r->r_roff = htole32(woff);
}
void
txp_rxbuf_reclaim(struct txp_softc *sc)
{
- struct ifnet *ifp = &sc->sc_arpcom.ac_if;
struct txp_hostvar *hv = sc->sc_hostvar;
struct txp_rxbuf_desc *rbd;
struct txp_swdesc *sd;
MCLGET(sd->sd_mbuf, M_DONTWAIT);
if ((sd->sd_mbuf->m_flags & M_EXT) == 0)
goto err_mbuf;
- sd->sd_mbuf->m_pkthdr.rcvif = ifp;
sd->sd_mbuf->m_pkthdr.len = sd->sd_mbuf->m_len = MCLBYTES;
if (bus_dmamap_create(sc->sc_dmat, TXP_MAX_PKTLEN, 1,
TXP_MAX_PKTLEN, 0, BUS_DMA_NOWAIT, &sd->sd_map))
int
txp_alloc_rings(struct txp_softc *sc)
{
- struct ifnet *ifp = &sc->sc_arpcom.ac_if;
struct txp_boot_record *boot;
struct txp_swdesc *sd;
u_int32_t r;
goto bail_rxbufring;
}
sd->sd_mbuf->m_pkthdr.len = sd->sd_mbuf->m_len = MCLBYTES;
- sd->sd_mbuf->m_pkthdr.rcvif = ifp;
if (bus_dmamap_create(sc->sc_dmat, TXP_MAX_PKTLEN, 1,
TXP_MAX_PKTLEN, 0, BUS_DMA_NOWAIT, &sd->sd_map)) {
goto bail_rxbufring;
-/* $OpenBSD: if_vte.c,v 1.11 2014/12/22 02:28:52 tedu Exp $ */
+/* $OpenBSD: if_vte.c,v 1.12 2015/04/30 07:51:07 mpi Exp $ */
/*-
* Copyright (c) 2010, Pyun YongHyeon <yongari@FreeBSD.org>
* All rights reserved.
struct ifnet *ifp = &sc->sc_arpcom.ac_if;
struct vte_rxdesc *rxd;
struct mbuf *m;
+ struct mbuf_list ml = MBUF_LIST_INITIALIZER();
uint16_t status, total_len;
int cons, prog;
* It seems there is no way to strip FCS bytes.
*/
m->m_pkthdr.len = m->m_len = total_len - ETHER_CRC_LEN;
- m->m_pkthdr.rcvif = ifp;
-
-#if NBPFILTER > 0
- if (ifp->if_bpf)
- bpf_mtap_ether(ifp->if_bpf, m, BPF_DIRECTION_IN);
-#endif
-
- ether_input_mbuf(ifp, m);
+ ml_enqueue(&ml, m);
}
+ if_input(ifp, &ml);
+
if (prog > 0) {
/* Update the consumer index. */
sc->vte_cdata.vte_rx_cons = cons;
-/* $OpenBSD: if_xge.c,v 1.60 2015/03/14 03:38:48 jsg Exp $ */
+/* $OpenBSD: if_xge.c,v 1.61 2015/04/30 07:51:07 mpi Exp $ */
/* $NetBSD: if_xge.c,v 1.1 2005/09/09 10:30:27 ragge Exp $ */
/*
struct xge_softc *sc = pv;
struct txd *txd;
struct ifnet *ifp = &sc->sc_arpcom.ac_if;
+ struct mbuf_list ml = MBUF_LIST_INITIALIZER();
bus_dmamap_t dmp;
uint64_t val;
int i, lasttx, plen;
plen += m->m_next->m_next->m_next->m_next->m_len =
RXD_CTL3_BUF4SIZ(rxd->rxd_control3);
#endif
- m->m_pkthdr.rcvif = ifp;
m->m_pkthdr.len = plen;
val = rxd->rxd_control1;
}
#endif
-#if NBPFILTER > 0
- if (ifp->if_bpf)
- bpf_mtap_ether(ifp->if_bpf, m, BPF_DIRECTION_IN);
-#endif /* NBPFILTER > 0 */
-
- ether_input_mbuf(ifp, m);
+ ml_enqueue(&ml, m);
if (++sc->sc_nextrx == NRXREAL)
sc->sc_nextrx = 0;
}
+ if_input(ifp, &ml);
+
return (1);
}