From ba227e0edecf8fda3b253e2bbd07a1122d1ad4a2 Mon Sep 17 00:00:00 2001 From: mpi Date: Fri, 15 May 2015 11:36:30 +0000 Subject: [PATCH] Convert to if_input(). ok dlg@ --- sys/dev/pci/if_de.c | 28 +++++++--------------------- sys/dev/pci/if_ste.c | 15 +++++---------- 2 files changed, 12 insertions(+), 31 deletions(-) diff --git a/sys/dev/pci/if_de.c b/sys/dev/pci/if_de.c index 3d0236d767e..bfc8d8e4260 100644 --- a/sys/dev/pci/if_de.c +++ b/sys/dev/pci/if_de.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_de.c,v 1.119 2015/04/01 13:35:32 mpi Exp $ */ +/* $OpenBSD: if_de.c,v 1.120 2015/05/15 11:36:30 mpi Exp $ */ /* $NetBSD: if_de.c,v 1.58 1998/01/12 09:39:58 thorpej Exp $ */ /*- @@ -3180,6 +3180,7 @@ tulip_rx_intr(tulip_softc_t * const sc) TULIP_PERFSTART(rxintr) tulip_ringinfo_t * const ri = &sc->tulip_rxinfo; struct ifnet * const ifp = &sc->tulip_if; + struct mbuf_list ml = MBUF_LIST_INITIALIZER(); int fillok = 1; #if defined(TULIP_DEBUG) int cnt = 0; @@ -3236,13 +3237,8 @@ tulip_rx_intr(tulip_softc_t * const sc) eop = ri->ri_first; TULIP_RXDESC_POSTSYNC(sc, eop, sizeof(*eop)); if (eop == ri->ri_nextout || ((((volatile tulip_desc_t *) eop)->d_status & TULIP_DSTS_OWNER))) { -#if defined(TULIP_DEBUG) - sc->tulip_dbg.dbg_rxintrs++; - sc->tulip_dbg.dbg_rxpktsperintr[cnt]++; -#endif TULIP_PERFEND(rxget); - TULIP_PERFEND(rxintr); - return; + goto out; } total_len++; } @@ -3289,16 +3285,6 @@ tulip_rx_intr(tulip_softc_t * const sc) #if defined(DIAGNOSTIC) TULIP_SETCTX(me, NULL); #endif - -#if NBPFILTER > 0 - if (sc->tulip_bpf != NULL) { - if (me == ms) { - bpf_tap(sc->tulip_if.if_bpf, mtod(ms, caddr_t), - total_len, BPF_DIRECTION_IN); - } else - bpf_mtap(sc->tulip_if.if_bpf, ms, BPF_DIRECTION_IN); - } -#endif sc->tulip_flags |= TULIP_RXACT; accept = 1; } else { @@ -3382,14 +3368,12 @@ tulip_rx_intr(tulip_softc_t * const sc) ) { #if !defined(TULIP_COPY_RXDATA) ms->m_pkthdr.len = total_len; - ms->m_pkthdr.rcvif = ifp; - ether_input_mbuf(ifp, ms); + ml_enqueue(&ml, ms); #else m0->m_data += 2; /* align data after header */ m_copydata(ms, 0, total_len, mtod(m0, caddr_t)); m0->m_len = m0->m_pkthdr.len = total_len; - m0->m_pkthdr.rcvif = ifp; - ether_input_mbuf(ifp, m0); + ml_enqueue(&ml, m0); m0 = ms; #endif } @@ -3455,6 +3439,8 @@ tulip_rx_intr(tulip_softc_t * const sc) sc->tulip_flags &= ~TULIP_RXBUFSLOW; TULIP_PERFEND(rxget); } +out: + if_input(ifp, &ml); #if defined(TULIP_DEBUG) sc->tulip_dbg.dbg_rxintrs++; diff --git a/sys/dev/pci/if_ste.c b/sys/dev/pci/if_ste.c index dea76c52e97..e3177f6e6ac 100644 --- a/sys/dev/pci/if_ste.c +++ b/sys/dev/pci/if_ste.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ste.c,v 1.57 2014/12/22 02:28:52 tedu Exp $ */ +/* $OpenBSD: if_ste.c,v 1.58 2015/05/15 11:36:31 mpi Exp $ */ /* * Copyright (c) 1997, 1998, 1999 * Bill Paul . All rights reserved. @@ -628,6 +628,7 @@ void ste_rxeof(struct ste_softc *sc) { struct mbuf *m; + struct mbuf_list ml = MBUF_LIST_INITIALIZER(); struct ifnet *ifp; struct ste_chain_onefrag *cur_rx; int total_len = 0, count=0; @@ -685,22 +686,16 @@ ste_rxeof(struct ste_softc *sc) continue; } - 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); - cur_rx->ste_ptr->ste_status = 0; count++; } + + if_input(ifp, &ml); } void -- 2.20.1