Source-Changes-HG archive

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

[src/trunk]: src/sys Apply deferred if_start framework



details:   https://anonhg.NetBSD.org/src/rev/5ceec1be9226
branches:  trunk
changeset: 349343:5ceec1be9226
user:      ozaki-r <ozaki-r%NetBSD.org@localhost>
date:      Thu Dec 08 01:12:00 2016 +0000

description:
Apply deferred if_start framework

if_schedule_deferred_start checks if the if_snd queue contains packets,
so drivers don't need to check it by themselves.

diffstat:

 sys/arch/arm/omap/if_cpsw.c           |   7 +-
 sys/arch/emips/ebus/if_le_ebus.c      |   9 ++-
 sys/arch/macppc/dev/if_bm.c           |   7 +-
 sys/arch/macppc/dev/if_gm.c           |   7 +-
 sys/arch/mips/adm5120/dev/if_admsw.c  |   7 +-
 sys/arch/mips/alchemy/dev/if_aumac.c  |   7 +-
 sys/arch/mips/atheros/dev/if_ae.c     |   7 +-
 sys/arch/playstation2/dev/if_smap.c   |   8 +-
 sys/arch/powerpc/ibm4xx/dev/if_emac.c |   7 +-
 sys/arch/sgimips/hpc/if_sq.c          |   7 +-
 sys/arch/sgimips/mace/if_mec.c        |   9 ++-
 sys/arch/sun2/dev/if_ec.c             |  15 ++----
 sys/arch/x86/pci/if_vmx.c             |   7 +-
 sys/dev/marvell/if_mvgbe.c            |   8 +-
 sys/dev/marvell/if_mvxpe.c            |   8 +-
 sys/dev/pci/if_age.c                  |   7 +-
 sys/dev/pci/if_alc.c                  |   6 +-
 sys/dev/pci/if_bce.c                  |   7 +-
 sys/dev/pci/if_bge.c                  |   9 ++-
 sys/dev/pci/if_bnx.c                  |   8 +-
 sys/dev/pci/if_cas.c                  |   7 +-
 sys/dev/pci/if_de.c                   |   7 +-
 sys/dev/pci/if_dge.c                  |   7 +-
 sys/dev/pci/if_et.c                   |   7 +-
 sys/dev/pci/if_ipw.c                  |   7 +-
 sys/dev/pci/if_iwi.c                  |   7 +-
 sys/dev/pci/if_iwm.c                  |   9 ++-
 sys/dev/pci/if_iwn.c                  |   7 +-
 sys/dev/pci/if_lii.c                  |   7 +-
 sys/dev/pci/if_msk.c                  |  13 +++--
 sys/dev/pci/if_nfe.c                  |   9 ++-
 sys/dev/pci/if_pcn.c                  |   7 +-
 sys/dev/pci/if_rtwn.c                 |   9 ++-
 sys/dev/pci/if_sip.c                  |   7 +-
 sys/dev/pci/if_sk.c                   |  13 +++--
 sys/dev/pci/if_ste.c                  |   7 +-
 sys/dev/pci/if_stge.c                 |   7 +-
 sys/dev/pci/if_ti.c                   |  10 ++--
 sys/dev/pci/if_txp.c                  |   7 +-
 sys/dev/pci/if_vge.c                  |   9 ++-
 sys/dev/pci/if_vioif.c                |   7 +-
 sys/dev/pci/if_vr.c                   |   7 +-
 sys/dev/pci/if_wm.c                   |  72 ++++++++++++++++++++++++++++++----
 sys/dev/pci/if_wpi.c                  |   7 +-
 sys/dev/pci/if_xge.c                  |   7 +-
 sys/dev/pcmcia/if_cnw.c               |   7 +-
 sys/dev/pcmcia/if_malo_pcmcia.c       |   7 +-
 sys/dev/pcmcia/if_xi.c                |   8 +-
 48 files changed, 264 insertions(+), 178 deletions(-)

diffs (truncated from 1855 to 300 lines):

diff -r a858da627502 -r 5ceec1be9226 sys/arch/arm/omap/if_cpsw.c
--- a/sys/arch/arm/omap/if_cpsw.c       Thu Dec 08 01:06:35 2016 +0000
+++ b/sys/arch/arm/omap/if_cpsw.c       Thu Dec 08 01:12:00 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_cpsw.c,v 1.16 2016/08/04 14:08:23 kiyohara Exp $    */
+/*     $NetBSD: if_cpsw.c,v 1.17 2016/12/08 01:12:00 ozaki-r Exp $     */
 
 /*
  * Copyright (c) 2013 Jonathan A. Kollasch
@@ -53,7 +53,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(1, "$NetBSD: if_cpsw.c,v 1.16 2016/08/04 14:08:23 kiyohara Exp $");
+__KERNEL_RCSID(1, "$NetBSD: if_cpsw.c,v 1.17 2016/12/08 01:12:00 ozaki-r Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -572,6 +572,7 @@
        }
 
        if_attach(ifp);
+       if_deferred_start_init(ifp, NULL);
        ether_ifattach(ifp, sc->sc_enaddr);
 
        /* The attach is successful. */
@@ -1303,7 +1304,7 @@
                ifp->if_timer = 0;
 
        if (handled)
-               cpsw_start(ifp);
+               if_schedule_deferred_start(ifp);
 
        return handled;
 }
diff -r a858da627502 -r 5ceec1be9226 sys/arch/emips/ebus/if_le_ebus.c
--- a/sys/arch/emips/ebus/if_le_ebus.c  Thu Dec 08 01:06:35 2016 +0000
+++ b/sys/arch/emips/ebus/if_le_ebus.c  Thu Dec 08 01:12:00 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_le_ebus.c,v 1.11 2016/10/03 17:35:38 maya Exp $     */
+/*     $NetBSD: if_le_ebus.c,v 1.12 2016/12/08 01:12:00 ozaki-r Exp $  */
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_le_ebus.c,v 1.11 2016/10/03 17:35:38 maya Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_le_ebus.c,v 1.12 2016/12/08 01:12:00 ozaki-r Exp $");
 
 #include "opt_inet.h"
 
@@ -216,6 +216,7 @@
 
        /* Attach the interface. */
        if_attach(ifp);
+       if_deferred_start_init(ifp, NULL);
        ether_ifattach(ifp, sc->sc_enaddr);
 
        sc->sc_sh = shutdownhook_establish(enic_shutdown, ifp);
@@ -540,7 +541,7 @@
        printf("enic_init <- %x\n",ctl);
 #endif
 
-       enic_start(ifp);
+       if_schedule_deferred_start(ifp);
 
        return 0;
 }
@@ -819,7 +820,7 @@
                ifp->if_timer = 0;
 
        ifp->if_flags &= ~IFF_OACTIVE;
-       enic_start(ifp);
+       if_schedule_deferred_start(ifp);
 #if DEBUG
        sc->it = 1;
 #endif
diff -r a858da627502 -r 5ceec1be9226 sys/arch/macppc/dev/if_bm.c
--- a/sys/arch/macppc/dev/if_bm.c       Thu Dec 08 01:06:35 2016 +0000
+++ b/sys/arch/macppc/dev/if_bm.c       Thu Dec 08 01:12:00 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_bm.c,v 1.51 2016/10/03 01:23:55 ozaki-r Exp $       */
+/*     $NetBSD: if_bm.c,v 1.52 2016/12/08 01:12:00 ozaki-r Exp $       */
 
 /*-
  * Copyright (C) 1998, 1999, 2000 Tsubai Masanari.  All rights reserved.
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_bm.c,v 1.51 2016/10/03 01:23:55 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_bm.c,v 1.52 2016/12/08 01:12:00 ozaki-r Exp $");
 
 #include "opt_inet.h"
 
@@ -260,6 +260,7 @@
        bmac_reset_chip(sc);
 
        if_attach(ifp);
+       if_deferred_start_init(ifp, NULL);
        ether_ifattach(ifp, sc->sc_enaddr);
 }
 
@@ -441,7 +442,7 @@
                sc->sc_if.if_flags &= ~IFF_OACTIVE;
                sc->sc_if.if_timer = 0;
                sc->sc_if.if_opackets++;
-               bmac_start(&sc->sc_if);
+               if_schedule_deferred_start(&sc->sc_if);
        }
 
        /* XXX should do more! */
diff -r a858da627502 -r 5ceec1be9226 sys/arch/macppc/dev/if_gm.c
--- a/sys/arch/macppc/dev/if_gm.c       Thu Dec 08 01:06:35 2016 +0000
+++ b/sys/arch/macppc/dev/if_gm.c       Thu Dec 08 01:12:00 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_gm.c,v 1.47 2016/06/10 13:27:11 ozaki-r Exp $       */
+/*     $NetBSD: if_gm.c,v 1.48 2016/12/08 01:12:00 ozaki-r Exp $       */
 
 /*-
  * Copyright (c) 2000 Tsubai Masanari.  All rights reserved.
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_gm.c,v 1.47 2016/06/10 13:27:11 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_gm.c,v 1.48 2016/12/08 01:12:00 ozaki-r Exp $");
 
 #include "opt_inet.h"
 
@@ -247,6 +247,7 @@
                ifmedia_set(&mii->mii_media, IFM_ETHER|IFM_AUTO);
 
        if_attach(ifp);
+       if_deferred_start_init(ifp, NULL);
        ether_ifattach(ifp, laddr);
        rnd_attach_source(&sc->sc_rnd_source, xname, RND_TYPE_NET,
                          RND_FLAG_DEFAULT); 
@@ -343,7 +344,7 @@
 
        ifp->if_flags &= ~IFF_OACTIVE;
        ifp->if_timer = 0;
-       gmac_start(ifp);
+       if_schedule_deferred_start(ifp);
 }
 
 void
diff -r a858da627502 -r 5ceec1be9226 sys/arch/mips/adm5120/dev/if_admsw.c
--- a/sys/arch/mips/adm5120/dev/if_admsw.c      Thu Dec 08 01:06:35 2016 +0000
+++ b/sys/arch/mips/adm5120/dev/if_admsw.c      Thu Dec 08 01:12:00 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_admsw.c,v 1.14 2016/06/10 13:27:12 ozaki-r Exp $ */
+/* $NetBSD: if_admsw.c,v 1.15 2016/12/08 01:12:00 ozaki-r Exp $ */
 
 /*-
  * Copyright (c) 2007 Ruslan Ermilov and Vsevolod Lobko.
@@ -76,7 +76,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_admsw.c,v 1.14 2016/06/10 13:27:12 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_admsw.c,v 1.15 2016/12/08 01:12:00 ozaki-r Exp $");
 
 
 #include <sys/param.h>
@@ -480,6 +480,7 @@
 
                /* Attach the interface. */
                if_attach(ifp);
+               if_deferred_start_init(ifp, NULL);
                ether_ifattach(ifp, enaddr);
                enaddr[5]++;
        }
@@ -886,7 +887,7 @@
                ifp = &sc->sc_ethercom[0].ec_if;
 
                /* Try to queue more packets. */
-               admsw_start(ifp);
+               if_schedule_deferred_start(ifp);
 
                /*
                 * If there are no more pending transmissions,
diff -r a858da627502 -r 5ceec1be9226 sys/arch/mips/alchemy/dev/if_aumac.c
--- a/sys/arch/mips/alchemy/dev/if_aumac.c      Thu Dec 08 01:06:35 2016 +0000
+++ b/sys/arch/mips/alchemy/dev/if_aumac.c      Thu Dec 08 01:12:00 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_aumac.c,v 1.41 2016/06/10 13:27:12 ozaki-r Exp $ */
+/* $NetBSD: if_aumac.c,v 1.42 2016/12/08 01:12:00 ozaki-r Exp $ */
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -46,7 +46,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_aumac.c,v 1.41 2016/06/10 13:27:12 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_aumac.c,v 1.42 2016/12/08 01:12:00 ozaki-r Exp $");
 
 
 
@@ -338,6 +338,7 @@
 
        /* Attach the interface. */
        if_attach(ifp); 
+       if_deferred_start_init(ifp, NULL);
        ether_ifattach(ifp, enaddr);
 
        rnd_attach_source(&sc->rnd_source, device_xname(self),
@@ -578,7 +579,7 @@
                ifp->if_flags &= ~IFF_OACTIVE;
 
                /* Try to queue more packets. */
-               aumac_start(ifp);
+               if_schedule_deferred_start(ifp);
        }
 
        if (pkts)
diff -r a858da627502 -r 5ceec1be9226 sys/arch/mips/atheros/dev/if_ae.c
--- a/sys/arch/mips/atheros/dev/if_ae.c Thu Dec 08 01:06:35 2016 +0000
+++ b/sys/arch/mips/atheros/dev/if_ae.c Thu Dec 08 01:12:00 2016 +0000
@@ -1,4 +1,4 @@
-/* $Id: if_ae.c,v 1.28 2016/06/10 13:27:12 ozaki-r Exp $ */
+/* $Id: if_ae.c,v 1.29 2016/12/08 01:12:00 ozaki-r Exp $ */
 /*-
  * Copyright (c) 2006 Urbana-Champaign Independent Media Center.
  * Copyright (c) 2006 Garrett D'Amore.
@@ -98,7 +98,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_ae.c,v 1.28 2016/06/10 13:27:12 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ae.c,v 1.29 2016/12/08 01:12:00 ozaki-r Exp $");
 
 
 #include <sys/param.h>
@@ -383,6 +383,7 @@
         * Attach the interface.
         */
        if_attach(ifp);
+       if_deferred_start_init(ifp, NULL);
        ether_ifattach(ifp, enaddr);
        ether_set_ifflags_cb(&sc->sc_ethercom, ae_ifflags_cb);
 
@@ -993,7 +994,7 @@
        }
 
        /* Try to get more packets going. */
-       ae_start(ifp);
+       if_schedule_deferred_start(ifp);
 
        if (handled)
                rnd_add_uint32(&sc->sc_rnd_source, status);
diff -r a858da627502 -r 5ceec1be9226 sys/arch/playstation2/dev/if_smap.c
--- a/sys/arch/playstation2/dev/if_smap.c       Thu Dec 08 01:06:35 2016 +0000
+++ b/sys/arch/playstation2/dev/if_smap.c       Thu Dec 08 01:12:00 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_smap.c,v 1.21 2016/06/10 13:27:12 ozaki-r Exp $     */
+/*     $NetBSD: if_smap.c,v 1.22 2016/12/08 01:12:00 ozaki-r Exp $     */
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_smap.c,v 1.21 2016/06/10 13:27:12 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_smap.c,v 1.22 2016/12/08 01:12:00 ozaki-r Exp $");
 
 #include "debug_playstation2.h"
 
@@ -246,6 +246,7 @@
        }
 
        if_attach(ifp);
+       if_deferred_start_init(ifp, NULL);
        ether_ifattach(ifp, emac3->eaddr);
        
        spd_intr_establish(SPD_NIC, smap_intr, sc);
@@ -321,8 +322,7 @@
        
        /* if transmission is pending, start here */
        ifp = &sc->ethercom.ec_if;
-       if (IFQ_IS_EMPTY(&ifp->if_snd) == 0)
-               smap_start(ifp);
+       if_schedule_deferred_start(ifp);
        rnd_add_uint32(&sc->rnd_source, cause | sc->tx_fifo_ptr << 16);
 
        return (1);
diff -r a858da627502 -r 5ceec1be9226 sys/arch/powerpc/ibm4xx/dev/if_emac.c
--- a/sys/arch/powerpc/ibm4xx/dev/if_emac.c     Thu Dec 08 01:06:35 2016 +0000
+++ b/sys/arch/powerpc/ibm4xx/dev/if_emac.c     Thu Dec 08 01:12:00 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_emac.c,v 1.45 2016/06/10 13:27:12 ozaki-r Exp $     */
+/*     $NetBSD: if_emac.c,v 1.46 2016/12/08 01:12:00 ozaki-r Exp $     */
 
 /*
  * Copyright 2001, 2002 Wasabi Systems, Inc.
@@ -52,7 +52,7 @@



Home | Main Index | Thread Index | Old Index