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

Support Zero-Copy for Netmap #225

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

Conversation

tbarbette
Copy link
Collaborator

This commit adds zero-copy through buffer swapping with extra buffer allocated on startup.

Netmap Buffers are now organized in pool much like click pool through a completed implementation of Luigi Rizzo's NetmapBufQ. A shared linked list allows multiple thread-local NetmapBufQ to exchange batches of buffers.

The amount of extra buffers allocated on startup is set using NetmapInfo, which is now a real element (but it allocates 2048 buffers per thread at minimum). NetmapBufQ and other old NetmapInfo methods (renamed more accurately NetmapDevice) are moved to lib/netmapdevice.cc

Also there was confusion between HAVE_NET_NETMAP_H and HAVE_NETMAP, and the ELEMENT_REQUIRES(netmap). It's not really needed to have part of the netmap subsystem built without HAVE_NETMAP, so HAVE_NET_NETMAP_H is changed by HAVE_NETMAP.

This is a first, minimal change just to introduce Zero Copy, it provides improvement but the send and receive method are nearly untouched and not re-worked in this commit.

This commit adds zero-copy through buffer swapping with extra buffer allocated on startup.

Netmap Buffers are now organized in pool much like click pool through a completed implementation of Luigi Rizzo's NetmapBufQ. A shared linked list allows multiple thread-local NetmapBufQ to exchange batches of buffers.

The amount of extra buffers allocated on startup is set using NetmapInfo, which is now a real element. NetmapBufQ and other old NetmapInfo methods (renamed more accurately NetmapDevice) are moved to lib/netmapdevice.cc

Also there was confusion between HAVE_NET_NETMAP_H and HAVE_NETMAP, and the ELEMENT_REQUIRES(netmap). It's not really needed to have part of the netmap subsystem built without HAVE_NETMAP, so HAVE_NET_NETMAP_H is changed by HAVE_NETMAP.

This is a first, minimal change just to introduce Zero Copy, it provides improvement but the send and receive method are nearly untouched and not re-worked in this commit.
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.

1 participant