From owner-freebsd-net Sun Nov 12 5:19:37 2000 Delivered-To: freebsd-net@freebsd.org Received: from salmon.maths.tcd.ie (salmon.maths.tcd.ie [134.226.81.11]) by hub.freebsd.org (Postfix) with SMTP id 615D637B479 for ; Sun, 12 Nov 2000 05:19:34 -0800 (PST) Received: from walton.maths.tcd.ie by salmon.maths.tcd.ie with SMTP id ; 12 Nov 2000 13:19:33 +0000 (GMT) To: Bosko Milekic Cc: freebsd-net@freebsd.org Subject: Re: M_RDONLY: review & comment In-reply-to: Your message of "Fri, 10 Nov 2000 00:54:09 EST." X-Request-Do: Date: Sun, 12 Nov 2000 13:19:33 +0000 From: David Malone Message-ID: <200011121319.aa19357@salmon.maths.tcd.ie> Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org This is an application of the M_WRITABLE macro I've been testing at home (we're also testing a cruder version in RELENG_4 in college). What this does is allows sbcompress to compress into external storage if it is writable. This can be of great help if you have lots of small packets arriving via an interface which always uses an mbuf cluster for every packet (the fxp driver is one example I think). We were frequently running out of clusters before using this patch. The limit of copying at most MCLBYTES/4 comes from BSDi, which seems to have had a similar patch in place for some time. If Bosko or someone can review this I'd like to commit it. David. Index: uipc_socket2.c =================================================================== RCS file: /cvs/FreeBSD-CVS/src/sys/kern/uipc_socket2.c,v retrieving revision 1.65 diff -u -r1.65 uipc_socket2.c --- uipc_socket2.c 2000/09/05 22:10:24 1.65 +++ uipc_socket2.c 2000/10/15 18:55:58 @@ -718,8 +718,10 @@ m = m_free(m); continue; } - if (n && (n->m_flags & (M_EXT | M_EOR)) == 0 && - (n->m_data + n->m_len + m->m_len) < &n->m_dat[MLEN] && + if (n && (n->m_flags & M_EOR) == 0 && + M_WRITABLE(n) && + (m)->m_len <= MCLBYTES / 4 && + (m)->m_len <= M_TRAILINGSPACE(n) && n->m_type == m->m_type) { bcopy(mtod(m, caddr_t), mtod(n, caddr_t) + n->m_len, (unsigned)m->m_len); To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message