summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ppp/vjcomp.c
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>1999-12-20 20:29:51 +0000
committerbrian <brian@FreeBSD.org>1999-12-20 20:29:51 +0000
commitff8174b1b3e9f7d40f556d9af0d8168f7b81cefa (patch)
tree0f1b79a384d061f785330452ed26aef1497aca77 /usr.sbin/ppp/vjcomp.c
parent86f30d4f38c1b3bdc30e15482e3d749c9ad5f159 (diff)
downloadFreeBSD-src-ff8174b1b3e9f7d40f556d9af0d8168f7b81cefa.zip
FreeBSD-src-ff8174b1b3e9f7d40f556d9af0d8168f7b81cefa.tar.gz
Implement mbuf allocation internally by maintaining 8 buckets of
different sized mbufs, and mallocing them in chunks of 20 mbufs at a time. This improves back-to-back throughput by between 7 and 8%
Diffstat (limited to 'usr.sbin/ppp/vjcomp.c')
-rw-r--r--usr.sbin/ppp/vjcomp.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/usr.sbin/ppp/vjcomp.c b/usr.sbin/ppp/vjcomp.c
index 5c99362..e257623 100644
--- a/usr.sbin/ppp/vjcomp.c
+++ b/usr.sbin/ppp/vjcomp.c
@@ -105,7 +105,6 @@ VjUncompressTcp(struct ipcp *ipcp, struct mbuf *bp, u_char type)
{
u_char *bufp;
int len, olen, rlen;
- struct mbuf *nbp;
u_char work[MAX_HDR + MAX_VJHEADER]; /* enough to hold TCP/IP header */
bp = m_pullup(bp);
@@ -144,11 +143,11 @@ VjUncompressTcp(struct ipcp *ipcp, struct mbuf *bp, u_char type)
}
len -= olen;
len += rlen;
- nbp = m_get(len, MB_VJIN);
- memcpy(MBUF_CTOP(nbp), bufp, len);
+
+ bp = m_prepend(bp, bufp, len, 0);
m_settype(bp, MB_VJIN);
- nbp->m_next = bp;
- return nbp;
+
+ return bp;
}
static struct mbuf *
OpenPOWER on IntegriCloud