Page MenuHomeFreeBSD

D4754.diff
No OneTemporary

D4754.diff

Index: head/sys/dev/iwm/if_iwm.c
===================================================================
--- head/sys/dev/iwm/if_iwm.c
+++ head/sys/dev/iwm/if_iwm.c
@@ -956,7 +956,7 @@
error = bus_dma_tag_create(sc->sc_dmat, 1, 0,
BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, MCLBYTES,
- IWM_MAX_SCATTER - 1, MCLBYTES, 0, NULL, NULL, &ring->data_dmat);
+ IWM_MAX_SCATTER - 2, MCLBYTES, 0, NULL, NULL, &ring->data_dmat);
if (error != 0) {
device_printf(sc->sc_dev, "could not create TX buf DMA tag\n");
goto fail;
@@ -2778,23 +2778,15 @@
return error;
}
/* Too many DMA segments, linearize mbuf. */
- MGETHDR(m1, M_NOWAIT, MT_DATA);
+ m1 = m_collapse(m, M_NOWAIT, IWM_MAX_SCATTER - 2);
if (m1 == NULL) {
+ device_printf(sc->sc_dev,
+ "%s: could not defrag mbuf\n", __func__);
m_freem(m);
- return ENOBUFS;
- }
- if (m->m_pkthdr.len > MHLEN) {
- MCLGET(m1, M_NOWAIT);
- if (!(m1->m_flags & M_EXT)) {
- m_freem(m);
- m_freem(m1);
- return ENOBUFS;
- }
+ return (ENOBUFS);
}
- m_copydata(m, 0, m->m_pkthdr.len, mtod(m1, void *));
- m1->m_pkthdr.len = m1->m_len = m->m_pkthdr.len;
- m_freem(m);
m = m1;
+
error = bus_dmamap_load_mbuf_sg(ring->data_dmat, data->map, m,
segs, &nsegs, BUS_DMA_NOWAIT);
if (error != 0) {

File Metadata

Mime Type
text/plain
Expires
Sun, Jan 12, 2:33 AM (15 h, 53 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15760126
Default Alt Text
D4754.diff (1 KB)

Event Timeline