From 7eb12306d655acf3ae93902abbcfdbf40253a238 Mon Sep 17 00:00:00 2001 From: Pyun YongHyeon Date: Fri, 18 Jan 2008 08:32:08 +0000 Subject: [PATCH] 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. --- sys/dev/stge/if_stge.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/stge/if_stge.c b/sys/dev/stge/if_stge.c index c397103bdf1..e78ff25ab48 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;