Index: netisr.c
===================================================================
RCS file: /home/ncvs/src/sys/net/netisr.c,v
retrieving revision 1.4
diff -u -r1.4 netisr.c
--- netisr.c	1 Oct 2003 21:31:09 -0000	1.4
+++ netisr.c	1 Oct 2003 22:11:04 -0000
@@ -118,8 +118,6 @@
     &isrstat.isrs_directed, 0, "");
 SYSCTL_INT(_net_isr, OID_AUTO, deferred, CTLFLAG_RD, 
     &isrstat.isrs_deferred, 0, "");
-SYSCTL_INT(_net_isr, OID_AUTO, bypassed, CTLFLAG_RD, 
-    &isrstat.isrs_bypassed, 0, "");
 SYSCTL_INT(_net_isr, OID_AUTO, queued, CTLFLAG_RD, 
     &isrstat.isrs_queued, 0, "");
 SYSCTL_INT(_net_isr, OID_AUTO, swi_count, CTLFLAG_RD, 
@@ -141,7 +139,8 @@
 netisr_dispatch(int num, struct mbuf *m)
 {
 	struct netisr *ni;
-	
+	int defer;
+
 	isrstat.isrs_count++;
 	KASSERT(!(num < 0 || num >= (sizeof(netisrs)/sizeof(*netisrs))),
 	    ("bad isr %d", num));
@@ -151,7 +150,6 @@
 		return;
 	}
 	if (netisr_enable && mtx_trylock(&netisr_mtx)) {
-		isrstat.isrs_directed++;
 		/*
 		 * One slight problem here is that packets might bypass
 		 * each other in the stack, if an earlier one happened
@@ -162,12 +160,20 @@
 		 *	b. fallback to queueing the packet,
 		 *	c. sweep the issue under the rug and ignore it.
 		 *
-		 * Currently, we do c), and keep a rough event counter.
+		 * Currently, we do b), at the cost of having grabbed a
+		 * mutex one additional time.
 		 */
-		if (_IF_QLEN(ni->ni_queue) > 0)
-			isrstat.isrs_bypassed++;
-		ni->ni_handler(m);
+		defer = 0;
+		if (_IF_QLEN(ni->ni_queue) > 0) {
+			isrstat.isrs_deferred++;
+			defer = 1;
+		} else {
+			isrstat.isrs_directed++;
+			ni->ni_handler(m);
+		}
 		mtx_unlock(&netisr_mtx);
+		if (defer && IF_HANDOFF(ni->ni_queue, m, NULL))
+			schednetisr(num);
 	} else {
 		isrstat.isrs_deferred++;
 		if (IF_HANDOFF(ni->ni_queue, m, NULL))
