From owner-svn-src-stable@FreeBSD.ORG Tue Dec 15 10:36:09 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 112611065696; Tue, 15 Dec 2009 10:36:09 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DAC3E8FC21; Tue, 15 Dec 2009 10:36:08 +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 nBFAa8Ww060899; Tue, 15 Dec 2009 10:36:08 GMT (envelope-from stas@svn.freebsd.org) Received: (from stas@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBFAa8h5060897; Tue, 15 Dec 2009 10:36:08 GMT (envelope-from stas@svn.freebsd.org) Message-Id: <200912151036.nBFAa8h5060897@svn.freebsd.org> From: Stanislav Sedov Date: Tue, 15 Dec 2009 10:36:08 +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: r200571 - stable/7/sys/dev/bge X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Dec 2009 10:36:09 -0000 Author: stas Date: Tue Dec 15 10:36:08 2009 New Revision: 200571 URL: http://svn.freebsd.org/changeset/base/200571 Log: - MFC r198318: - On entrance to the rx_eof sync RX rings maps with POSTWRITE flag instead of POSTREAD: the hardware do not touch this memory (CPU updates it). It is already synchronized as PREWRITE after the processing is done. - Synchronize RX return ring memory in rx_eof. This is needed as the deviced updates this memory when receives packets. - Decouple the synchronization of BGE status block in the interrupt service routine: perfrom PREREAD synchronization only all accesses to this block are finished. This seems to be more natural. 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 Tue Dec 15 10:34:05 2009 (r200570) +++ stable/7/sys/dev/bge/if_bge.c Tue Dec 15 10:36:08 2009 (r200571) @@ -3120,10 +3120,10 @@ bge_rxeof(struct bge_softc *sc) bus_dmamap_sync(sc->bge_cdata.bge_rx_return_ring_tag, sc->bge_cdata.bge_rx_return_ring_map, BUS_DMASYNC_POSTREAD); bus_dmamap_sync(sc->bge_cdata.bge_rx_std_ring_tag, - sc->bge_cdata.bge_rx_std_ring_map, BUS_DMASYNC_POSTREAD); + sc->bge_cdata.bge_rx_std_ring_map, BUS_DMASYNC_POSTWRITE); if (BGE_IS_JUMBO_CAPABLE(sc)) bus_dmamap_sync(sc->bge_cdata.bge_rx_jumbo_ring_tag, - sc->bge_cdata.bge_rx_jumbo_ring_map, BUS_DMASYNC_POSTREAD); + sc->bge_cdata.bge_rx_jumbo_ring_map, BUS_DMASYNC_POSTWRITE); while(sc->bge_rx_saved_considx != sc->bge_ldata.bge_status_block->bge_idx[0].bge_rx_prod_idx) { @@ -3250,6 +3250,8 @@ bge_rxeof(struct bge_softc *sc) return; } + bus_dmamap_sync(sc->bge_cdata.bge_rx_return_ring_tag, + sc->bge_cdata.bge_rx_return_ring_map, BUS_DMASYNC_PREREAD); if (stdcnt > 0) bus_dmamap_sync(sc->bge_cdata.bge_rx_std_ring_tag, sc->bge_cdata.bge_rx_std_ring_map, BUS_DMASYNC_PREWRITE); @@ -3418,8 +3420,6 @@ bge_intr(void *xsc) /* Make sure the descriptor ring indexes are coherent. */ bus_dmamap_sync(sc->bge_cdata.bge_status_tag, sc->bge_cdata.bge_status_map, BUS_DMASYNC_POSTREAD); - bus_dmamap_sync(sc->bge_cdata.bge_status_tag, - sc->bge_cdata.bge_status_map, BUS_DMASYNC_PREREAD); if ((sc->bge_asicrev == BGE_ASICREV_BCM5700 && sc->bge_chipid != BGE_CHIPID_BCM5700_B2) || @@ -3440,6 +3440,9 @@ bge_intr(void *xsc) !IFQ_DRV_IS_EMPTY(&ifp->if_snd)) bge_start_locked(ifp); + bus_dmamap_sync(sc->bge_cdata.bge_status_tag, + sc->bge_cdata.bge_status_map, BUS_DMASYNC_PREREAD); + BGE_UNLOCK(sc); }