aboutsummaryrefslogtreecommitdiff
path: root/sys/pci
diff options
context:
space:
mode:
authorRuslan Ermilov <ru@FreeBSD.org>2004-03-30 19:23:38 +0000
committerRuslan Ermilov <ru@FreeBSD.org>2004-03-30 19:23:38 +0000
commit3b6b14d465bb8f1dfb83a99e1a5f647efba0fa30 (patch)
tree86d92812f4f993a6e6d348a589a72a3fee995a21 /sys/pci
parent06dd89cd02b40daf0441303da2a559081b985552 (diff)
downloadsrc-3b6b14d465bb8f1dfb83a99e1a5f647efba0fa30.tar.gz
src-3b6b14d465bb8f1dfb83a99e1a5f647efba0fa30.zip
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
Notes
Notes: svn path=/head/; revision=127634
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 6dbf22297541..8982f4ef3574 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;
}