On Wed, Jan 06, 2016 at 16:37 +0100, Mike Belopuhov wrote:
> There's still stuff to do, but it receives and transmits reliably
> (at least on modern Xen) so I'd like to get it in.  Man page will
> follow.
> 
> OK?
>

Just noticed that a couple of debug printfs have sneaked in.
I'm not going to commit them.

> +void
> +xnf_rx_ring_destroy(struct xnf_softc *sc)
> +{
> +     int i, slots = 0;
> +
> +     for (i = 0; i < XNF_RX_DESC; i++) {
> +             if (sc->sc_rx_buf[i] == NULL)
> +                     continue;
> +             bus_dmamap_unload(sc->sc_dmat, sc->sc_rx_dmap[i]);
> +             m_freem(sc->sc_rx_buf[i]);
> +             sc->sc_rx_buf[i] = NULL;
> +             slots++;
> +     }
> +     printf("%s: unload done\n", __func__);
> +     if_rxr_put(&sc->sc_rx_slots, slots);
> +     printf("%s: rxr_put done\n", __func__);
> +
> +     for (i = 0; i < XNF_RX_DESC; i++) {
> +             if (sc->sc_rx_dmap[i] == NULL)
> +                     continue;
> +             bus_dmamap_destroy(sc->sc_dmat, sc->sc_rx_dmap[i]);
> +             sc->sc_rx_dmap[i] = NULL;
> +     }
> +     printf("%s: desc map destroy done\n", __func__);
> +     if (sc->sc_rx_rmap) {
> +             bus_dmamap_unload(sc->sc_dmat, sc->sc_rx_rmap);
> +             bus_dmamap_destroy(sc->sc_dmat, sc->sc_rx_rmap);
> +     }
> +     printf("%s: ring map destroy done\n", __func__);
> +     if (sc->sc_rx_ring) {
> +             bus_dmamem_unmap(sc->sc_dmat, (caddr_t)sc->sc_rx_ring,
> +                 PAGE_SIZE);
> +             bus_dmamem_free(sc->sc_dmat, &sc->sc_rx_seg, 1);
> +     }
> +     printf("%s: ring mem free done\n", __func__);
> +     sc->sc_rx_ring = NULL;
> +     sc->sc_rx_rmap = NULL;
> +     sc->sc_rx_cons = 0;
> +}
> +

Reply via email to