svn commit: r248323 - head/sys/netinet

Gleb Smirnoff glebius at FreeBSD.org
Fri Mar 15 13:47:00 UTC 2013


On Fri, Mar 15, 2013 at 02:00:57PM +0100, Andre Oppermann wrote:
A> On 15.03.2013 13:53, Gleb Smirnoff wrote:
A> > Author: glebius
A> > Date: Fri Mar 15 12:53:53 2013
A> > New Revision: 248323
A> > URL: http://svnweb.freebsd.org/changeset/base/248323
A> >
A> > Log:
A> >    - Use m_getcl() instead of hand allocating.
A> >
A> >    Sponsored by:	Nginx, Inc.
A> >
A> > Modified:
A> >    head/sys/netinet/tcp_output.c
A> >
A> > Modified: head/sys/netinet/tcp_output.c
A> > ==============================================================================
A> > --- head/sys/netinet/tcp_output.c	Fri Mar 15 12:52:59 2013	(r248322)
A> > +++ head/sys/netinet/tcp_output.c	Fri Mar 15 12:53:53 2013	(r248323)
A> > @@ -842,23 +842,19 @@ send:
A> >   			TCPSTAT_INC(tcps_sndpack);
A> >   			TCPSTAT_ADD(tcps_sndbyte, len);
A> >   		}
A> > -		MGETHDR(m, M_NOWAIT, MT_DATA);
A> > +#ifdef INET6
A> > +		if (MHLEN < hdrlen + max_linkhdr)
A> > +			m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR);
A> > +		else
A> > +#endif
A> > +			m = m_gethdr(M_NOWAIT, MT_DATA);
A> > +
A> 
A> m = m_getm2(hdrlen + max_linkhdr, M_NOWAIT, MT_DATA, M_PKTHDR);
A> 
A> would be even more compact.  Since max_linkhdr could be large as well,
A> the possibility of a cluster applies to IPv4 too.

m_getm2() may return chain. According to argument list, you probably
meant m_get2(). Yes, that would be more compat.

But, again, I am not sure that using pagesized cluster won't break
anything.

If you are sure, feel free to change that.

-- 
Totus tuus, Glebius.


More information about the svn-src-all mailing list