wolfIP_poll refactor#133
Open
gasbytes wants to merge 4 commits into
Open
Conversation
Mainly extracted the phases into separated static helpers, minor removal of some dupplicates and superflous part of the code (mostly repetitions)
We only do the actual poll once with the offset to differ between the two branches
The is_udp flag was introduced to differ in 4 bits where udp does something different from icmp: - any multicast interaction (this includes the next jump (hop) and the loopback); - tx_drained logic (that checks if we sent at least one datagram), so that we can "wake" the sender whenever we actually have freed some space in the buffer; One minor bit is the notify logic was using t->S instead of directly using the stack pointer already passed into the function.
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.
Divided by the phases devices poll, timers, socket callbacks and the final per-protocol tx flush of the buffer. In particular on the last phase, udp and icmp share quite a lot of the same logic so now are merged into one single flush function called "flush_datagram_tx", the udp logic is gated with a flag (is_udp) for the new udp-only behaviors.