summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authoryongari <yongari@FreeBSD.org>2010-01-15 17:55:18 +0000
committeryongari <yongari@FreeBSD.org>2010-01-15 17:55:18 +0000
commitce17bd0e8ca5e9c7e16f800357a7a3a4598a254e (patch)
treedd0197b904ddcbcef42510e744bb4d6e6e28fb4a /sys
parent1a19fc806c79b22b5f74c37f6686ea202cd20a2f (diff)
downloadFreeBSD-src-ce17bd0e8ca5e9c7e16f800357a7a3a4598a254e.zip
FreeBSD-src-ce17bd0e8ca5e9c7e16f800357a7a3a4598a254e.tar.gz
Don't free mbuf chains when bge(4) fails to collapse the mbuf
chains. This part of code is to enhance performance so failing the collapsing should not free TX frames. Otherwise bge(4) will unnecessarily drop frames which in turn can freeze the network connection. Reported by: Igor Sysoev (is <> rambler-co dot ru) Tested by: Igor Sysoev (is <> rambler-co dot ru)
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/bge/if_bge.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/sys/dev/bge/if_bge.c b/sys/dev/bge/if_bge.c
index 85f0302..b321d79 100644
--- a/sys/dev/bge/if_bge.c
+++ b/sys/dev/bge/if_bge.c
@@ -3950,11 +3950,8 @@ bge_encap(struct bge_softc *sc, struct mbuf **m_head, uint32_t *txidx)
m = m_defrag(m, M_DONTWAIT);
else
m = m_collapse(m, M_DONTWAIT, sc->bge_forced_collapse);
- if (m == NULL) {
- m_freem(*m_head);
- *m_head = NULL;
- return (ENOBUFS);
- }
+ if (m == NULL)
+ m = *m_head;
*m_head = m;
}
OpenPOWER on IntegriCloud