From bd387a07df4c06121424f739b948b8d45ea36c3f Mon Sep 17 00:00:00 2001 From: Jason Wright Date: Fri, 8 Feb 2002 19:05:26 +0000 Subject: Better tx interrupt handling; don't call bestart() from betint() unless we're OACTIVE and cleared at least one slot --- sys/arch/sparc/dev/be.c | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) (limited to 'sys/arch/sparc/dev/be.c') 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); } /* -- cgit v1.2.3