summaryrefslogtreecommitdiff
path: root/sys/dev/ic/hme.c
diff options
context:
space:
mode:
authorAlexander Bluhm <bluhm@cvs.openbsd.org>2011-07-05 05:25:10 +0000
committerAlexander Bluhm <bluhm@cvs.openbsd.org>2011-07-05 05:25:10 +0000
commitcdf279d1c5c1fb09d5bed3e223827e8df9771723 (patch)
tree18ab8b54a750e58048e16ac15e6b35a7616c9737 /sys/dev/ic/hme.c
parent88a0ecfe483b2d832b3719c437a54d11b49d653d (diff)
When the kernel runs out of mbuf clusters, the hme receive ring may
become empty. In that case, the hme driver could not recover as the ring was only filled after receiving data. Check and potentially fill an empty receive ring every second in hme_tick(). ok kettenis@
Diffstat (limited to 'sys/dev/ic/hme.c')
-rw-r--r--sys/dev/ic/hme.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/sys/dev/ic/hme.c b/sys/dev/ic/hme.c
index 5bea4e1002e..d4bd60608b3 100644
--- a/sys/dev/ic/hme.c
+++ b/sys/dev/ic/hme.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hme.c,v 1.61 2009/10/15 17:54:54 deraadt Exp $ */
+/* $OpenBSD: hme.c,v 1.62 2011/07/05 05:25:09 bluhm Exp $ */
/* $NetBSD: hme.c,v 1.21 2001/07/07 15:59:37 thorpej Exp $ */
/*-
@@ -362,6 +362,13 @@ hme_tick(arg)
bus_space_write_4(t, mac, HME_MACI_EXCNT, 0);
bus_space_write_4(t, mac, HME_MACI_LTCNT, 0);
+ /*
+ * If buffer allocation fails, the receive ring may become
+ * empty. There is no receive interrupt to recover from that.
+ */
+ if (sc->sc_rx_cnt == 0)
+ hme_fill_rx_ring(sc);
+
mii_tick(&sc->sc_mii);
splx(s);