Move send code from headers to their own compilation units#793
Merged
Move send code from headers to their own compilation units#793
Conversation
- Move BSD and netmap send code from headers to separate compilation units, like Linux. - Remove static inline declarations of send interface from send.c and move as regular declarations into `send-internal.h` (like `recv-internal.h`). - Minimal cleanups to make it all work. Except for better code structure, there are two main benefits: - Prevent OS-specific headers to leak into generic compilation units, creating footguns for developers working on other OSes. - It will now be possible to cleanly call into OS-specific send functions from other compilation units than `send.c` (which was my primary motivation for this work, as this is blocking further netmap improvements).
zakird
approved these changes
Feb 25, 2024
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.
Changes
send-internal.h(likerecv-internal.h).send_packet.Motivation
send.c(which was my primary motivation, as this is blocking droe/netmap-wait-ping).send_packet.Notes
src/send-linux.hin place, even though I see no need for keeping it. Mainly to make deconflicting Add optional CLI parameter for Linuxenable-liburingto use the async I/O library for increased send performance #767 with this change easier.Testing
Smoke-tested on:
WITH_NETMAP=OFFandWITH_NETMAP=ON(with and without droe/netmap-wait-ping on top of this change)WITH_NETMAP=OFFandWITH_NETMAP=ON(the latter with droe/netmap-linux on top of this change)