Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F107172989
D4754.id11878.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D4754.id11878.diff
View Options
Index: sys/dev/iwm/if_iwm.c
===================================================================
--- sys/dev/iwm/if_iwm.c
+++ 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
Details
Attached
Mime Type
text/plain
Expires
Sun, Jan 12, 5:49 AM (19 h, 8 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15762042
Default Alt Text
D4754.id11878.diff (1 KB)
Attached To
Mode
D4754: iwm: use m_collapse() to defragment a mbuf chain
Attached
Detach File
Event Timeline
Log In to Comment