From owner-svn-src-all@FreeBSD.ORG Wed Nov 4 18:18:10 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F39A41065670; Wed, 4 Nov 2009 18:18: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 7537B8FC1B; Wed, 4 Nov 2009 18:18:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nA4II9Iu041610; Wed, 4 Nov 2009 18:18:09 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nA4II9R2041608; Wed, 4 Nov 2009 18:18:09 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200911041818.nA4II9R2041608@svn.freebsd.org> From: Pyun YongHyeon Date: Wed, 4 Nov 2009 18:18:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198916 - stable/7/sys/dev/fxp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Nov 2009 18:18:10 -0000 Author: yongari Date: Wed Nov 4 18:18:09 2009 New Revision: 198916 URL: http://svn.freebsd.org/changeset/base/198916 Log: MFC r194572: Always check fxp(4) is running, see if it can accept frames from upper stack in fxp_start_body(). fxp(4) drops driver lock in Rx path so check the fxp(4) is still running after reacquiring driver lock in Rx path. Also don't invoke fxp_intr_body if fxp(4) is not running. With this change there is no need to set suspend bit in device attach phase. Modified: stable/7/sys/dev/fxp/if_fxp.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/fxp/if_fxp.c ============================================================================== --- stable/7/sys/dev/fxp/if_fxp.c Wed Nov 4 18:14:19 2009 (r198915) +++ stable/7/sys/dev/fxp/if_fxp.c Wed Nov 4 18:18:09 2009 (r198916) @@ -993,7 +993,6 @@ fxp_detach(device_t dev) #endif FXP_LOCK(sc); - sc->suspended = 1; /* Do same thing as we do for suspend */ /* * Stop DMA and drop transmit queue, but disable interrupts first. */ @@ -1320,6 +1319,10 @@ fxp_start_body(struct ifnet *ifp) if (sc->need_mcsetup) return; + if ((ifp->if_drv_flags & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) != + IFF_DRV_RUNNING) + return; + if (sc->tx_queued > FXP_NTXCB_HIWAT) fxp_txeof(sc); /* @@ -1726,7 +1729,8 @@ fxp_intr(void *xsc) * First ACK all the interrupts in this pass. */ CSR_WRITE_1(sc, FXP_CSR_SCB_STATACK, statack); - fxp_intr_body(sc, ifp, statack, -1); + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) + fxp_intr_body(sc, ifp, statack, -1); } FXP_UNLOCK(sc); } @@ -1982,6 +1986,8 @@ fxp_intr_body(struct fxp_softc *sc, stru FXP_UNLOCK(sc); (*ifp->if_input)(ifp, m); FXP_LOCK(sc); + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) + return; } else { /* Reuse RFA and loaded DMA map. */ ifp->if_iqdrops++; @@ -2064,7 +2070,8 @@ fxp_tick(void *xsc) */ if (sc->rx_idle_secs > FXP_MAX_RX_IDLE) { sc->rx_idle_secs = 0; - fxp_mc_setup(sc); + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) + fxp_mc_setup(sc); } /* * If there is no pending command, start another stats