-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add zero-copy mode for ring buffer source #18
Comments
Switching to zero-copy mode for
The method |
After some deliberation there's quite a lot of different combinations (and, at the same time, limitations), so the best I can come up with that will be minimal but still cover all ways while also being explicit enough is the following interface(s) (omitting non-packet interface methods):
This way,
|
Making the zero-copy operations explicit now has the advantage of not having to support both paths in one function, which actually brings up the performance of those ops even outpacing the functional approach (total numbers are not comparable to the ones further up, different machine):
|
Currently data is copied from the ring buffer, no matter if a buffer has been provided to
NextPacket()
/NextIPPacket()
. Since the data in the ring buffer is invalidated only upon the next call to those methods we can re-add a real zero-copy mode and then doing:where
Similar logic holds for the non-ringbuffer source, where a copy is made as well in normal mode in both aforementioned methods.
DoD
AddZeroCopy()
option to both afpacket sourcesNextPacket()
/NextIPPacket()
(both afpacket sources)NextPacket()
See also els0r/goProbe#83
The text was updated successfully, but these errors were encountered: