summaryrefslogtreecommitdiff
path: root/sys/arch/sparc/dev/be.c
diff options
context:
space:
mode:
authorJason Wright <jason@cvs.openbsd.org>2002-02-08 19:05:26 +0000
committerJason Wright <jason@cvs.openbsd.org>2002-02-08 19:05:26 +0000
commitbd387a07df4c06121424f739b948b8d45ea36c3f (patch)
treec8089ff0e4d5adac9bfe66f12c13f02ba57701d6 /sys/arch/sparc/dev/be.c
parent44f62621594155349e2c2a58499258202d8f2ef2 (diff)
Better tx interrupt handling; don't call bestart() from betint() unless
we're OACTIVE and cleared at least one slot
Diffstat (limited to 'sys/arch/sparc/dev/be.c')
-rw-r--r--sys/arch/sparc/dev/be.c25
1 files changed, 17 insertions, 8 deletions
diff --git a/sys/arch/sparc/dev/be.c b/sys/arch/sparc/dev/be.c
index d703eca4708..8487b6f0f91 100644
--- a/sys/arch/sparc/dev/be.c
+++ b/sys/arch/sparc/dev/be.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: be.c,v 1.29 2001/11/27 02:47:49 jason Exp $ */
+/* $OpenBSD: be.c,v 1.30 2002/02/08 19:05:25 jason Exp $ */
/*
* Copyright (c) 1998 Theo de Raadt and Jason L. Wright.
@@ -258,10 +258,12 @@ bestart(ifp)
bix = sc->sc_last_td;
for (;;) {
- IFQ_DEQUEUE(&ifp->if_snd, m);
+ IFQ_POLL(&ifp->if_snd, m);
if (m == NULL)
break;
+ IFQ_DEQUEUE(&ifp->if_snd, m);
+
#if NBPFILTER > 0
/*
* If BPF is listening on this interface, let it see the
@@ -454,7 +456,6 @@ betint(sc)
if (txd.tx_flags & BE_TXD_OWN)
break;
- ifp->if_flags &= ~IFF_OACTIVE;
ifp->if_opackets++;
if (++bix == BE_TX_RING_MAXSIZE)
@@ -463,14 +464,22 @@ betint(sc)
--sc->sc_no_td;
}
- sc->sc_first_td = bix;
-
- bestart(ifp);
-
if (sc->sc_no_td == 0)
ifp->if_timer = 0;
- return 1;
+ /*
+ * If we freed up at least one descriptor and tx is blocked,
+ * unblock it and start it up again.
+ */
+ if (sc->sc_first_td != bix) {
+ sc->sc_first_td = bix;
+ if (ifp->if_flags & IFF_OACTIVE) {
+ ifp->if_flags &= ~IFF_OACTIVE;
+ bestart(ifp);
+ }
+ }
+
+ return (1);
}
/*