diff options
author | Jason Wright <jason@cvs.openbsd.org> | 2002-02-08 18:53:39 +0000 |
---|---|---|
committer | Jason Wright <jason@cvs.openbsd.org> | 2002-02-08 18:53:39 +0000 |
commit | 06c1991064763f20b4572a7f41063af21db661c8 (patch) | |
tree | e386b4b61cf92eb14670de04acf7d5cd09e9891e /sys/arch | |
parent | d0f0dfcdf0aaa906de6df3d70438ac6ab0a9688f (diff) |
Better IFF_OACTIVE handling; don't bother calling qestart() unless
we were IFF_OACTIVE and we freed at least one slot.
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/sparc/dev/qe.c | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/sys/arch/sparc/dev/qe.c b/sys/arch/sparc/dev/qe.c index 489a414dd72..c0e2088f4a5 100644 --- a/sys/arch/sparc/dev/qe.c +++ b/sys/arch/sparc/dev/qe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: qe.c,v 1.18 2002/01/01 21:39:42 jason Exp $ */ +/* $OpenBSD: qe.c,v 1.19 2002/02/08 18:53:38 jason Exp $ */ /* * Copyright (c) 1998, 2000 Jason L. Wright. @@ -209,10 +209,12 @@ qestart(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 @@ -325,7 +327,7 @@ qeintr(v) if (qestat & QE_CR_STAT_RXIRQ) r |= qe_rint(sc); - return r; + return (1); } /* @@ -349,7 +351,6 @@ qe_tint(sc) if (txd.tx_flags & QE_TXD_OWN) break; - ifp->if_flags &= ~IFF_OACTIVE; ifp->if_opackets++; if (++bix == QE_TX_RING_MAXSIZE) @@ -358,14 +359,21 @@ qe_tint(sc) --sc->sc_no_td; } - sc->sc_first_td = bix; - - qestart(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) && (ifp->if_flags & IFF_OACTIVE)) { + ifp->if_flags &= ~IFF_OACTIVE; + qestart(ifp); + } + + sc->sc_first_td = bix; + + return (1); } /* |