summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrad Smith <brad@cvs.openbsd.org>2006-09-17 21:35:59 +0000
committerBrad Smith <brad@cvs.openbsd.org>2006-09-17 21:35:59 +0000
commit8a6c7c27b2652bb5e0837e8e5e4d03b7b4fe41bd (patch)
tree13c109196a7bd272226c26193edd7266dfb6a66b
parent76008af14929770082a9ce88ffea788da2c3266f (diff)
Try to reclaim the TX descriptors in the watchdog handler before actually
issuing a watchdog reset of the interface. From yongari@FreeBSD
-rw-r--r--sys/dev/pci/if_em.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/sys/dev/pci/if_em.c b/sys/dev/pci/if_em.c
index e08be39ead7..41704fa5e2b 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.148 2006/09/17 20:26:14 brad Exp $ */
+/* $OpenBSD: if_em.c,v 1.149 2006/09/17 21:35:58 brad Exp $ */
/* $FreeBSD: if_em.c,v 1.46 2004/09/29 18:28:28 mlaier Exp $ */
#include <dev/pci/if_em.h>
@@ -588,6 +588,14 @@ em_watchdog(struct ifnet *ifp)
return;
}
+ /*
+ * Reclaim first as there is a possibility of losing Tx completion
+ * interrupts.
+ */
+ em_txeof(sc);
+ if (sc->num_tx_desc_avail == sc->num_tx_desc)
+ return;
+
printf("%s: watchdog timeout -- resetting\n", sc->sc_dv.dv_xname);
em_init(sc);