summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorjan <jan@cvs.openbsd.org>2020-05-12 08:49:55 +0000
committerjan <jan@cvs.openbsd.org>2020-05-12 08:49:55 +0000
commit3f141e0f3afaaa698ee0deff439853647b74a436 (patch)
tree114f69a03f184cd97c9aaab2b6a1183e7f0abf93 /sys/dev
parent472f2a2fee7713fe2e735fde4714506481a6cc26 (diff)
Set timeout(9) to refill the receive ring descriptors if the amount of
descriptors runs below the low watermark. The em(4) firmware seems not to work properly with just a few descriptors in the receive ring. Thus, we use the low water mark as an indicator instead of zero descriptors, which causes deadlocks. ok kettenis@
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/pci/if_em.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/pci/if_em.c b/sys/dev/pci/if_em.c
index 18d478c01aa..48b040819b5 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.351 2020/04/26 20:49:56 patrick Exp $ */
+/* $OpenBSD: if_em.c,v 1.352 2020/05/12 08:49:54 jan Exp $ */
/* $FreeBSD: if_em.c,v 1.46 2004/09/29 18:28:28 mlaier Exp $ */
#include <dev/pci/if_em.h>
@@ -2833,7 +2833,7 @@ em_rxrefill(void *arg)
if (em_rxfill(que))
E1000_WRITE_REG(&sc->hw, RDT(que->me), que->rx.sc_rx_desc_head);
- else if (if_rxr_inuse(&que->rx.sc_rx_ring) == 0)
+ else if (if_rxr_needrefill(&que->rx.sc_rx_ring))
timeout_add(&que->rx_refill, 1);
}