Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

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

Merged
merged 1 commit into from
Nov 25, 2018

Conversation

piotrjurkiewicz
Copy link
Contributor

This is a commit from kohler/click#397 rebased on FastClick element (after introduction of batching and multi-threading).

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.

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
Copy link
Owner

Ok I'll trust you on this one.

Thanks !

@tbarbette tbarbette merged commit b2ed538 into tbarbette:master Nov 25, 2018
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants