diff options
author | David Gwynne <dlg@cvs.openbsd.org> | 2008-12-21 23:30:27 +0000 |
---|---|---|
committer | David Gwynne <dlg@cvs.openbsd.org> | 2008-12-21 23:30:27 +0000 |
commit | ed0c7a678ced3df3b2342232b067d581d506a4a6 (patch) | |
tree | 2c2c6d09b1e676d6e993f0c25966efa9ef46a77d /sys/dev | |
parent | e1803070e9f48fc53947cf4737a22e0646685cb4 (diff) |
use the RXO (rx overflow) interrupt to try to refill the rx ring. this lets
us cope if the rx ring empties completely and the hardware tells us we're
still getting packets.
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/pci/if_em.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/sys/dev/pci/if_em.c b/sys/dev/pci/if_em.c index 5921a80d0c4..3487ee459da 100644 --- a/sys/dev/pci/if_em.c +++ b/sys/dev/pci/if_em.c @@ -31,7 +31,7 @@ POSSIBILITY OF SUCH DAMAGE. ***************************************************************************/ -/* $OpenBSD: if_em.c,v 1.203 2008/12/15 02:33:04 brad Exp $ */ +/* $OpenBSD: if_em.c,v 1.204 2008/12/21 23:30:26 dlg Exp $ */ /* $FreeBSD: if_em.c,v 1.46 2004/09/29 18:28:28 mlaier Exp $ */ #include <dev/pci/if_em.h> @@ -783,6 +783,7 @@ em_intr(void *arg) struct ifnet *ifp; u_int32_t reg_icr, test_icr; int claimed = 0; + int refill; ifp = &sc->interface_data.ac_if; @@ -794,15 +795,12 @@ em_intr(void *arg) break; claimed = 1; + refill = 0; if (ifp->if_flags & IFF_RUNNING) { em_rxeof(sc, -1); - if (em_rxfill(sc)) { - /* Advance the Rx Queue #0 "Tail Pointer". */ - E1000_WRITE_REG(&sc->hw, RDT, - sc->last_rx_desc_filled); - } em_txeof(sc); + refill = 1; } /* Link status change */ @@ -814,8 +812,16 @@ em_intr(void *arg) timeout_add_sec(&sc->timer_handle, 1); } - if (reg_icr & E1000_ICR_RXO) + if (reg_icr & E1000_ICR_RXO) { sc->rx_overruns++; + ifp->if_ierrors++; + refill = 1; + } + + if (refill && em_rxfill(sc)) { + /* Advance the Rx Queue #0 "Tail Pointer". */ + E1000_WRITE_REG(&sc->hw, RDT, sc->last_rx_desc_filled); + } } if (ifp->if_flags & IFF_RUNNING && !IFQ_IS_EMPTY(&ifp->if_snd)) |