svn commit: r231729 - stable/8/sys/dev/re

Pyun YongHyeon yongari at FreeBSD.org
Wed Feb 15 03:43:04 UTC 2012


Author: yongari
Date: Wed Feb 15 03:43:03 2012
New Revision: 231729
URL: http://svn.freebsd.org/changeset/base/231729

Log:
  MFC r230575-230576:
  r230275:
    Use a RX DMA tag to free loaded RX DMA maps.
    Previously it used a TX DMA tag.
  
  r230276:
    Free allocated jumbo buffers when controller is stopped.

Modified:
  stable/8/sys/dev/re/if_re.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/boot/   (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)
  stable/8/sys/dev/e1000/   (props changed)

Modified: stable/8/sys/dev/re/if_re.c
==============================================================================
--- stable/8/sys/dev/re/if_re.c	Wed Feb 15 03:41:48 2012	(r231728)
+++ stable/8/sys/dev/re/if_re.c	Wed Feb 15 03:43:03 2012	(r231729)
@@ -3515,7 +3515,6 @@ re_stop(struct rl_softc *sc)
 	}
 
 	/* Free the TX list buffers. */
-
 	for (i = 0; i < sc->rl_ldata.rl_tx_desc_cnt; i++) {
 		txd = &sc->rl_ldata.rl_tx_desc[i];
 		if (txd->tx_m != NULL) {
@@ -3529,11 +3528,10 @@ re_stop(struct rl_softc *sc)
 	}
 
 	/* Free the RX list buffers. */
-
 	for (i = 0; i < sc->rl_ldata.rl_rx_desc_cnt; i++) {
 		rxd = &sc->rl_ldata.rl_rx_desc[i];
 		if (rxd->rx_m != NULL) {
-			bus_dmamap_sync(sc->rl_ldata.rl_tx_mtag,
+			bus_dmamap_sync(sc->rl_ldata.rl_rx_mtag,
 			    rxd->rx_dmamap, BUS_DMASYNC_POSTREAD);
 			bus_dmamap_unload(sc->rl_ldata.rl_rx_mtag,
 			    rxd->rx_dmamap);
@@ -3541,6 +3539,20 @@ re_stop(struct rl_softc *sc)
 			rxd->rx_m = NULL;
 		}
 	}
+
+	if ((sc->rl_flags & RL_FLAG_JUMBOV2) != 0) {
+		for (i = 0; i < sc->rl_ldata.rl_rx_desc_cnt; i++) {
+			rxd = &sc->rl_ldata.rl_jrx_desc[i];
+			if (rxd->rx_m != NULL) {
+				bus_dmamap_sync(sc->rl_ldata.rl_jrx_mtag,
+				    rxd->rx_dmamap, BUS_DMASYNC_POSTREAD);
+				bus_dmamap_unload(sc->rl_ldata.rl_jrx_mtag,
+				    rxd->rx_dmamap);
+				m_freem(rxd->rx_m);
+				rxd->rx_m = NULL;
+			}
+		}
+	}
 }
 
 /*


More information about the svn-src-stable-8 mailing list