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.
This commit is contained in:
Pyun YongHyeon 2008-01-18 08:32:08 +00:00
parent 00d6ac63cd
commit 7eb12306d6
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=175430

View file

@ -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;