summaryrefslogtreecommitdiffstats
path: root/sys/dev/stge
diff options
context:
space:
mode:
authoryongari <yongari@FreeBSD.org>2008-01-18 08:32:08 +0000
committeryongari <yongari@FreeBSD.org>2008-01-18 08:32:08 +0000
commitc138b43f21961dbc95d48117d8a6dbdf2c6c90cf (patch)
tree50e30144bb34c2a49421adb95eef851b3f678b1f /sys/dev/stge
parent80ec49a2cfa42274e966bd730533a2befe3290a3 (diff)
downloadFreeBSD-src-c138b43f21961dbc95d48117d8a6dbdf2c6c90cf.zip
FreeBSD-src-c138b43f21961dbc95d48117d8a6dbdf2c6c90cf.tar.gz
Use m_collapse(9) to collapse mbuf chains instead of relying on
shortest possible chain of mbufs of m_defrag(9). What we want is chains of mbufs that can be safely stored to a Tx descriptor which can have up to STGE_MAXTXSEGS mbufs. The ethernet controller does not need to align Tx buffers on 32bit boundary. So the use of m_defrag(9) was waste of time.
Diffstat (limited to 'sys/dev/stge')
-rw-r--r--sys/dev/stge/if_stge.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/dev/stge/if_stge.c b/sys/dev/stge/if_stge.c
index c397103..e78ff25ab 100644
--- a/sys/dev/stge/if_stge.c
+++ b/sys/dev/stge/if_stge.c
@@ -1229,7 +1229,7 @@ stge_encap(struct stge_softc *sc, struct mbuf **m_head)
error = bus_dmamap_load_mbuf_sg(sc->sc_cdata.stge_tx_tag,
txd->tx_dmamap, *m_head, txsegs, &nsegs, 0);
if (error == EFBIG) {
- m = m_defrag(*m_head, M_DONTWAIT);
+ m = m_collapse(*m_head, M_DONTWAIT, STGE_MAXTXSEGS);
if (m == NULL) {
m_freem(*m_head);
*m_head = NULL;
OpenPOWER on IntegriCloud