Subject: Re: Wart in tcp_output(), IPv6-related?
To: None <thorpej@wasabisystems.com>
From: None <itojun@iijlab.net>
List: tech-net
Date: 04/27/2002 21:03:19
> > 	and if you really want to make sure there'll be no copy in the function,
> > 	you can get rid of "if (len <= M_TRAILINGSPACE)" case.
> > 	my proposed diff attached.
>Well, that doesn't actually guarantee there will be no copy.  If the source
>mbuf in the socket buffer is not M_EXT, then it will copy.

	true.  i wasn't careful about the use of the word "copy".

>(Eventually, I'd like to eliminate mbuf-internal-storage completely
>and go all-external-storage, making the mbuf structure itself just
>metadata, which would allow us to eliminate small copies, too, but
>there's lots of other, much lower-hanging fruit to deal with right now :-)

	hmm, but there are two pitfalls to this:
	- sbspace() and other socket buffer stuff needs to be updated, they
	  count actual data on socket buffer as well as memory region occupied
	  by mbuf/external storage
	- drivers should try to allocate variable-sized buffer instead of
	  2048byte cluster (otherwise 1-byte TCP segment will occupy half a
	  page) - and if we did this, buffer management will get more tricky.

itojun