Paper on device polling and packet capture performance

Don Lewis truckman at
Sun Jan 11 13:56:46 PST 2004

On 11 Jan, Bruce M Simpson wrote:
> On Fri, Jan 09, 2004 at 03:51:43PM -0600, Guy Helmer wrote:
>> I want to look at memory-mapped access to the BPF device.
>> This would preserve the existing network device drivers
>> while reducing mbuf copies, context switches/user-kernel
>> transitions, and latency.  Performance ought to be
>> comparable to Luca's approach, and this would also
>> preserve bpf filtering capability.
>> (If someone else has already done this, I'd love to
>> know where to find the code!)
> I did review some patches related to this last month but they weren't
> for FreeBSD. One big problem with the approach involved which leapt out
> at me was that the space was allocated within user address space, which
> introduces the risk of page faults (as you may know we can't ever fault
> with a mutex held -- or it's game over).

You'd have to wire the buffer.  Beyond a certain buffer size, you'd
probably want to maintain a sliding window of of wired memory to avoid
wiring an excessive amount of memory.

More information about the freebsd-net mailing list