diff options
author | 2002-02-08 18:53:38 +0000 | |
---|---|---|
committer | 2002-02-08 18:53:38 +0000 | |
commit | 8524f1878f8614242c0f24b24e5e68c82c12ac00 (patch) | |
tree | 18aff8fe1d72ffcbdb765c8992f4cc8b3656ce2f | |
parent | simplify qec_put a bit (diff) | |
download | wireguard-openbsd-8524f1878f8614242c0f24b24e5e68c82c12ac00.tar.xz wireguard-openbsd-8524f1878f8614242c0f24b24e5e68c82c12ac00.zip |
Better IFF_OACTIVE handling; don't bother calling qestart() unless
we were IFF_OACTIVE and we freed at least one slot.
-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); } /* |