diff options
author | silby <silby@FreeBSD.org> | 2003-03-29 21:39:49 +0000 |
---|---|---|
committer | silby <silby@FreeBSD.org> | 2003-03-29 21:39:49 +0000 |
commit | f932a709c1ab4f02d50cfaef926ad44c6bb48597 (patch) | |
tree | c8e0c55b2af8a88e4714b81a12e6c081ea4a2a98 /sys/pci | |
parent | 42b820007d1966e1cd1957d7bd4ae681a63f1a03 (diff) | |
download | FreeBSD-src-f932a709c1ab4f02d50cfaef926ad44c6bb48597.zip FreeBSD-src-f932a709c1ab4f02d50cfaef926ad44c6bb48597.tar.gz |
Switch vr_encap over to using m_defrag instead of its own version
of the function.
No functional change, this driver already handled long mbuf chains
correctly.
MFC after: 2 weeks
Diffstat (limited to 'sys/pci')
-rw-r--r-- | sys/pci/if_vr.c | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/sys/pci/if_vr.c b/sys/pci/if_vr.c index 95e4670..6611da4 100644 --- a/sys/pci/if_vr.c +++ b/sys/pci/if_vr.c @@ -1423,24 +1423,12 @@ vr_encap(sc, c, m_head) if (m != NULL) { struct mbuf *m_new = NULL; - MGETHDR(m_new, M_DONTWAIT, MT_DATA); + m_new = m_defrag(m_head, M_DONTWAIT); if (m_new == NULL) { printf("vr%d: no memory for tx list\n", sc->vr_unit); return(1); } - if (m_head->m_pkthdr.len > MHLEN) { - MCLGET(m_new, M_DONTWAIT); - if (!(m_new->m_flags & M_EXT)) { - m_freem(m_new); - printf("vr%d: no memory for tx list\n", - sc->vr_unit); - return(1); - } - } - m_copydata(m_head, 0, m_head->m_pkthdr.len, - mtod(m_new, caddr_t)); - m_new->m_pkthdr.len = m_new->m_len = m_head->m_pkthdr.len; - m_freem(m_head); + m_head = m_new; /* * The Rhine chip doesn't auto-pad, so we have to make |