From 9a103adf072478ab5bbe2fe721aeaa22bc2f9fc3 Mon Sep 17 00:00:00 2001 From: Sepherosa Ziehau Date: Tue, 14 Aug 2012 17:27:24 +0800 Subject: [PATCH] bnx: Don't peek at the TX descriptor in txeof() Which is completely unnecessary and pollute cache badly. --- sys/dev/netif/bnx/if_bnx.c | 8 ++------ 1 files changed, 2 insertions(+), 6 deletions(-) diff --git a/sys/dev/netif/bnx/if_bnx.c b/sys/dev/netif/bnx/if_bnx.c index d049476..d0ac885 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; -- 1.7.7.2