Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 8 Oct 2010 18:51:28 +0000 (UTC)
From:      Pyun YongHyeon <yongari@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
Subject:   svn commit: r213596 - stable/7/sys/dev/bge
Message-ID:  <201010081851.o98IpSTf003870@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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,



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201010081851.o98IpSTf003870>