From owner-svn-src-stable-8@FreeBSD.ORG Fri May 27 18:58:09 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 53C96106566B; Fri, 27 May 2011 18:58:09 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 296E18FC0C; Fri, 27 May 2011 18:58:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4RIw95v048072; Fri, 27 May 2011 18:58:09 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4RIw90k048070; Fri, 27 May 2011 18:58:09 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201105271858.p4RIw90k048070@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 27 May 2011 18:58:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222371 - stable/8/sys/dev/gem X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2011 18:58:09 -0000 Author: yongari Date: Fri May 27 18:58:08 2011 New Revision: 222371 URL: http://svn.freebsd.org/changeset/base/222371 Log: MFC r222135: Remove unnecessary controller reinitialization by checking IFF_DRV_RUNNING flag. Previously running dhclient or adding alias addresses reinitialized controller and it resulted in unnecessary link flips. Modified: stable/8/sys/dev/gem/if_gem.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/gem/if_gem.c ============================================================================== --- stable/8/sys/dev/gem/if_gem.c Fri May 27 18:47:48 2011 (r222370) +++ stable/8/sys/dev/gem/if_gem.c Fri May 27 18:58:08 2011 (r222371) @@ -739,8 +739,10 @@ gem_reset_rxdma(struct gem_softc *sc) { int i; - if (gem_reset_rx(sc) != 0) + if (gem_reset_rx(sc) != 0) { + sc->sc_ifp->if_drv_flags &= ~IFF_DRV_RUNNING; return (gem_init_locked(sc)); + } for (i = 0; i < GEM_NRXDESC; i++) if (sc->sc_rxsoft[i].rxs_mbuf != NULL) GEM_UPDATE_RXDESC(sc, i); @@ -924,6 +926,9 @@ gem_init_locked(struct gem_softc *sc) GEM_LOCK_ASSERT(sc, MA_OWNED); + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) + return; + #ifdef GEM_DEBUG CTR2(KTR_GEM, "%s: %s: calling stop", device_get_name(sc->sc_dev), __func__); @@ -1762,6 +1767,7 @@ gem_intr(void *v) if ((status2 & (GEM_MAC_TX_UNDERRUN | GEM_MAC_TX_PKT_TOO_LONG)) != 0) { sc->sc_ifp->if_oerrors++; + sc->sc_ifp->if_drv_flags &= ~IFF_DRV_RUNNING; gem_init_locked(sc); } } @@ -1814,6 +1820,7 @@ gem_watchdog(struct gem_softc *sc) ++ifp->if_oerrors; /* Try to get more packets going. */ + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; gem_init_locked(sc); gem_start_locked(ifp); return (EJUSTRETURN);