Module Name: src Committed By: ozaki-r Date: Mon Feb 20 07:43:29 UTC 2017
Modified Files: src/sys/dev/ic: dwc_gmac.c elinkxl.c gem.c hd64570.c i82557.c i82586.c i82596.c lan9118.c mb86950.c rtl81x9.c smc83c170.c Log Message: Apply deferred if_start to more drivers To generate a diff of this commit: cvs rdiff -u -r1.39 -r1.40 src/sys/dev/ic/dwc_gmac.c cvs rdiff -u -r1.120 -r1.121 src/sys/dev/ic/elinkxl.c cvs rdiff -u -r1.107 -r1.108 src/sys/dev/ic/gem.c cvs rdiff -u -r1.52 -r1.53 src/sys/dev/ic/hd64570.c cvs rdiff -u -r1.146 -r1.147 src/sys/dev/ic/i82557.c cvs rdiff -u -r1.75 -r1.76 src/sys/dev/ic/i82586.c cvs rdiff -u -r1.35 -r1.36 src/sys/dev/ic/i82596.c cvs rdiff -u -r1.23 -r1.24 src/sys/dev/ic/lan9118.c cvs rdiff -u -r1.25 -r1.26 src/sys/dev/ic/mb86950.c cvs rdiff -u -r1.101 -r1.102 src/sys/dev/ic/rtl81x9.c cvs rdiff -u -r1.84 -r1.85 src/sys/dev/ic/smc83c170.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/ic/dwc_gmac.c diff -u src/sys/dev/ic/dwc_gmac.c:1.39 src/sys/dev/ic/dwc_gmac.c:1.40 --- src/sys/dev/ic/dwc_gmac.c:1.39 Mon Jan 23 08:36:23 2017 +++ src/sys/dev/ic/dwc_gmac.c Mon Feb 20 07:43:29 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: dwc_gmac.c,v 1.39 2017/01/23 08:36:23 skrll Exp $ */ +/* $NetBSD: dwc_gmac.c,v 1.40 2017/02/20 07:43:29 ozaki-r Exp $ */ /*- * Copyright (c) 2013, 2014 The NetBSD Foundation, Inc. @@ -41,7 +41,7 @@ #include <sys/cdefs.h> -__KERNEL_RCSID(1, "$NetBSD: dwc_gmac.c,v 1.39 2017/01/23 08:36:23 skrll Exp $"); +__KERNEL_RCSID(1, "$NetBSD: dwc_gmac.c,v 1.40 2017/02/20 07:43:29 ozaki-r Exp $"); /* #define DWC_GMAC_DEBUG 1 */ @@ -261,6 +261,7 @@ dwc_gmac_attach(struct dwc_gmac_softc *s /* Attach the interface. */ if_initialize(ifp); sc->sc_ipq = if_percpuq_create(&sc->sc_ec.ec_if); + if_deferred_start_init(ifp, NULL); ether_ifattach(ifp, enaddr); ether_set_ifflags_cb(&sc->sc_ec, dwc_gmac_ifflags_cb); if_register(ifp); @@ -1368,7 +1369,7 @@ dwc_gmac_intr(struct dwc_gmac_softc *sc) * Get more packets */ if (rv) - sc->sc_ec.ec_if.if_start(&sc->sc_ec.ec_if); + if_schedule_deferred_start(&sc->sc_ec.ec_if); return rv; } Index: src/sys/dev/ic/elinkxl.c diff -u src/sys/dev/ic/elinkxl.c:1.120 src/sys/dev/ic/elinkxl.c:1.121 --- src/sys/dev/ic/elinkxl.c:1.120 Thu Dec 15 09:28:05 2016 +++ src/sys/dev/ic/elinkxl.c Mon Feb 20 07:43:29 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: elinkxl.c,v 1.120 2016/12/15 09:28:05 ozaki-r Exp $ */ +/* $NetBSD: elinkxl.c,v 1.121 2017/02/20 07:43:29 ozaki-r Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: elinkxl.c,v 1.120 2016/12/15 09:28:05 ozaki-r Exp $"); +__KERNEL_RCSID(0, "$NetBSD: elinkxl.c,v 1.121 2017/02/20 07:43:29 ozaki-r Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -426,6 +426,7 @@ ex_config(struct ex_softc *sc) IFCAP_CSUM_UDPv4_Tx | IFCAP_CSUM_UDPv4_Rx; if_attach(ifp); + if_deferred_start_init(ifp, NULL); ether_ifattach(ifp, macaddr); ether_set_ifflags_cb(&sc->sc_ethercom, ex_ifflags_cb); @@ -1418,8 +1419,8 @@ ex_intr(void *arg) } /* no more interrupts */ - if (ret && IFQ_IS_EMPTY(&ifp->if_snd) == 0) - ex_start(ifp); + if (ret) + if_schedule_deferred_start(ifp); return ret; } Index: src/sys/dev/ic/gem.c diff -u src/sys/dev/ic/gem.c:1.107 src/sys/dev/ic/gem.c:1.108 --- src/sys/dev/ic/gem.c:1.107 Thu Dec 15 09:28:05 2016 +++ src/sys/dev/ic/gem.c Mon Feb 20 07:43:29 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: gem.c,v 1.107 2016/12/15 09:28:05 ozaki-r Exp $ */ +/* $NetBSD: gem.c,v 1.108 2017/02/20 07:43:29 ozaki-r Exp $ */ /* * @@ -37,7 +37,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: gem.c,v 1.107 2016/12/15 09:28:05 ozaki-r Exp $"); +__KERNEL_RCSID(0, "$NetBSD: gem.c,v 1.108 2017/02/20 07:43:29 ozaki-r Exp $"); #include "opt_inet.h" @@ -577,6 +577,7 @@ gem_attach(struct gem_softc *sc, const u /* Attach the interface. */ if_attach(ifp); + if_deferred_start_init(ifp, NULL); ether_ifattach(ifp, enaddr); ether_set_ifflags_cb(&sc->sc_ethercom, gem_ifflags_cb); @@ -1740,7 +1741,7 @@ gem_tint(struct gem_softc *sc) ifp->if_flags &= ~IFF_OACTIVE; sc->sc_if_flags = ifp->if_flags; ifp->if_timer = SIMPLEQ_EMPTY(&sc->sc_txdirtyq) ? 0 : 5; - gem_start(ifp); + if_schedule_deferred_start(ifp); } DPRINTF(sc, ("%s: gem_tint: watchdog %d\n", device_xname(sc->sc_dev), ifp->if_timer)); Index: src/sys/dev/ic/hd64570.c diff -u src/sys/dev/ic/hd64570.c:1.52 src/sys/dev/ic/hd64570.c:1.53 --- src/sys/dev/ic/hd64570.c:1.52 Tue Jan 24 09:05:28 2017 +++ src/sys/dev/ic/hd64570.c Mon Feb 20 07:43:29 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: hd64570.c,v 1.52 2017/01/24 09:05:28 ozaki-r Exp $ */ +/* $NetBSD: hd64570.c,v 1.53 2017/02/20 07:43:29 ozaki-r Exp $ */ /* * Copyright (c) 1999 Christian E. Hopps @@ -65,7 +65,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: hd64570.c,v 1.52 2017/01/24 09:05:28 ozaki-r Exp $"); +__KERNEL_RCSID(0, "$NetBSD: hd64570.c,v 1.53 2017/02/20 07:43:29 ozaki-r Exp $"); #include "opt_inet.h" @@ -455,6 +455,7 @@ sca_port_attach(struct sca_softc *sc, u_ #endif IFQ_SET_READY(&ifp->if_snd); if_attach(ifp); + if_deferred_start_init(ifp, NULL); if_alloc_sadl(ifp); bpf_attach(ifp, DLT_HDLC, HDLC_HDRLEN); bpf_mtap_softint_init(ifp); @@ -1304,7 +1305,7 @@ sca_dmac_intr(sca_port_t *scp, u_int8_t /* * check for more packets */ - sca_start(&scp->sp_if); + if_schedule_deferred_start(&scp->sp_if); } } } Index: src/sys/dev/ic/i82557.c diff -u src/sys/dev/ic/i82557.c:1.146 src/sys/dev/ic/i82557.c:1.147 --- src/sys/dev/ic/i82557.c:1.146 Thu Dec 15 09:28:05 2016 +++ src/sys/dev/ic/i82557.c Mon Feb 20 07:43:29 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: i82557.c,v 1.146 2016/12/15 09:28:05 ozaki-r Exp $ */ +/* $NetBSD: i82557.c,v 1.147 2017/02/20 07:43:29 ozaki-r Exp $ */ /*- * Copyright (c) 1997, 1998, 1999, 2001, 2002 The NetBSD Foundation, Inc. @@ -66,7 +66,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: i82557.c,v 1.146 2016/12/15 09:28:05 ozaki-r Exp $"); +__KERNEL_RCSID(0, "$NetBSD: i82557.c,v 1.147 2017/02/20 07:43:29 ozaki-r Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -407,6 +407,7 @@ fxp_attach(struct fxp_softc *sc) * Attach the interface. */ if_attach(ifp); + if_deferred_start_init(ifp, NULL); ether_ifattach(ifp, enaddr); rnd_attach_source(&sc->rnd_source, device_xname(sc->sc_dev), RND_TYPE_NET, RND_FLAG_DEFAULT); @@ -1120,7 +1121,7 @@ fxp_intr(void *arg) /* * Try to get more packets going. */ - fxp_start(ifp); + if_schedule_deferred_start(ifp); if (sc->sc_txpending == 0) { /* Index: src/sys/dev/ic/i82586.c diff -u src/sys/dev/ic/i82586.c:1.75 src/sys/dev/ic/i82586.c:1.76 --- src/sys/dev/ic/i82586.c:1.75 Thu Dec 15 09:28:05 2016 +++ src/sys/dev/ic/i82586.c Mon Feb 20 07:43:29 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: i82586.c,v 1.75 2016/12/15 09:28:05 ozaki-r Exp $ */ +/* $NetBSD: i82586.c,v 1.76 2017/02/20 07:43:29 ozaki-r Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -137,7 +137,7 @@ Mode of operation: */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: i82586.c,v 1.75 2016/12/15 09:28:05 ozaki-r Exp $"); +__KERNEL_RCSID(0, "$NetBSD: i82586.c,v 1.76 2017/02/20 07:43:29 ozaki-r Exp $"); #include <sys/param.h> @@ -271,6 +271,7 @@ i82586_attach(struct ie_softc *sc, const /* Attach the interface. */ if_attach(ifp); + if_deferred_start_init(ifp, NULL); ether_ifattach(ifp, etheraddr); aprint_normal(" address %s, type %s\n", ether_sprintf(etheraddr),name); @@ -736,7 +737,7 @@ i82586_tint(struct ie_softc *sc, int scb if (sc->xmit_busy > 0) iexmit(sc); - i82586_start(ifp); + if_schedule_deferred_start(ifp); return (0); } Index: src/sys/dev/ic/i82596.c diff -u src/sys/dev/ic/i82596.c:1.35 src/sys/dev/ic/i82596.c:1.36 --- src/sys/dev/ic/i82596.c:1.35 Thu Dec 15 09:28:05 2016 +++ src/sys/dev/ic/i82596.c Mon Feb 20 07:43:29 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: i82596.c,v 1.35 2016/12/15 09:28:05 ozaki-r Exp $ */ +/* $NetBSD: i82596.c,v 1.36 2017/02/20 07:43:29 ozaki-r Exp $ */ /* * Copyright (c) 2003 Jochen Kunz. @@ -43,7 +43,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: i82596.c,v 1.35 2016/12/15 09:28:05 ozaki-r Exp $"); +__KERNEL_RCSID(0, "$NetBSD: i82596.c,v 1.36 2017/02/20 07:43:29 ozaki-r Exp $"); /* autoconfig and device stuff */ #include <sys/param.h> @@ -383,7 +383,7 @@ iee_intr(void *intarg) (sc->sc_iee_cmd)(sc, IEE_SCB_CUC_EXE); } else /* Try to get deferred packets going. */ - iee_start(ifp); + if_schedule_deferred_start(ifp); } } if (IEE_SWAP32(SC_SCB(sc)->scb_crc_err) != sc->sc_crc_err) { @@ -663,6 +663,7 @@ iee_attach(struct iee_softc *sc, uint8_t sc->sc_ethercom.ec_capabilities |= ETHERCAP_VLAN_MTU; if_attach(ifp); + if_deferred_start_init(ifp, NULL); ether_ifattach(ifp, eth_addr); aprint_normal(": Intel 82596%s address %s\n", Index: src/sys/dev/ic/lan9118.c diff -u src/sys/dev/ic/lan9118.c:1.23 src/sys/dev/ic/lan9118.c:1.24 --- src/sys/dev/ic/lan9118.c:1.23 Thu Dec 15 09:28:05 2016 +++ src/sys/dev/ic/lan9118.c Mon Feb 20 07:43:29 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: lan9118.c,v 1.23 2016/12/15 09:28:05 ozaki-r Exp $ */ +/* $NetBSD: lan9118.c,v 1.24 2017/02/20 07:43:29 ozaki-r Exp $ */ /* * Copyright (c) 2008 KIYOHARA Takashi * All rights reserved. @@ -25,7 +25,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: lan9118.c,v 1.23 2016/12/15 09:28:05 ozaki-r Exp $"); +__KERNEL_RCSID(0, "$NetBSD: lan9118.c,v 1.24 2017/02/20 07:43:29 ozaki-r Exp $"); /* * The LAN9118 Family @@ -274,6 +274,7 @@ lan9118_attach(struct lan9118_softc *sc) /* Attach the interface. */ if_attach(ifp); + if_deferred_start_init(ifp, NULL); ether_ifattach(ifp, sc->sc_enaddr); callout_init(&sc->sc_tick, 0); @@ -332,8 +333,7 @@ lan9118_intr(void *arg) lan9118_rxintr(sc); } - if (!IFQ_IS_EMPTY(&ifp->if_snd)) - lan9118_start(ifp); + if_schedule_deferred_start(ifp); rnd_add_uint32(&sc->rnd_source, datum); Index: src/sys/dev/ic/mb86950.c diff -u src/sys/dev/ic/mb86950.c:1.25 src/sys/dev/ic/mb86950.c:1.26 --- src/sys/dev/ic/mb86950.c:1.25 Thu Dec 15 09:28:05 2016 +++ src/sys/dev/ic/mb86950.c Mon Feb 20 07:43:29 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: mb86950.c,v 1.25 2016/12/15 09:28:05 ozaki-r Exp $ */ +/* $NetBSD: mb86950.c,v 1.26 2017/02/20 07:43:29 ozaki-r Exp $ */ /* * All Rights Reserved, Copyright (C) Fujitsu Limited 1995 @@ -67,7 +67,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: mb86950.c,v 1.25 2016/12/15 09:28:05 ozaki-r Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mb86950.c,v 1.26 2017/02/20 07:43:29 ozaki-r Exp $"); /* * Device driver for Fujitsu mb86950 based Ethernet cards. @@ -287,6 +287,7 @@ mb86950_config(struct mb86950_softc *sc, /* Attach the interface. */ if_attach(ifp); + if_deferred_start_init(ifp, NULL); /* Feed the chip the station address. */ bus_space_write_region_1(bst, bsh, DLCR_NODE_ID, sc->sc_enaddr, ETHER_ADDR_LEN); @@ -720,7 +721,7 @@ mb86950_intr(void *arg) */ if ((ifp->if_flags & IFF_OACTIVE) == 0) - mb86950_start(ifp); + if_schedule_deferred_start(ifp); /* Set receive interrupts back */ bus_space_write_1(bst, bsh, DLCR_RX_INT_EN, RX_MASK); Index: src/sys/dev/ic/rtl81x9.c diff -u src/sys/dev/ic/rtl81x9.c:1.101 src/sys/dev/ic/rtl81x9.c:1.102 --- src/sys/dev/ic/rtl81x9.c:1.101 Thu Dec 15 09:28:05 2016 +++ src/sys/dev/ic/rtl81x9.c Mon Feb 20 07:43:29 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: rtl81x9.c,v 1.101 2016/12/15 09:28:05 ozaki-r Exp $ */ +/* $NetBSD: rtl81x9.c,v 1.102 2017/02/20 07:43:29 ozaki-r Exp $ */ /* * Copyright (c) 1997, 1998 @@ -86,7 +86,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: rtl81x9.c,v 1.101 2016/12/15 09:28:05 ozaki-r Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rtl81x9.c,v 1.102 2017/02/20 07:43:29 ozaki-r Exp $"); #include <sys/param.h> @@ -737,6 +737,7 @@ rtk_attach(struct rtk_softc *sc) * Call MI attach routines. */ if_attach(ifp); + if_deferred_start_init(ifp, NULL); ether_ifattach(ifp, eaddr); rnd_attach_source(&sc->rnd_source, device_xname(self), @@ -1200,8 +1201,7 @@ rtk_intr(void *arg) /* Re-enable interrupts. */ CSR_WRITE_2(sc, RTK_IMR, RTK_INTRS); - if (IFQ_IS_EMPTY(&ifp->if_snd) == 0) - rtk_start(ifp); + if_schedule_deferred_start(ifp); rnd_add_uint32(&sc->rnd_source, status); Index: src/sys/dev/ic/smc83c170.c diff -u src/sys/dev/ic/smc83c170.c:1.84 src/sys/dev/ic/smc83c170.c:1.85 --- src/sys/dev/ic/smc83c170.c:1.84 Thu Dec 15 09:28:05 2016 +++ src/sys/dev/ic/smc83c170.c Mon Feb 20 07:43:29 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: smc83c170.c,v 1.84 2016/12/15 09:28:05 ozaki-r Exp $ */ +/* $NetBSD: smc83c170.c,v 1.85 2017/02/20 07:43:29 ozaki-r 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.84 2016/12/15 09:28:05 ozaki-r Exp $"); +__KERNEL_RCSID(0, "$NetBSD: smc83c170.c,v 1.85 2017/02/20 07:43:29 ozaki-r Exp $"); #include <sys/param.h> @@ -291,6 +291,7 @@ epic_attach(struct epic_softc *sc) * Attach the interface. */ if_attach(ifp); + if_deferred_start_init(ifp, NULL); ether_ifattach(ifp, enaddr); /* @@ -797,7 +798,7 @@ epic_intr(void *arg) /* * Try to get more packets going. */ - epic_start(ifp); + if_schedule_deferred_start(ifp); } /*