em0, polling performance, P4 2.8ghz FSB 800mhz

Andrew Gallatin gallatin at cs.duke.edu
Wed Mar 3 09:59:52 PST 2004


Luigi Rizzo writes:
 > On Wed, Mar 03, 2004 at 10:03:11AM -0500, Andrew Gallatin wrote:
<...>
 > > I'm trying to design a new ethernet API for a firmware-based nic,
 > > and I'm trying to convince a colleague that having separate
 > > receive rings for small and large frames is a really good thing.
 > 
 > i am actually not very convinced either, unless you are telling me
 > that there is a way to preserve ordering. Or you'd be in trouble
 > when, on your busy link, there is a mismatch between user-level and
 > link-level block sizes.
 > 
 > So, what is your design like, you want to pass the NIC buffers of
 > 2-3 different sizes and let the NIC choose from the most appropriate
 > pool depending on the incoming frame size, but still return
 > received frames in a single ring in arrival order ?

Yes, exactly.  This way you get to pass the stack small (<MHLEN)
frames in mbufs, rather than clusters without doing something like
copying them in the driver's rx interrupt handler.  You can allocate
tons of mbufs so that you can absorb the occasional burst (or spike in
host latency) without being as bad of pig as you'd be if you allocated
a huge number of clusters ;)

You also get to set yourself up for zero-copy receive by splitting
the headers into mbufs, and the payloads into jumbo clusters
that can get page-flipped.  But that's a lot trickier and not
really in the scope of the initial implementation.

Drew


More information about the freebsd-hackers mailing list