Module Name:    src
Committed By:   thorpej
Date:           Thu Mar 19 02:58:54 UTC 2020

Modified Files:
        src/sys/dev/sbus: be.c qe.c

Log Message:
Don't bother with IFF_OACTIVE.  Just keep processing so long as
sc->sc_rb.rb_td_nbusy is less than sc->sc_rb.rb_ntbuf.


To generate a diff of this commit:
cvs rdiff -u -r1.95 -r1.96 src/sys/dev/sbus/be.c
cvs rdiff -u -r1.76 -r1.77 src/sys/dev/sbus/qe.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/sbus/be.c
diff -u src/sys/dev/sbus/be.c:1.95 src/sys/dev/sbus/be.c:1.96
--- src/sys/dev/sbus/be.c:1.95	Wed Jan 29 05:59:06 2020
+++ src/sys/dev/sbus/be.c	Thu Mar 19 02:58:54 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: be.c,v 1.95 2020/01/29 05:59:06 thorpej Exp $	*/
+/*	$NetBSD: be.c,v 1.96 2020/03/19 02:58:54 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -57,7 +57,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: be.c,v 1.95 2020/01/29 05:59:06 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: be.c,v 1.96 2020/03/19 02:58:54 thorpej Exp $");
 
 #include "opt_ddb.h"
 #include "opt_inet.h"
@@ -569,12 +569,10 @@ be_read(struct be_softc *sc, int idx, in
 
 /*
  * Start output on interface.
- * We make two assumptions here:
+ * We make an assumption here:
  *  1) that the current priority is set to splnet _before_ this code
  *     is called *and* is returned to the appropriate priority after
  *     return
- *  2) that the IFF_OACTIVE flag is checked before this code is called
- *     (i.e. that the output part of the interface is idle)
  */
 void
 bestart(struct ifnet *ifp)
@@ -585,12 +583,12 @@ bestart(struct ifnet *ifp)
 	unsigned int bix, len;
 	unsigned int ntbuf = sc->sc_rb.rb_ntbuf;
 
-	if ((ifp->if_flags & (IFF_RUNNING | IFF_OACTIVE)) != IFF_RUNNING)
+	if ((ifp->if_flags & IFF_RUNNING) != IFF_RUNNING)
 		return;
 
 	bix = sc->sc_rb.rb_tdhead;
 
-	for (;;) {
+	while (sc->sc_rb.rb_td_nbusy < ntbuf) {
 		IFQ_DEQUEUE(&ifp->if_snd, m);
 		if (m == 0)
 			break;
@@ -617,10 +615,7 @@ bestart(struct ifnet *ifp)
 		if (++bix == QEC_XD_RING_MAXSIZE)
 			bix = 0;
 
-		if (++sc->sc_rb.rb_td_nbusy == ntbuf) {
-			ifp->if_flags |= IFF_OACTIVE;
-			break;
-		}
+		sc->sc_rb.rb_td_nbusy++;
 	}
 
 	sc->sc_rb.rb_tdhead = bix;
@@ -875,7 +870,6 @@ betint(struct be_softc *sc)
 		if (txflags & QEC_XD_OWN)
 			break;
 
-		ifp->if_flags &= ~IFF_OACTIVE;
 		if_statinc(ifp, if_opackets);
 
 		if (++bix == QEC_XD_RING_MAXSIZE)
@@ -1108,7 +1102,6 @@ beinit(struct ifnet *ifp)
 		goto out;
 
 	ifp->if_flags |= IFF_RUNNING;
-	ifp->if_flags &= ~IFF_OACTIVE;
 
 	callout_reset(&sc->sc_tick_ch, hz, be_tick, sc);
 

Index: src/sys/dev/sbus/qe.c
diff -u src/sys/dev/sbus/qe.c:1.76 src/sys/dev/sbus/qe.c:1.77
--- src/sys/dev/sbus/qe.c:1.76	Wed Jan 29 05:59:06 2020
+++ src/sys/dev/sbus/qe.c	Thu Mar 19 02:58:54 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: qe.c,v 1.76 2020/01/29 05:59:06 thorpej Exp $	*/
+/*	$NetBSD: qe.c,v 1.77 2020/03/19 02:58:54 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: qe.c,v 1.76 2020/01/29 05:59:06 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: qe.c,v 1.77 2020/03/19 02:58:54 thorpej Exp $");
 
 #define QEDEBUG
 
@@ -425,12 +425,10 @@ qe_read(struct qe_softc *sc, int idx, in
 
 /*
  * Start output on interface.
- * We make two assumptions here:
+ * We make an assumption here:
  *  1) that the current priority is set to splnet _before_ this code
  *     is called *and* is returned to the appropriate priority after
  *     return
- *  2) that the IFF_OACTIVE flag is checked before this code is called
- *     (i.e. that the output part of the interface is idle)
  */
 void
 qestart(struct ifnet *ifp)
@@ -441,12 +439,12 @@ qestart(struct ifnet *ifp)
 	unsigned int bix, len;
 	unsigned int ntbuf = sc->sc_rb.rb_ntbuf;
 
-	if ((ifp->if_flags & (IFF_RUNNING | IFF_OACTIVE)) != IFF_RUNNING)
+	if ((ifp->if_flags & IFF_RUNNING) != IFF_RUNNING)
 		return;
 
 	bix = sc->sc_rb.rb_tdhead;
 
-	for (;;) {
+	while (sc->sc_rb.rb_td_nbusy < ntbuf) {
 		IFQ_DEQUEUE(&ifp->if_snd, m);
 		if (m == 0)
 			break;
@@ -473,10 +471,7 @@ qestart(struct ifnet *ifp)
 		if (++bix == QEC_XD_RING_MAXSIZE)
 			bix = 0;
 
-		if (++sc->sc_rb.rb_td_nbusy == ntbuf) {
-			ifp->if_flags |= IFF_OACTIVE;
-			break;
-		}
+		sc->sc_rb.rb_td_nbusy++;
 	}
 
 	sc->sc_rb.rb_tdhead = bix;
@@ -626,7 +621,6 @@ qe_tint(struct qe_softc *sc)
 		if (txflags & QEC_XD_OWN)
 			break;
 
-		ifp->if_flags &= ~IFF_OACTIVE;
 		if_statinc(ifp, if_opackets);
 
 		if (++bix == QEC_XD_RING_MAXSIZE)
@@ -1046,7 +1040,6 @@ qeinit(struct qe_softc *sc)
 	qe_mcreset(sc);
 
 	ifp->if_flags |= IFF_RUNNING;
-	ifp->if_flags &= ~IFF_OACTIVE;
 	splx(s);
 }
 

Reply via email to