Source-Changes-HG archive

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

[src/trunk]: src/sys/dev Don't bother with IFF_OACTIVE.



details:   https://anonhg.NetBSD.org/src/rev/5a908d0e777a
branches:  trunk
changeset: 970204:5a908d0e777a
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Sun Mar 15 22:19:00 2020 +0000

description:
Don't bother with IFF_OACTIVE.

diffstat:

 sys/dev/ic/aic6915.c   |  16 ++++------------
 sys/dev/ic/dp83932.c   |  16 ++++------------
 sys/dev/ic/gem.c       |  28 +++++-----------------------
 sys/dev/ic/sgec.c      |   9 ++-------
 sys/dev/ic/smc83c170.c |  13 +++----------
 sys/dev/ic/tulip.c     |  31 ++++++++-----------------------
 sys/dev/pci/if_pcn.c   |  25 +++++--------------------
 sys/dev/pci/if_sip.c   |  32 +++++++-------------------------
 sys/dev/pci/if_ste.c   |  16 ++++------------
 sys/dev/pci/if_stge.c  |  16 ++++------------
 10 files changed, 46 insertions(+), 156 deletions(-)

diffs (truncated from 720 to 300 lines):

diff -r 2892fa0d3f9d -r 5a908d0e777a sys/dev/ic/aic6915.c
--- a/sys/dev/ic/aic6915.c      Sun Mar 15 21:15:25 2020 +0000
+++ b/sys/dev/ic/aic6915.c      Sun Mar 15 22:19:00 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: aic6915.c,v 1.43 2020/03/12 03:01:46 thorpej Exp $     */
+/*     $NetBSD: aic6915.c,v 1.44 2020/03/15 22:19:00 thorpej Exp $     */
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: aic6915.c,v 1.43 2020/03/12 03:01:46 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: aic6915.c,v 1.44 2020/03/15 22:19:00 thorpej Exp $");
 
 
 #include <sys/param.h>
@@ -469,11 +469,6 @@
                bpf_mtap(ifp, m0, BPF_D_OUT);
        }
 
-       if (sc->sc_txpending == (SF_NTXDESC - 1)) {
-               /* No more slots left; notify upper layer. */
-               ifp->if_flags |= IFF_OACTIVE;
-       }
-
        if (sc->sc_txpending != opending) {
                KASSERT(last != -1);
                /*
@@ -638,8 +633,6 @@
        if (consumer == producer)
                return;
 
-       ifp->if_flags &= ~IFF_OACTIVE;
-
        while (consumer != producer) {
                SF_CDTXCSYNC(sc, consumer, BUS_DMASYNC_POSTREAD);
                tcd = le32toh(sc->sc_txcomp[consumer].tcd_word0);
@@ -1097,11 +1090,10 @@
         * Note that the interface is now running.
         */
        ifp->if_flags |= IFF_RUNNING;
-       ifp->if_flags &= ~IFF_OACTIVE;
 
  out:
        if (error) {
-               ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE);
+               ifp->if_flags &= ~IFF_RUNNING;
                ifp->if_timer = 0;
                printf("%s: interface not running\n", device_xname(sc->sc_dev));
        }
@@ -1168,7 +1160,7 @@
        /*
         * Mark the interface down and cancel the watchdog timer.
         */
-       ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE);
+       ifp->if_flags &= ~IFF_RUNNING;
        ifp->if_timer = 0;
 
        if (disable)
diff -r 2892fa0d3f9d -r 5a908d0e777a sys/dev/ic/dp83932.c
--- a/sys/dev/ic/dp83932.c      Sun Mar 15 21:15:25 2020 +0000
+++ b/sys/dev/ic/dp83932.c      Sun Mar 15 22:19:00 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: dp83932.c,v 1.45 2020/01/29 14:14:55 thorpej Exp $     */
+/*     $NetBSD: dp83932.c,v 1.46 2020/03/15 22:19:00 thorpej Exp $     */
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dp83932.c,v 1.45 2020/01/29 14:14:55 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dp83932.c,v 1.46 2020/03/15 22:19:00 thorpej Exp $");
 
 
 #include <sys/param.h>
@@ -287,7 +287,7 @@
        int error, olasttx, nexttx, opending, totlen, olseg;
        int seg = 0;    /* XXX: gcc */
 
-       if ((ifp->if_flags & (IFF_RUNNING | IFF_OACTIVE)) != IFF_RUNNING)
+       if ((ifp->if_flags & IFF_RUNNING) != IFF_RUNNING)
                return;
 
        /*
@@ -471,11 +471,6 @@
                bpf_mtap(ifp, m0, BPF_D_OUT);
        }
 
-       if (sc->sc_txpending == (SONIC_NTXDESC - 1)) {
-               /* No more slots left; notify upper layer. */
-               ifp->if_flags |= IFF_OACTIVE;
-       }
-
        if (sc->sc_txpending != opending) {
                /*
                 * We enqueued packets.  If the transmitter was idle,
@@ -634,8 +629,6 @@
        uint16_t status, totstat = 0;
        int i;
 
-       ifp->if_flags &= ~IFF_OACTIVE;
-
        for (i = sc->sc_txdirty; sc->sc_txpending != 0;
             i = SONIC_NEXTTX(i), sc->sc_txpending--) {
                ds = &sc->sc_txsoft[i];
@@ -1017,7 +1010,6 @@
         * ...all done!
         */
        ifp->if_flags |= IFF_RUNNING;
-       ifp->if_flags &= ~IFF_OACTIVE;
 
  out:
        if (error)
@@ -1090,7 +1082,7 @@
        /*
         * Mark the interface down and cancel the watchdog timer.
         */
-       ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE);
+       ifp->if_flags &= ~IFF_RUNNING;
        ifp->if_timer = 0;
 
        if (disable)
diff -r 2892fa0d3f9d -r 5a908d0e777a sys/dev/ic/gem.c
--- a/sys/dev/ic/gem.c  Sun Mar 15 21:15:25 2020 +0000
+++ b/sys/dev/ic/gem.c  Sun Mar 15 22:19:00 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: gem.c,v 1.129 2020/03/01 05:50:56 thorpej Exp $ */
+/*     $NetBSD: gem.c,v 1.130 2020/03/15 22:19:00 thorpej Exp $ */
 
 /*
  *
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: gem.c,v 1.129 2020/03/01 05:50:56 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gem.c,v 1.130 2020/03/15 22:19:00 thorpej Exp $");
 
 #include "opt_inet.h"
 
@@ -745,7 +745,7 @@
        /*
         * Mark the interface down and cancel the watchdog timer.
         */
-       ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE);
+       ifp->if_flags &= ~IFF_RUNNING;
        sc->sc_if_flags = ifp->if_flags;
        ifp->if_timer = 0;
 
@@ -1228,7 +1228,6 @@
 
        sc->sc_flags &= ~GEM_LINK;
        ifp->if_flags |= IFF_RUNNING;
-       ifp->if_flags &= ~IFF_OACTIVE;
        ifp->if_timer = 0;
        sc->sc_if_flags = ifp->if_flags;
 out:
@@ -1371,7 +1370,7 @@
 #endif
        uint64_t flags = 0;
 
-       if ((ifp->if_flags & (IFF_RUNNING | IFF_OACTIVE)) != IFF_RUNNING)
+       if ((ifp->if_flags & IFF_RUNNING) != IFF_RUNNING)
                return;
 
        /*
@@ -1459,16 +1458,8 @@
                     (sc->sc_txfree - 1) : sc->sc_txfree)) {
                        /*
                         * Not enough free descriptors to transmit this
-                        * packet.  We haven't committed to anything yet,
-                        * so just unload the DMA map, put the packet
-                        * back on the queue, and punt.  Notify the upper
-                        * layer that there are no more slots left.
-                        *
-                        * XXX We could allocate an mbuf and copy, but
-                        * XXX it is worth it?
+                        * packet.
                         */
-                       ifp->if_flags |= IFF_OACTIVE;
-                       sc->sc_if_flags = ifp->if_flags;
                        bus_dmamap_unload(sc->sc_dmatag, dmamap);
                        if (m != NULL)
                                m_freem(m);
@@ -1608,12 +1599,6 @@
                bpf_mtap(ifp, m0, BPF_D_OUT);
        }
 
-       if (txs == NULL || sc->sc_txfree == 0) {
-               /* No more slots left; notify upper layer. */
-               ifp->if_flags |= IFF_OACTIVE;
-               sc->sc_if_flags = ifp->if_flags;
-       }
-
        if (sc->sc_txfree != ofree) {
                DPRINTF(sc, ("%s: packets enqueued, IC on %d, OWN on %d\n",
                    device_xname(sc->sc_dev), lasttx, otxnext));
@@ -1748,9 +1733,6 @@
                if (sc->sc_txfree == GEM_NTXDESC - 1)
                        sc->sc_txwin = 0;
 
-               /* Freed some descriptors, so reset IFF_OACTIVE and restart. */
-               ifp->if_flags &= ~IFF_OACTIVE;
-               sc->sc_if_flags = ifp->if_flags;
                ifp->if_timer = SIMPLEQ_EMPTY(&sc->sc_txdirtyq) ? 0 : 5;
                if_schedule_deferred_start(ifp);
        }
diff -r 2892fa0d3f9d -r 5a908d0e777a sys/dev/ic/sgec.c
--- a/sys/dev/ic/sgec.c Sun Mar 15 21:15:25 2020 +0000
+++ b/sys/dev/ic/sgec.c Sun Mar 15 22:19:00 2020 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: sgec.c,v 1.52 2020/01/30 04:56:11 thorpej Exp $ */
+/*      $NetBSD: sgec.c,v 1.53 2020/03/15 22:19:00 thorpej Exp $ */
 /*
  * Copyright (c) 1999 Ludd, University of Lule}, Sweden. All rights reserved.
  *
@@ -39,7 +39,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sgec.c,v 1.52 2020/01/30 04:56:11 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sgec.c,v 1.53 2020/03/15 22:19:00 thorpej Exp $");
 
 #include "opt_inet.h"
 
@@ -301,7 +301,6 @@
            ZE_NICSR6_SR | ZE_NICSR6_DC);
 
        ifp->if_flags |= IFF_RUNNING;
-       ifp->if_flags &= ~IFF_OACTIVE;
 
        /*
         * Send a setup frame.
@@ -356,7 +355,6 @@
 
                if ((map->dm_nsegs + sc->sc_inq) >= (TXDESCS - 1)) {
                        bus_dmamap_unload(sc->sc_dmat, map);
-                       ifp->if_flags |= IFF_OACTIVE;
                        goto out;
                }
 
@@ -416,8 +414,6 @@
 
                bpf_mtap(ifp, m, BPF_D_OUT);
        }
-       if (sc->sc_inq == (TXDESCS - 1))
-               ifp->if_flags |= IFF_OACTIVE;
 
 out:   if (old_inq < sc->sc_inq)
                ifp->if_timer = 5; /* If transmit logic dies */
@@ -508,7 +504,6 @@
                        sc->sc_lastack = lastack;
                        if (sc->sc_inq == 0)
                                ifp->if_timer = 0;
-                       ifp->if_flags &= ~IFF_OACTIVE;
                        zestart(ifp); /* Put in more in queue */
                }
        }
diff -r 2892fa0d3f9d -r 5a908d0e777a sys/dev/ic/smc83c170.c
--- a/sys/dev/ic/smc83c170.c    Sun Mar 15 21:15:25 2020 +0000
+++ b/sys/dev/ic/smc83c170.c    Sun Mar 15 22:19:00 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: smc83c170.c,v 1.94 2020/03/12 03:01:46 thorpej Exp $   */
+/*     $NetBSD: smc83c170.c,v 1.95 2020/03/15 22:19:00 thorpej Exp $   */
 
 /*-
  * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: smc83c170.c,v 1.94 2020/03/12 03:01:46 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: smc83c170.c,v 1.95 2020/03/15 22:19:00 thorpej Exp $");
 
 
 #include <sys/param.h>
@@ -499,11 +499,6 @@
                bpf_mtap(ifp, m0, BPF_D_OUT);
        }
 
-       if (sc->sc_txpending == EPIC_NTXDESC) {
-               /* No more slots left; notify upper layer. */
-               ifp->if_flags |= IFF_OACTIVE;
-       }
-
        if (sc->sc_txpending != opending) {
                /*
                 * We enqueued packets.  If the transmitter was idle,
@@ -740,7 +735,6 @@
         * Check for transmission complete interrupts.
         */
        if (intstat & (INTSTAT_TXC | INTSTAT_TXU)) {
-               ifp->if_flags &= ~IFF_OACTIVE;
                for (i = sc->sc_txdirty; sc->sc_txpending != 0;
                     i = EPIC_NEXTTX(i), sc->sc_txpending--) {
                        txd = EPIC_CDTX(sc, i);



Home | Main Index | Thread Index | Old Index