summaryrefslogtreecommitdiffstats
path: root/sys/pci
diff options
context:
space:
mode:
authorru <ru@FreeBSD.org>2004-03-30 19:23:38 +0000
committerru <ru@FreeBSD.org>2004-03-30 19:23:38 +0000
commitd02badc7e2bc65c3c1dd94d640c973ae1e0ab3e2 (patch)
tree86d92812f4f993a6e6d348a589a72a3fee995a21 /sys/pci
parent32f32cef568ed3a68cb9839bf992fa4aea73cb2c (diff)
downloadFreeBSD-src-d02badc7e2bc65c3c1dd94d640c973ae1e0ab3e2.zip
FreeBSD-src-d02badc7e2bc65c3c1dd94d640c973ae1e0ab3e2.tar.gz
Switch ste_encap() over to using m_defrag().
No functional change, the previous ste_encap() was correct WRT long mbuf chains; this just reduces code duplication. MFC after: 3 days Prodded by: ambrisko
Diffstat (limited to 'sys/pci')
-rw-r--r--sys/pci/if_ste.c16
1 files changed, 2 insertions, 14 deletions
diff --git a/sys/pci/if_ste.c b/sys/pci/if_ste.c
index 6dbf222..8982f4e 100644
--- a/sys/pci/if_ste.c
+++ b/sys/pci/if_ste.c
@@ -1493,25 +1493,13 @@ encap_retry:
/*
* We ran out of segments. We have to recopy this
* mbuf chain first. Bail out if we can't get the
- * new buffers. Code borrowed from if_fxp.c
+ * new buffers.
*/
- MGETHDR(mn, M_DONTWAIT, MT_DATA);
+ mn = m_defrag(m_head, M_DONTWAIT);
if (mn == NULL) {
m_freem(m_head);
return ENOMEM;
}
- if (m_head->m_pkthdr.len > MHLEN) {
- MCLGET(mn, M_DONTWAIT);
- if ((mn->m_flags & M_EXT) == 0) {
- m_freem(mn);
- m_freem(m_head);
- return ENOMEM;
- }
- }
- m_copydata(m_head, 0, m_head->m_pkthdr.len,
- mtod(mn, caddr_t));
- mn->m_pkthdr.len = mn->m_len = m_head->m_pkthdr.len;
- m_freem(m_head);
m_head = mn;
goto encap_retry;
}
OpenPOWER on IntegriCloud