svn commit: r230276 - head/sys/dev/re

Pyun YongHyeon yongari at FreeBSD.org
Tue Jan 17 19:36:54 UTC 2012


Author: yongari
Date: Tue Jan 17 19:36:53 2012
New Revision: 230276
URL: http://svn.freebsd.org/changeset/base/230276

Log:
  Free allocated jumbo buffers when controller is stopped.

Modified:
  head/sys/dev/re/if_re.c

Modified: head/sys/dev/re/if_re.c
==============================================================================
--- head/sys/dev/re/if_re.c	Tue Jan 17 19:31:03 2012	(r230275)
+++ head/sys/dev/re/if_re.c	Tue Jan 17 19:36:53 2012	(r230276)
@@ -3558,7 +3558,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) {
@@ -3572,7 +3571,6 @@ 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) {
@@ -3584,6 +3582,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-all mailing list