Re: Ethernet Drivers: Question on Sending Received Packets to the FreeBSD Network Stack

From: Julian Elischer <julian_at_freebsd.org>
Date: Fri, 04 Feb 2011 22:38:45 -0800
On 2/3/11 4:25 PM, Ryan Stone wrote:
> On Thu, Feb 3, 2011 at 2:48 PM, Julian Elischer<julian_at_freebsd.org>  wrote:
>> I had never considered passing a set of packets, but after my initial
>> scoffing thoughts I realized that it would actually be a very interesting
>> thought experiment to see if the ability to do that would be advantageous in
>> any way. I tmay be a way to reduce some sorts of
>> overhead if using interrupt mitigation.
> At $WORK we've put a rather considerable amount of effort into writing
> what I'd call a poor-man's version of netgraph.  Originally, in fact,
> our application was entirely netgraph-based back when we were running
> on FreeBSD 4.  What we ended up implementing was the minimal set of
> netgraph features our application needed, optimized for performance.
> Passing packets around in batches was one of the performance
> optimizations.  There are some pretty big wins with that approach:
> amortization of locking costs and other overhead, better cache
> locality and it's easier to prefetch the data from packet n while
> processing packet n-1.


That's actually one of the ways that we envisioned netgraph being used..
As a prototyping tool that would eventually be replaced by the same 
node code hooked together
be a purpose-designed application. However we did too good a job in 
implementing it so that
for a large percentage of the tasks the prototyping framework actually 
does well enough.

The other use was for low speed L2 plumbing for WAN networking.

> If I get some time I'll see if I can get something by the way of hard
> numbers as to the advantages on our application.
>
Received on Sat Feb 05 2011 - 05:38:45 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:11 UTC