summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormikeb <mikeb@openbsd.org>2012-05-14 10:14:44 +0000
committermikeb <mikeb@openbsd.org>2012-05-14 10:14:44 +0000
commit5dfaf73770a79603ed5099b4f649d811b9150ba2 (patch)
tree76955f7ddd55f49f951d9cb9b93ea54aa468fea2
parentansi. no binary change (diff)
downloadwireguard-openbsd-5dfaf73770a79603ed5099b4f649d811b9150ba2.tar.xz
wireguard-openbsd-5dfaf73770a79603ed5099b4f649d811b9150ba2.zip
trigger tx start routine when link goes up to prevent a lockup
situation when send queue is full and no rx interrupt happen. initial diff and tests by erik lax, <erik at halon.se>, ok jsg
-rw-r--r--sys/dev/pci/if_em.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/dev/pci/if_em.c b/sys/dev/pci/if_em.c
index 35f9d414280..b3b2f4bc48b 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.262 2012/02/15 04:06:27 jsg Exp $ */
+/* $OpenBSD: if_em.c,v 1.263 2012/05/14 10:14:44 mikeb Exp $ */
/* $FreeBSD: if_em.c,v 1.46 2004/09/29 18:28:28 mlaier Exp $ */
#include <dev/pci/if_em.h>
@@ -877,9 +877,6 @@ em_intr(void *arg)
if (ifp->if_flags & IFF_RUNNING) {
em_rxeof(sc, -1);
em_txeof(sc);
- if (!IFQ_IS_EMPTY(&ifp->if_snd))
- em_start(ifp);
-
refill = 1;
}
@@ -897,6 +894,9 @@ em_intr(void *arg)
refill = 1;
}
+ if (ifp->if_flags & IFF_RUNNING && !IFQ_IS_EMPTY(&ifp->if_snd))
+ em_start(ifp);
+
if (refill && em_rxfill(sc)) {
/* Advance the Rx Queue #0 "Tail Pointer". */
E1000_WRITE_REG(&sc->hw, RDT, sc->last_rx_desc_filled);