From 421aaa40919c6b536184b0802dc924d9f48ea371 Mon Sep 17 00:00:00 2001 From: Sepherosa Ziehau Date: Wed, 15 Aug 2012 07:16:27 +0800 Subject: [PATCH] bge: Don't peek at the TX descriptor in txeof() --- sys/dev/netif/bge/if_bge.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/sys/dev/netif/bge/if_bge.c b/sys/dev/netif/bge/if_bge.c index 0146487257..c0ed8973c6 100644 --- a/sys/dev/netif/bge/if_bge.c +++ b/sys/dev/netif/bge/if_bge.c @@ -3007,7 +3007,6 @@ bge_rxeof(struct bge_softc *sc, uint16_t rx_prod) static void bge_txeof(struct bge_softc *sc, uint16_t tx_cons) { - struct bge_tx_bd *cur_tx = NULL; struct ifnet *ifp; ifp = &sc->arpcom.ac_if; @@ -3020,10 +3019,8 @@ bge_txeof(struct bge_softc *sc, uint16_t tx_cons) uint32_t idx = 0; idx = sc->bge_tx_saved_considx; - cur_tx = &sc->bge_ldata.bge_tx_ring[idx]; - if (cur_tx->bge_flags & BGE_TXBDFLAG_END) - ifp->if_opackets++; if (sc->bge_cdata.bge_tx_chain[idx] != NULL) { + ifp->if_opackets++; bus_dmamap_unload(sc->bge_cdata.bge_tx_mtag, sc->bge_cdata.bge_tx_dmamap[idx]); m_freem(sc->bge_cdata.bge_tx_chain[idx]); @@ -3034,8 +3031,7 @@ bge_txeof(struct bge_softc *sc, uint16_t tx_cons) logif(tx_pkt); } - if (cur_tx != NULL && - (BGE_TX_RING_CNT - sc->bge_txcnt) >= + if ((BGE_TX_RING_CNT - sc->bge_txcnt) >= (sc->bge_txrsvd + sc->bge_txspare)) ifp->if_flags &= ~IFF_OACTIVE; -- 2.41.0