Add support for very fast packet I/O using netmap(4) on FreeBSD#787
Add support for very fast packet I/O using netmap(4) on FreeBSD#787phillip-stephens merged 7 commits intozmap:mainfrom
Conversation
Support for sending and receiving packets using netmap(4) on FreeBSD. Netmap is a framework for very fast packet I/O from userspace that uses pre-allocated ring buffers mapped into ZMap's virtual address space.
|
Thanks @droe, this looks awesome! Thank you as well for all of the other improvements over the past few weeks — I sincerely appreciate all the work you've put into ZMap recently. @phillip-stephens I think that we should look at what it would take to get this to work on Linux too, particularly given that we haven't yet seen superb performance from |
|
Yeah, thank you so much @droe for this and your other contributions! I'll give it a proper look over on Tuesday. @zakird Yep sounds good, once we have that bare metal server with a 10 Gbit uplink, I can look into what performance |
|
In case you want to test this on Linux: I keep an Edit: Linux branch seems to work, results seem to vary greatly depending on the NIC driver, not well tested. |
phillip-stephens
left a comment
There was a problem hiding this comment.
This looks really great overall, really appreciate the very digestible README.
Just a few very minor nits on formatting, I didn't see anything stand out in the core logic.
My FreeBSD VM doesn't have the /dev/netmap device by default, and based on this, it looks like adding it would require compiling the kernel from source. IMO, if it's working on your BSD box, I'm good to merge if you are @zakird.
zakird
left a comment
There was a problem hiding this comment.
Looks good to me. I know that you had some nits about the code. Please merge when your'e good with state of thinsg @phillip-stephens !
|
Re: netmap default availability, in case you're testing on an arm64 VM, netmap has only recently been added to the default config in D43702, and that change has not made it into a release yet; 14.0 still requires rebuilding the kernel (tl;dr: Will take care of the PR feedback later this week, thanks for reviewing. |
|
@droe Thank you for this great contribution! |
Initial support for sending and receiving packets using netmap(4) on FreeBSD. Netmap is a framework for very fast packet I/O from userspace that uses pre-allocated ring buffers mapped into ZMap's virtual address space. I have mainly tested on 1 GigE and 10 GigE links, both on netmap-aware and non-aware NICs, but perf advantage compared to the default BPF send code on even faster links than 10 GigE should be even more substantial.
Netmap has also been ported to Linux, support in ZMap is for FreeBSD only at this point. I am not sure how interesting netmap is on Linux with the requirement to patch kernel sources, and how it compares in terms of performance to liburing etc. Making the netmap send/recv code work on Linux too would mainly involve porting the link status and interface stats bits to Linux, so should not be a big deal in case there is interest.
There will be merge conflicts with #767. In case you'll accept (a revised version of) this PR, you may want to wait with merging until after that has landed and I had a chance to rebase on top.