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

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/9/sys/dev/re/if_re.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/amd64/include/xen/   (props changed)
  stable/9/sys/boot/   (props changed)
  stable/9/sys/boot/i386/efi/   (props changed)
  stable/9/sys/boot/ia64/efi/   (props changed)
  stable/9/sys/boot/ia64/ski/   (props changed)
  stable/9/sys/boot/powerpc/boot1.chrp/   (props changed)
  stable/9/sys/boot/powerpc/ofw/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)
  stable/9/sys/conf/   (props changed)
  stable/9/sys/contrib/dev/acpica/   (props changed)
  stable/9/sys/contrib/octeon-sdk/   (props changed)
  stable/9/sys/contrib/pf/   (props changed)
  stable/9/sys/contrib/x86emu/   (props changed)

Modified: stable/9/sys/dev/re/if_re.c
==============================================================================
--- stable/9/sys/dev/re/if_re.c Wed Feb 15 03:35:39 2012        (r231727)
+++ stable/9/sys/dev/re/if_re.c Wed Feb 15 03:41:48 2012        (r231728)
@@ -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;
+                       }
+               }
+       }
 }
 
 /*
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to