From owner-svn-src-all@FreeBSD.ORG Fri Oct 8 18:51:29 2010 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 DF27A106566C; Fri, 8 Oct 2010 18:51:28 +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 B3DB88FC19; Fri, 8 Oct 2010 18:51:28 +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 o98IpSbk003872; Fri, 8 Oct 2010 18:51:28 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o98IpSTf003870; Fri, 8 Oct 2010 18:51:28 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201010081851.o98IpSTf003870@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 8 Oct 2010 18:51:28 +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: r213596 - stable/7/sys/dev/bge 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: Fri, 08 Oct 2010 18:51:29 -0000 Author: yongari Date: Fri Oct 8 18:51:28 2010 New Revision: 213596 URL: http://svn.freebsd.org/changeset/base/213596 Log: MFC r212069,212071: r212069: bge_txeof() already checks whether it has to free transmitted mbufs or not by comparing reported TX consumer index with saved index. So remove unnecessary check done after freeing transmitted mbufs. While I'm here nuke unnecessary variable initializations. r212071: Remove unnecessary atomic operation in bge_poll. bge(4) always holds a driver lock in the function entry and memory synchronization is handled by bus_dmamap_sync(9). Modified: stable/7/sys/dev/bge/if_bge.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/bge/if_bge.c ============================================================================== --- stable/7/sys/dev/bge/if_bge.c Fri Oct 8 18:49:59 2010 (r213595) +++ stable/7/sys/dev/bge/if_bge.c Fri Oct 8 18:51:28 2010 (r213596) @@ -3403,7 +3403,7 @@ bge_rxeof(struct bge_softc *sc, uint16_t static void bge_txeof(struct bge_softc *sc, uint16_t tx_cons) { - struct bge_tx_bd *cur_tx = NULL; + struct bge_tx_bd *cur_tx; struct ifnet *ifp; BGE_LOCK_ASSERT(sc); @@ -3421,7 +3421,7 @@ bge_txeof(struct bge_softc *sc, uint16_t * frames that have been sent. */ while (sc->bge_tx_saved_considx != tx_cons) { - uint32_t idx = 0; + uint32_t idx; idx = sc->bge_tx_saved_considx; cur_tx = &sc->bge_ldata.bge_tx_ring[idx]; @@ -3440,8 +3440,7 @@ bge_txeof(struct bge_softc *sc, uint16_t BGE_INC(sc->bge_tx_saved_considx, BGE_TX_RING_CNT); } - if (cur_tx != NULL) - ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; if (sc->bge_txcnt == 0) sc->bge_timer = 0; } @@ -3466,8 +3465,8 @@ bge_poll(struct ifnet *ifp, enum poll_cm rx_prod = sc->bge_ldata.bge_status_block->bge_idx[0].bge_rx_prod_idx; tx_cons = sc->bge_ldata.bge_status_block->bge_idx[0].bge_tx_cons_idx; - statusword = atomic_readandclear_32( - &sc->bge_ldata.bge_status_block->bge_status); + statusword = sc->bge_ldata.bge_status_block->bge_status; + sc->bge_ldata.bge_status_block->bge_status = 0; bus_dmamap_sync(sc->bge_cdata.bge_status_tag, sc->bge_cdata.bge_status_map,