From: Sepherosa Ziehau Date: Tue, 14 Aug 2012 09:27:24 +0000 (+0800) Subject: bnx: Don't peek at the TX descriptor in txeof() X-Git-Tag: v3.2.0~401 X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/9a103adf072478ab5bbe2fe721aeaa22bc2f9fc3?ds=sidebyside bnx: Don't peek at the TX descriptor in txeof() Which is completely unnecessary and pollute cache badly. --- diff --git a/sys/dev/netif/bnx/if_bnx.c b/sys/dev/netif/bnx/if_bnx.c index d0494760d4..d0ac885b85 100644 --- a/sys/dev/netif/bnx/if_bnx.c +++ b/sys/dev/netif/bnx/if_bnx.c @@ -2584,7 +2584,6 @@ bnx_rxeof(struct bnx_softc *sc, uint16_t rx_prod) static void bnx_txeof(struct bnx_softc *sc, uint16_t tx_cons) { - struct bge_tx_bd *cur_tx = NULL; struct ifnet *ifp; ifp = &sc->arpcom.ac_if; @@ -2597,10 +2596,8 @@ bnx_txeof(struct bnx_softc *sc, uint16_t tx_cons) uint32_t idx = 0; idx = sc->bnx_tx_saved_considx; - cur_tx = &sc->bnx_ldata.bnx_tx_ring[idx]; - if (cur_tx->bge_flags & BGE_TXBDFLAG_END) - ifp->if_opackets++; if (sc->bnx_cdata.bnx_tx_chain[idx] != NULL) { + ifp->if_opackets++; bus_dmamap_unload(sc->bnx_cdata.bnx_tx_mtag, sc->bnx_cdata.bnx_tx_dmamap[idx]); m_freem(sc->bnx_cdata.bnx_tx_chain[idx]); @@ -2610,8 +2607,7 @@ bnx_txeof(struct bnx_softc *sc, uint16_t tx_cons) BNX_INC(sc->bnx_tx_saved_considx, BGE_TX_RING_CNT); } - if (cur_tx != NULL && - (BGE_TX_RING_CNT - sc->bnx_txcnt) >= + if ((BGE_TX_RING_CNT - sc->bnx_txcnt) >= (BNX_NSEG_RSVD + BNX_NSEG_SPARE)) ifp->if_flags &= ~IFF_OACTIVE;