Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/sbus Don't bother with IFF_OACTIVE. Just keep proce...



details:   https://anonhg.NetBSD.org/src/rev/701257b9a5af
branches:  trunk
changeset: 970283:701257b9a5af
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Thu Mar 19 02:58:54 2020 +0000

description:
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.

diffstat:

 sys/dev/sbus/be.c |  19 ++++++-------------
 sys/dev/sbus/qe.c |  19 ++++++-------------
 2 files changed, 12 insertions(+), 26 deletions(-)

diffs (150 lines):

diff -r fcfa8bba0d9e -r 701257b9a5af sys/dev/sbus/be.c
--- a/sys/dev/sbus/be.c Thu Mar 19 02:31:28 2020 +0000
+++ b/sys/dev/sbus/be.c Thu Mar 19 02:58:54 2020 +0000
@@ -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 @@
 
 /*
  * 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 @@
        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 @@
                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 @@
                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 @@
                goto out;
 
        ifp->if_flags |= IFF_RUNNING;
-       ifp->if_flags &= ~IFF_OACTIVE;
 
        callout_reset(&sc->sc_tick_ch, hz, be_tick, sc);
 
diff -r fcfa8bba0d9e -r 701257b9a5af sys/dev/sbus/qe.c
--- a/sys/dev/sbus/qe.c Thu Mar 19 02:31:28 2020 +0000
+++ b/sys/dev/sbus/qe.c Thu Mar 19 02:58:54 2020 +0000
@@ -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 @@
 
 /*
  * 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 @@
        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 @@
                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 @@
                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 @@
        qe_mcreset(sc);
 
        ifp->if_flags |= IFF_RUNNING;
-       ifp->if_flags &= ~IFF_OACTIVE;
        splx(s);
 }
 



Home | Main Index | Thread Index | Old Index