commit b0d511c385715d4f80b91179e41089e00c295cdf Author: Ryota Ozaki Date: Wed Dec 7 13:26:58 2016 +0900 Move bpf_mtap in txintr to if_start diff --git a/sys/dev/ic/sgec.c b/sys/dev/ic/sgec.c index 670ff07..5a54011 100644 --- a/sys/dev/ic/sgec.c +++ b/sys/dev/ic/sgec.c @@ -421,6 +421,8 @@ zestart(struct ifnet *ifp) if ((ZE_RCSR(ZE_CSR5) & ZE_NICSR5_TS) != ZE_NICSR5_TS_RUN) ZE_WCSR(ZE_CSR1, -1); sc->sc_nexttx = nexttx; + + bpf_mtap(ifp, m); } if (sc->sc_inq == (TXDESCS - 1)) ifp->if_flags |= IFF_OACTIVE; @@ -504,7 +506,6 @@ sgec_intr(struct ze_softc *sc) ifp->if_opackets++; bus_dmamap_unload(sc->sc_dmat, map); KASSERT(sc->sc_txmbuf[lastack]); - bpf_mtap(ifp, sc->sc_txmbuf[lastack]); m_freem(sc->sc_txmbuf[lastack]); sc->sc_txmbuf[lastack] = 0; if (++lastack == TXDESCS) diff --git a/sys/dev/pci/if_de.c b/sys/dev/pci/if_de.c index e97b4fe..3f91b8b 100644 --- a/sys/dev/pci/if_de.c +++ b/sys/dev/pci/if_de.c @@ -3894,8 +3894,6 @@ tulip_tx_intr( TULIP_TXMAP_POSTSYNC(sc, map); tulip_free_txmap(sc, map); #endif /* TULIP_BUS_DMA */ - if (sc->tulip_bpf != NULL) - bpf_mtap(&sc->tulip_if, m); m_freem(m); #if defined(TULIP_DEBUG) } else { @@ -4548,6 +4546,8 @@ tulip_txput( } while ((m0 = m0->m_next) != NULL); #endif /* TULIP_BUS_DMA */ + if (sc->tulip_bpf != NULL) + bpf_mtap(&sc->tulip_if, m); /* * The descriptors have been filled in. Now get ready * to transmit.