From 5654aca76d77a9076184cfdef233e02795f315eb Mon Sep 17 00:00:00 2001 From: Brad Smith Date: Fri, 7 Nov 2008 18:12:23 +0000 Subject: Try recollecting RX/TX descriptors if we are going to switch back to TX/RX interrupts. There seems to be a race between turning on TX/RX interrupt and asserting TX/RX interrupt by the hardware. From Sephe@DragonFly --- sys/dev/ic/re.c | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) (limited to 'sys/dev/ic/re.c') diff --git a/sys/dev/ic/re.c b/sys/dev/ic/re.c index 5a4cd7b5d28..e444f0efa0e 100644 --- a/sys/dev/ic/re.c +++ b/sys/dev/ic/re.c @@ -1,4 +1,4 @@ -/* $OpenBSD: re.c,v 1.96 2008/10/16 19:18:03 naddy Exp $ */ +/* $OpenBSD: re.c,v 1.97 2008/11/07 18:12:22 brad Exp $ */ /* $FreeBSD: if_re.c,v 1.31 2004/09/04 07:54:05 ru Exp $ */ /* * Copyright (c) 1997, 1998-2003 @@ -1627,12 +1627,30 @@ re_intr(void *arg) if (sc->rl_imtype == RL_IMTYPE_SIM) { if ((sc->rl_flags & RL_FLAG_TIMERINTR)) { - if ((tx | rx) == 0) + if ((tx | rx) == 0) { + /* + * Nothing needs to be processed, fallback + * to use TX/RX interrupts. + */ re_setup_intr(sc, 1, RL_IMTYPE_NONE); - else + + /* + * Recollect, mainly to avoid the possible + * race introduced by changing interrupt + * masks. + */ + re_rxeof(sc); + tx = re_txeof(sc); + } else CSR_WRITE_4(sc, RL_TIMERCNT, 1); /* reload */ - } else if (tx | rx) + } else if (tx | rx) { + /* + * Assume that using simulated interrupt moderation + * (hardware timer based) could reduce the interrupt + * rate. + */ re_setup_intr(sc, 1, RL_IMTYPE_SIM); + } } if (tx && !IFQ_IS_EMPTY(&ifp->if_snd)) -- cgit v1.2.3