Date: Fri, 12 Nov 2004 00:46:19 GMT From: Sam Leffler <sam@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 64927 for review Message-ID: <200411120046.iAC0kJ09053131@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=64927 Change 64927 by sam@sam_ebb on 2004/11/12 00:46:02 o add some assertions to track bus_dma failures (need to recover but for now at least catch them)) o add debug code to watch for whomever is smashing m_next in rx mbufs Affected files ... .. //depot/projects/wifi/sys/dev/ath/if_ath.c#19 edit Differences ... ==== //depot/projects/wifi/sys/dev/ath/if_ath.c#19 (text+ko) ==== @@ -1561,7 +1561,9 @@ struct ath_buf *bf = arg; KASSERT(nseg <= ATH_MAX_SCATTER, - ("ath_mbuf_load_cb: too many DMA segments %u", nseg)); + ("%s: too many DMA segments %u", __func__, nseg)); + KASSERT(error == 0, + ("%s: error %u on bus_dma callback", __func__, error)); bf->bf_mapsize = mapsize; bf->bf_nseg = nseg; bcopy(seg, bf->bf_segs, nseg * sizeof (seg[0])); @@ -1676,6 +1678,7 @@ else ath_setslottime(sc); } +} /* * Allocate and setup an initial beacon frame. @@ -1942,6 +1945,8 @@ ath_load_cb(void *arg, bus_dma_segment_t *segs, int nsegs, int error) { bus_addr_t *paddr = (bus_addr_t*) arg; + KASSERT(error == 0, + ("%s: error %u on bus_dma callback", __func__, error)); *paddr = segs->ds_addr; } @@ -2154,9 +2159,11 @@ struct ath_hal *ah = sc->sc_ah; int error; struct mbuf *m; +struct mbuf *morig; /*XXX*/ struct ath_desc *ds; m = bf->bf_m; +morig = m; /* XXX */ if (m == NULL) { /* * NB: by assigning a page to the rx dma buffer we @@ -2172,6 +2179,7 @@ sc->sc_stats.ast_rx_nombuf++; return ENOMEM; } + KASSERT(m->m_next == NULL, ("m_next %p (1)", m->m_next)); bf->bf_m = m; m->m_pkthdr.len = m->m_len = m->m_ext.ext_size; @@ -2188,6 +2196,7 @@ KASSERT(bf->bf_nseg == 1, ("%s: multi-segment packet; nseg %u", __func__, bf->bf_nseg)); } + KASSERT(m->m_next == NULL, ("m_next %p morig %p (2)", m->m_next, morig)); bus_dmamap_sync(sc->sc_dmat, bf->bf_dmamap, BUS_DMASYNC_PREREAD); /* @@ -2333,6 +2342,10 @@ #endif if (status == HAL_EINPROGRESS) break; + if (m->m_next != NULL) { /* XXX */ + if_printf(ifp, "m_next %p, patching!\n", m->m_next); + m->m_next = NULL; + } STAILQ_REMOVE_HEAD(&sc->sc_rxbuf, bf_list); if (ds->ds_rxstat.rs_more) { /* @@ -2401,6 +2414,7 @@ goto rx_next; } rx_accept: + KASSERT(m->m_next == NULL, ("m_next %p (3)", m->m_next)); /* * Sync and unmap the frame. At this point we're * committed to passing the mbuf somewhere so clear
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200411120046.iAC0kJ09053131>