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;
+                       }
+               }
+       }
 }
 
 /*
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to