Subject: m_defrag() addition
To: None <tech-kern@netbsd.org>
From: Jaromir Dolecek <jdolecek@NetBSD.org>
List: tech-kern
Date: 02/20/2005 17:26:02
Hi,

I'd like to add a routine for coalescing mbuf chain into fewer
segments. Primary consuments would be network drivers, which would
use the routine if the original mbuf chain is too fragmented to be
loadable into their DMA rings. Bunch of drivers already use custom
code for this, and it would be good to centralize the code.
Basically _any_ network driver using DMA to push trasmit packets
should be using this.

The implementation I've prepared only deals with < MCLBYTES packets.
Extending the function to also handle ethernet JUMBO packets
would be possible later, and would benefit all drivers using the
function.

The function would return new mbuf chain on success or NULL
on failure, the old mbuf chain would be freed in either case.

The name and semantics is borrowed from FreeBSD, so having this
function would also be convenient for API compatibility.

Would anyone object if I'd add this function to uipc_mbuf.c et.al.?

Jaromir
-- 
Jaromir Dolecek <jdolecek@NetBSD.org>            http://www.NetBSD.cz/
-=- We can walk our road together if our goals are all the same;     -=-
-=- We can run alone and free if we pursue a different aim.          -=-