summaryrefslogtreecommitdiffstats
path: root/sys/dev/nve
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2006-05-18 23:19:44 +0000
committerjhb <jhb@FreeBSD.org>2006-05-18 23:19:44 +0000
commit0c235a1ed089c04da60996b550032ddc98d5d410 (patch)
tree2e3900cafd857e7974c6d5eb8555ab87d47d1c32 /sys/dev/nve
parent703043e7e1773ce68893d426497319d6abeac98a (diff)
downloadFreeBSD-src-0c235a1ed089c04da60996b550032ddc98d5d410.zip
FreeBSD-src-0c235a1ed089c04da60996b550032ddc98d5d410.tar.gz
- When setting up a packet for transmit, if we the tx ring is over half
full, kick the binary blob to force it to complete any pending tx completions. - In the watchdog routine, only reset the chip if the blob doesn't complete any pending tx completions rather than requiring it to complete all of the pending tx completions. Submitted by: Nathan Whitehorn <nathanw@uchicago.edu> MFC after: 2 weeks
Diffstat (limited to 'sys/dev/nve')
-rw-r--r--sys/dev/nve/if_nve.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/sys/dev/nve/if_nve.c b/sys/dev/nve/if_nve.c
index 73b9aea..2f26a98 100644
--- a/sys/dev/nve/if_nve.c
+++ b/sys/dev/nve/if_nve.c
@@ -872,6 +872,17 @@ nve_ifstart_locked(struct ifnet *ifp)
if (m0 == NULL)
return;
+ /*
+ * On nForce4, the chip doesn't interrupt on transmit,
+ * so try to flush transmitted packets from the queue
+ * if it's getting large (see note in nve_watchdog).
+ */
+ if (sc->pending_txs > TX_RING_SIZE/2) {
+ sc->hwapi->pfnDisableInterrupts(sc->hwapi->pADCX);
+ sc->hwapi->pfnHandleInterrupt(sc->hwapi->pADCX);
+ sc->hwapi->pfnEnableInterrupts(sc->hwapi->pADCX);
+ }
+
/* Map MBUF for DMA access */
error = bus_dmamap_load_mbuf(sc->mtag, buf->map, m0,
nve_dmamap_tx_cb, desc, BUS_DMA_NOWAIT);
@@ -1275,6 +1286,7 @@ static void
nve_watchdog(struct ifnet *ifp)
{
struct nve_softc *sc = ifp->if_softc;
+ int pending_txs_start;
NVE_LOCK(sc);
@@ -1283,14 +1295,16 @@ nve_watchdog(struct ifnet *ifp)
* Thus, sometimes the watchdog timer will go off when the
* tx engine is fine, but the tx completions are just deferred.
* Try kicking the driver blob to clear out any pending tx
- * completions. If that clears up all the pending tx
+ * completions. If that clears up any of the pending tx
* operations, then just return without printing the warning
- * message or resetting the adapter.
+ * message or resetting the adapter, as we can then conclude
+ * the chip hasn't actually crashed (it's still sending packets).
*/
+ pending_txs_start = sc->pending_txs;
sc->hwapi->pfnDisableInterrupts(sc->hwapi->pADCX);
sc->hwapi->pfnHandleInterrupt(sc->hwapi->pADCX);
sc->hwapi->pfnEnableInterrupts(sc->hwapi->pADCX);
- if (sc->pending_txs == 0) {
+ if (sc->pending_txs < pending_txs_start) {
NVE_UNLOCK(sc);
return;
}
OpenPOWER on IntegriCloud