Source-Changes-HG archive

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

[src/trunk]: src/sys/dev Apply deferred if_start to more drivers



details:   https://anonhg.NetBSD.org/src/rev/a87ad63eebda
branches:  trunk
changeset: 824086:a87ad63eebda
user:      ozaki-r <ozaki-r%NetBSD.org@localhost>
date:      Tue May 23 02:19:14 2017 +0000

description:
Apply deferred if_start to more drivers

And annotate some XXX_start as it runs in softint to clarify that
it doesn't need deferred if_start.

diffstat:

 sys/dev/cadence/if_cemac.c |   9 +++++----
 sys/dev/ic/aic6915.c       |   7 ++++---
 sys/dev/ic/am7990.c        |   7 ++++---
 sys/dev/ic/am79900.c       |   7 ++++---
 sys/dev/ic/an.c            |   6 +++---
 sys/dev/ic/arn5008.c       |   6 +++---
 sys/dev/ic/arn9003.c       |   6 +++---
 sys/dev/ic/awi.c           |   6 +++---
 sys/dev/ic/dp8390.c        |   7 ++++---
 sys/dev/ic/dp83932.c       |   7 ++++---
 sys/dev/ic/hme.c           |   7 ++++---
 sys/dev/ic/lemac.c         |   7 ++++---
 sys/dev/ic/mb86960.c       |   7 ++++---
 sys/dev/ic/rt2560.c        |   8 ++++----
 sys/dev/ic/rt2661.c        |   6 +++---
 sys/dev/ic/rt2860.c        |   6 +++---
 sys/dev/ic/rtw.c           |   8 ++++----
 sys/dev/ic/smc90cx6.c      |   7 ++++---
 sys/dev/ic/smc91cxx.c      |   7 ++++---
 sys/dev/ic/tulip.c         |   7 ++++---
 sys/dev/pci/if_ale.c       |   8 ++++----
 sys/dev/pci/if_ipw.c       |   6 +++---
 sys/dev/pci/if_iwi.c       |   6 +++---
 sys/dev/pci/if_tl.c        |  11 +++++------
 sys/dev/pci/if_vte.c       |   8 ++++----
 sys/dev/pci/if_wpi.c       |   6 +++---
 26 files changed, 97 insertions(+), 86 deletions(-)

diffs (truncated from 855 to 300 lines):

diff -r bbfeb1643bc7 -r a87ad63eebda sys/dev/cadence/if_cemac.c
--- a/sys/dev/cadence/if_cemac.c        Tue May 23 00:54:13 2017 +0000
+++ b/sys/dev/cadence/if_cemac.c        Tue May 23 02:19:14 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_cemac.c,v 1.10 2016/12/15 09:28:04 ozaki-r Exp $    */
+/*     $NetBSD: if_cemac.c,v 1.11 2017/05/23 02:19:14 ozaki-r Exp $    */
 
 /*
  * Copyright (c) 2015  Genetec Corporation.  All rights reserved.
@@ -40,7 +40,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_cemac.c,v 1.10 2016/12/15 09:28:04 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_cemac.c,v 1.11 2017/05/23 02:19:14 ozaki-r Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -384,8 +384,8 @@
                }
        }
 
-       if (cemac_gctx(sc) > 0 && IFQ_IS_EMPTY(&ifp->if_snd) == 0)
-               cemac_ifstart(ifp);
+       if (cemac_gctx(sc) > 0)
+               if_schedule_deferred_start(ifp);
 #if 0 // reloop
        irq = CEMAC_READ(IntStsC);
        if ((irq & (IntSts_RxSQ|IntSts_ECI)) != 0)
@@ -621,6 +621,7 @@
        ifp->if_softc = sc;
         IFQ_SET_READY(&ifp->if_snd);
         if_attach(ifp);
+       if_deferred_start_init(ifp, NULL);
         ether_ifattach(ifp, (sc)->sc_enaddr);
 }
 
diff -r bbfeb1643bc7 -r a87ad63eebda sys/dev/ic/aic6915.c
--- a/sys/dev/ic/aic6915.c      Tue May 23 00:54:13 2017 +0000
+++ b/sys/dev/ic/aic6915.c      Tue May 23 02:19:14 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: aic6915.c,v 1.34 2016/12/15 09:28:05 ozaki-r Exp $     */
+/*     $NetBSD: aic6915.c,v 1.35 2017/05/23 02:19:14 ozaki-r Exp $     */
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: aic6915.c,v 1.34 2016/12/15 09:28:05 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: aic6915.c,v 1.35 2017/05/23 02:19:14 ozaki-r Exp $");
 
 
 #include <sys/param.h>
@@ -283,6 +283,7 @@
         * Attach the interface.
         */
        if_attach(ifp);
+       if_deferred_start_init(ifp, NULL);
        ether_ifattach(ifp, enaddr);
 
        /*
@@ -605,7 +606,7 @@
                        sf_init(&sc->sc_ethercom.ec_if);
 
                /* Try and get more packets going. */
-               sf_start(&sc->sc_ethercom.ec_if);
+               if_schedule_deferred_start(&sc->sc_ethercom.ec_if);
        }
 
        return (handled);
diff -r bbfeb1643bc7 -r a87ad63eebda sys/dev/ic/am7990.c
--- a/sys/dev/ic/am7990.c       Tue May 23 00:54:13 2017 +0000
+++ b/sys/dev/ic/am7990.c       Tue May 23 02:19:14 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: am7990.c,v 1.75 2015/04/13 16:33:24 riastradh Exp $    */
+/*     $NetBSD: am7990.c,v 1.76 2017/05/23 02:19:14 ozaki-r Exp $      */
 
 /*-
  * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -65,7 +65,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: am7990.c,v 1.75 2015/04/13 16:33:24 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: am7990.c,v 1.76 2017/05/23 02:19:14 ozaki-r Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -114,6 +114,7 @@
        sc->lsc.sc_start = am7990_start;
 
        lance_config(&sc->lsc);
+       if_deferred_start_init(ifp, NULL);
 
        mem = 0;
        sc->lsc.sc_initaddr = mem;
@@ -356,7 +357,7 @@
 
        sc->sc_first_td = bix;
 
-       am7990_start(ifp);
+       if_schedule_deferred_start(ifp);
 
        if (sc->sc_no_td == 0)
                ifp->if_timer = 0;
diff -r bbfeb1643bc7 -r a87ad63eebda sys/dev/ic/am79900.c
--- a/sys/dev/ic/am79900.c      Tue May 23 00:54:13 2017 +0000
+++ b/sys/dev/ic/am79900.c      Tue May 23 02:19:14 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: am79900.c,v 1.24 2015/04/13 16:33:24 riastradh Exp $   */
+/*     $NetBSD: am79900.c,v 1.25 2017/05/23 02:19:14 ozaki-r Exp $     */
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -103,7 +103,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: am79900.c,v 1.24 2015/04/13 16:33:24 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: am79900.c,v 1.25 2017/05/23 02:19:14 ozaki-r Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -152,6 +152,7 @@
        sc->lsc.sc_start = am79900_start;
 
        lance_config(&sc->lsc);
+       if_deferred_start_init(ifp, NULL);
 
        mem = 0;
        sc->lsc.sc_initaddr = mem;
@@ -387,7 +388,7 @@
 
        sc->sc_first_td = bix;
 
-       am79900_start(ifp);
+       if_schedule_deferred_start(ifp);
 
        if (sc->sc_no_td == 0)
                ifp->if_timer = 0;
diff -r bbfeb1643bc7 -r a87ad63eebda sys/dev/ic/an.c
--- a/sys/dev/ic/an.c   Tue May 23 00:54:13 2017 +0000
+++ b/sys/dev/ic/an.c   Tue May 23 02:19:14 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: an.c,v 1.64 2017/02/02 10:05:35 nonaka Exp $   */
+/*     $NetBSD: an.c,v 1.65 2017/05/23 02:19:14 ozaki-r Exp $  */
 /*
  * Copyright (c) 1997, 1998, 1999
  *     Bill Paul <wpaul%ctr.columbia.edu@localhost>.  All rights reserved.
@@ -77,7 +77,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: an.c,v 1.64 2017/02/02 10:05:35 nonaka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: an.c,v 1.65 2017/05/23 02:19:14 ozaki-r Exp $");
 
 
 #include <sys/param.h>
@@ -509,7 +509,7 @@
                    sc->sc_ic.ic_state == IEEE80211_S_RUN &&
                    !IFQ_IS_EMPTY(&ifp->if_snd)) {
                        s = splnet();
-                       an_start(ifp);
+                       an_start(ifp); /* in softint */
                        splx(s);
                }
        }
diff -r bbfeb1643bc7 -r a87ad63eebda sys/dev/ic/arn5008.c
--- a/sys/dev/ic/arn5008.c      Tue May 23 00:54:13 2017 +0000
+++ b/sys/dev/ic/arn5008.c      Tue May 23 02:19:14 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: arn5008.c,v 1.12 2017/02/02 10:05:35 nonaka Exp $      */
+/*     $NetBSD: arn5008.c,v 1.13 2017/05/23 02:19:14 ozaki-r Exp $     */
 /*     $OpenBSD: ar5008.c,v 1.21 2012/08/25 12:14:31 kettenis Exp $    */
 
 /*-
@@ -24,7 +24,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: arn5008.c,v 1.12 2017/02/02 10:05:35 nonaka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: arn5008.c,v 1.13 2017/05/23 02:19:14 ozaki-r Exp $");
 
 #include <sys/param.h>
 #include <sys/sockio.h>
@@ -1056,7 +1056,7 @@
        }
        if (!SIMPLEQ_EMPTY(&sc->sc_txbufs)) {
                ifp->if_flags &= ~IFF_OACTIVE;
-               ifp->if_start(ifp);
+               ifp->if_start(ifp); /* in softint */
        }
 
        splx(s);
diff -r bbfeb1643bc7 -r a87ad63eebda sys/dev/ic/arn9003.c
--- a/sys/dev/ic/arn9003.c      Tue May 23 00:54:13 2017 +0000
+++ b/sys/dev/ic/arn9003.c      Tue May 23 02:19:14 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: arn9003.c,v 1.10 2017/02/02 10:05:35 nonaka Exp $      */
+/*     $NetBSD: arn9003.c,v 1.11 2017/05/23 02:19:14 ozaki-r Exp $     */
 /*     $OpenBSD: ar9003.c,v 1.25 2012/10/20 09:53:32 stsp Exp $        */
 
 /*-
@@ -24,7 +24,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: arn9003.c,v 1.10 2017/02/02 10:05:35 nonaka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: arn9003.c,v 1.11 2017/05/23 02:19:14 ozaki-r Exp $");
 
 #include <sys/param.h>
 #include <sys/sockio.h>
@@ -1204,7 +1204,7 @@
 
        if (!SIMPLEQ_EMPTY(&sc->sc_txbufs)) {
                ifp->if_flags &= ~IFF_OACTIVE;
-               ifp->if_start(ifp);
+               ifp->if_start(ifp); /* in softint */
        }
 
        splx(s);
diff -r bbfeb1643bc7 -r a87ad63eebda sys/dev/ic/awi.c
--- a/sys/dev/ic/awi.c  Tue May 23 00:54:13 2017 +0000
+++ b/sys/dev/ic/awi.c  Tue May 23 02:19:14 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: awi.c,v 1.91 2017/02/02 10:05:35 nonaka Exp $  */
+/*     $NetBSD: awi.c,v 1.92 2017/05/23 02:19:14 ozaki-r Exp $ */
 
 /*-
  * Copyright (c) 1999,2000,2001 The NetBSD Foundation, Inc.
@@ -78,7 +78,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: awi.c,v 1.91 2017/02/02 10:05:35 nonaka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: awi.c,v 1.92 2017/05/23 02:19:14 ozaki-r Exp $");
 
 #include "opt_inet.h"
 
@@ -1173,7 +1173,7 @@
            sc->sc_txdone, sc->sc_txnext, sc->sc_txbase, sc->sc_txend));
        sc->sc_tx_timer = 0;
        ifp->if_flags &= ~IFF_OACTIVE;
-       awi_start(ifp);
+       awi_start(ifp); /* in softint */
 }
 
 static struct mbuf *
diff -r bbfeb1643bc7 -r a87ad63eebda sys/dev/ic/dp8390.c
--- a/sys/dev/ic/dp8390.c       Tue May 23 00:54:13 2017 +0000
+++ b/sys/dev/ic/dp8390.c       Tue May 23 02:19:14 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: dp8390.c,v 1.86 2016/12/15 09:28:05 ozaki-r Exp $      */
+/*     $NetBSD: dp8390.c,v 1.87 2017/05/23 02:19:14 ozaki-r Exp $      */
 
 /*
  * Device driver for National Semiconductor DS8390/WD83C690 based ethernet
@@ -14,7 +14,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dp8390.c,v 1.86 2016/12/15 09:28:05 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dp8390.c,v 1.87 2017/05/23 02:19:14 ozaki-r Exp $");
 
 #include "opt_ipkdb.h"
 #include "opt_inet.h"
@@ -151,6 +151,7 @@
 
        /* Attach the interface. */
        if_attach(ifp);
+       if_deferred_start_init(ifp, NULL);
        ether_ifattach(ifp, sc->sc_enaddr);
 
        rnd_attach_source(&sc->rnd_source, device_xname(sc->sc_dev),
@@ -786,7 +787,7 @@
                 * to start output on the interface.  This is done after
                 * handling the receiver to give the receiver priority.
                 */
-               dp8390_start(ifp);
+               if_schedule_deferred_start(ifp);
 
                /*
                 * Return NIC CR to standard state: page 0, remote DMA
diff -r bbfeb1643bc7 -r a87ad63eebda sys/dev/ic/dp83932.c
--- a/sys/dev/ic/dp83932.c      Tue May 23 00:54:13 2017 +0000
+++ b/sys/dev/ic/dp83932.c      Tue May 23 02:19:14 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: dp83932.c,v 1.39 2016/12/15 09:28:05 ozaki-r Exp $     */
+/*     $NetBSD: dp83932.c,v 1.40 2017/05/23 02:19:14 ozaki-r Exp $     */
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dp83932.c,v 1.39 2016/12/15 09:28:05 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dp83932.c,v 1.40 2017/05/23 02:19:14 ozaki-r Exp $");



Home | Main Index | Thread Index | Old Index