KernelTun: Use IFF_NO_PI on Linux, remove LINUX_ETHERTAP mode#397
Open
piotrjurkiewicz wants to merge 1 commit intokohler:masterfrom
Open
KernelTun: Use IFF_NO_PI on Linux, remove LINUX_ETHERTAP mode#397piotrjurkiewicz wants to merge 1 commit intokohler:masterfrom
piotrjurkiewicz wants to merge 1 commit intokohler:masterfrom
Conversation
This commit adds flag IFF_NO_PI to tun/tap interface settings on Linux. It flag changes frame format in order not to include protocol information header. That is, with this flag, frames received/send from tun/tap fd consist solely of raw underlying protocol (Ethernet/IP) frames. Protocol information header is not used by the element in any way, but its presence adds a requirement for pulling packet data on receive and pushing it before writing packet to the fd. Such a push becomes an expensive push when there is is no enough headroom in packet, for example when using native netmap buffers which do not have headroom. Adding IFF_NO_PI flag eliminates the need for pulling and pushing packet data completely. Moreover, this commit removes support for LINUX_ETHERTAP mode. Ethertap driver was removed from the kernel more than 15 years ago. Removal of this mode significantly simplifies the logic within the element.
tbarbette
approved these changes
May 3, 2018
Collaborator
tbarbette
left a comment
There was a problem hiding this comment.
Nice !
I'll ingrate this in FastClick also if I may, no matter waht this PR becomes here.
I've been working on this element recently to provide batch compatibility and (limited) multi-threading.
|
Tom, does the multi-threading that you are working on add kerneltap multiqueue support? |
Collaborator
|
Yes it's the idea. Following the FastClick's FromDPDKDevice idea, the element spawns one task per threads that reads from the TAP device. I'll finish it now. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This commit adds flag IFF_NO_PI to tun/tap interface settings on Linux. It changes frame format in order not to include protocol information header. That is, with this flag, frames received/send from tun/tap fd consist solely of raw underlying protocol (Ethernet/IP) frames.
Protocol information header is not used by the element in any way, but its presence adds a requirement for pulling packet data on receive and pushing it before writing packet to the fd. Such a push becomes an expensive push when there is is no enough headroom in packet, for example when using native netmap buffers, which do not have any headroom.
Adding IFF_NO_PI flag eliminates the need for pulling and pushing packet data completely.
Moreover, this commit removes support for LINUX_ETHERTAP mode. Ethertap driver was removed from the kernel more than 15 years ago. Removal of this mode significantly simplifies the logic within the element.