Skip to content
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

KernelTun: Use IFF_NO_PI on Linux, remove LINUX_ETHERTAP mode #397

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

piotrjurkiewicz
Copy link
Contributor

@piotrjurkiewicz piotrjurkiewicz commented May 2, 2018

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.

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.
Copy link
Collaborator

@tbarbette tbarbette left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@ahenning
Copy link

ahenning commented May 3, 2018

Tom, does the multi-threading that you are working on add kerneltap multiqueue support?

@tbarbette
Copy link
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants