-
Notifications
You must be signed in to change notification settings - Fork 123
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
perf: use GSO #2138
Draft
mxinden
wants to merge
69
commits into
mozilla:main
Choose a base branch
from
mxinden:gso
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
perf: use GSO #2138
Commits on Sep 8, 2024
-
perf: don't allocate in UDP send & recv path
This change is best summarized by the `process` function signature. On `main` branch the `process` function looks as such: ```rust pub fn process(&mut self, dgram: Option<&Datagram>, now: Instant) -> Output { ``` - It takes as **input** an optional reference to a `Datagram`. That `Datagram` owns an allocation of the UDP payload, i.e. a `Vec<u8>`. Thus for each incoming UDP datagram, its payload is allocated in a new `Vec`. - It returns as **output** an owned `Output`. Most relevantly the `Output` variant `Output::Datagram(Datagram)` contains a `Datagram` that again owns an allocation of the UDP payload, i.e. a `Vec<u8>`. Thus for each outgoing UDP datagram too, its payload is allocated in a new `Vec`. This commit changes the `process` function to: ```rust pub fn process_into<'a>( &mut self, input: Option<Datagram<&[u8]>>, now: Instant, write_buffer: &'a mut Vec<u8>, ) -> Output<&'a [u8]> { ``` (Note the rename to `process_into` is temporary.) - It takes as **input** an optional `Datagram<&[u8]>`. But contrary to before, `Datagram<&[u8]>` does not own an allocation of the UDP payload, but represents a view into a long-lived receive buffer containing the UDP payload. - It returns as **output** an `Output<&'a [u8]>` where the `Output::Datagram(Datagram<&'a [u8]>)` variant does not own an allocation of the UDP payload, but here as well represents a view into a long-lived write buffer the payload is written into. That write buffer lives outside of `neqo_transport::Connection` and is provided to `process` as `write_buffer: &'a mut Vec<u8>`. Note that both `write_buffer` and `Output` use the lifetime `'a`, i.e. the latter is a view into the former. This change to the `process` function enables the following: 1. A user of `neqo_transport` (e.g. `neqo_bin`) has the OS write incoming UDP datagrams into a long-lived receive buffer (via e.g. `recvmmsg`). 2. They pass that receive buffer to `neqo_transport::Connection::process` along with a long-lived write buffer. 3. `process` reads the UDP datagram from the long-lived receive buffer through the `Datagram<&[u8]>` view and writes outgoing datagrams into the provided long-lived `write_buffer`, returning a view into said buffer via a `Datagram<&'a [u8]>`. 4. The user, after having called `process` can then pass the write buffer to the OS (e.g. via `sendmsg`). To summarize a user can receive and send UDP datagrams, without allocation in the UDP IO path. As an aside, the above is compatible with GSO and GRO, where a send and receive buffer contains a consecutive number of UDP datagram segments.
Configuration menu - View commit details
-
Copy full SHA for 5d847ee - Browse repository at this point
Copy the full SHA 5d847eeView commit details
Commits on Sep 9, 2024
-
Configuration menu - View commit details
-
Copy full SHA for b334e84 - Browse repository at this point
Copy the full SHA b334e84View commit details
Commits on Sep 10, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 2db53a2 - Browse repository at this point
Copy the full SHA 2db53a2View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9fef795 - Browse repository at this point
Copy the full SHA 9fef795View commit details
Commits on Sep 14, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 995c499 - Browse repository at this point
Copy the full SHA 995c499View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1c653de - Browse repository at this point
Copy the full SHA 1c653deView commit details -
Configuration menu - View commit details
-
Copy full SHA for c05bc64 - Browse repository at this point
Copy the full SHA c05bc64View commit details -
Configuration menu - View commit details
-
Copy full SHA for 08eba9d - Browse repository at this point
Copy the full SHA 08eba9dView commit details -
Configuration menu - View commit details
-
Copy full SHA for ae112c8 - Browse repository at this point
Copy the full SHA ae112c8View commit details -
Configuration menu - View commit details
-
Copy full SHA for 828da75 - Browse repository at this point
Copy the full SHA 828da75View commit details -
Configuration menu - View commit details
-
Copy full SHA for dfa33b2 - Browse repository at this point
Copy the full SHA dfa33b2View commit details -
Configuration menu - View commit details
-
Copy full SHA for 763b391 - Browse repository at this point
Copy the full SHA 763b391View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8dee7b3 - Browse repository at this point
Copy the full SHA 8dee7b3View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5576875 - Browse repository at this point
Copy the full SHA 5576875View commit details -
Configuration menu - View commit details
-
Copy full SHA for b9457bb - Browse repository at this point
Copy the full SHA b9457bbView commit details -
Configuration menu - View commit details
-
Copy full SHA for 94d1a68 - Browse repository at this point
Copy the full SHA 94d1a68View commit details -
Configuration menu - View commit details
-
Copy full SHA for e2d1452 - Browse repository at this point
Copy the full SHA e2d1452View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2e2a76e - Browse repository at this point
Copy the full SHA 2e2a76eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 1947d33 - Browse repository at this point
Copy the full SHA 1947d33View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8ea56b2 - Browse repository at this point
Copy the full SHA 8ea56b2View commit details
Commits on Sep 15, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 3df6660 - Browse repository at this point
Copy the full SHA 3df6660View commit details -
Configuration menu - View commit details
-
Copy full SHA for 52dfa91 - Browse repository at this point
Copy the full SHA 52dfa91View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8699209 - Browse repository at this point
Copy the full SHA 8699209View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1b9259c - Browse repository at this point
Copy the full SHA 1b9259cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 07c2b3b - Browse repository at this point
Copy the full SHA 07c2b3bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 14a9643 - Browse repository at this point
Copy the full SHA 14a9643View commit details -
Configuration menu - View commit details
-
Copy full SHA for f0855e1 - Browse repository at this point
Copy the full SHA f0855e1View commit details -
Configuration menu - View commit details
-
Copy full SHA for 936ea2b - Browse repository at this point
Copy the full SHA 936ea2bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 19a82cd - Browse repository at this point
Copy the full SHA 19a82cdView commit details -
Configuration menu - View commit details
-
Copy full SHA for 55adc20 - Browse repository at this point
Copy the full SHA 55adc20View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1cee426 - Browse repository at this point
Copy the full SHA 1cee426View commit details -
Configuration menu - View commit details
-
Copy full SHA for e9dd74d - Browse repository at this point
Copy the full SHA e9dd74dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 99a323e - Browse repository at this point
Copy the full SHA 99a323eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 147df66 - Browse repository at this point
Copy the full SHA 147df66View commit details -
Configuration menu - View commit details
-
Copy full SHA for 3928c62 - Browse repository at this point
Copy the full SHA 3928c62View commit details -
Configuration menu - View commit details
-
Copy full SHA for 34d904e - Browse repository at this point
Copy the full SHA 34d904eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 7f6ca94 - Browse repository at this point
Copy the full SHA 7f6ca94View commit details -
Configuration menu - View commit details
-
Copy full SHA for bd325fe - Browse repository at this point
Copy the full SHA bd325feView commit details -
Configuration menu - View commit details
-
Copy full SHA for 28f9b0a - Browse repository at this point
Copy the full SHA 28f9b0aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 7cae54f - Browse repository at this point
Copy the full SHA 7cae54fView commit details -
Configuration menu - View commit details
-
Copy full SHA for b03f8d4 - Browse repository at this point
Copy the full SHA b03f8d4View commit details
Commits on Sep 19, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 2003c84 - Browse repository at this point
Copy the full SHA 2003c84View commit details -
Configuration menu - View commit details
-
Copy full SHA for 38179ef - Browse repository at this point
Copy the full SHA 38179efView commit details -
Configuration menu - View commit details
-
Copy full SHA for fbccdf2 - Browse repository at this point
Copy the full SHA fbccdf2View commit details -
Configuration menu - View commit details
-
Copy full SHA for 24e0cbd - Browse repository at this point
Copy the full SHA 24e0cbdView commit details -
Configuration menu - View commit details
-
Copy full SHA for 6deaef8 - Browse repository at this point
Copy the full SHA 6deaef8View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5244fc1 - Browse repository at this point
Copy the full SHA 5244fc1View commit details
Commits on Sep 25, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 15eb2f8 - Browse repository at this point
Copy the full SHA 15eb2f8View commit details -
Configuration menu - View commit details
-
Copy full SHA for ffc3708 - Browse repository at this point
Copy the full SHA ffc3708View commit details -
Configuration menu - View commit details
-
Copy full SHA for e5bc0e2 - Browse repository at this point
Copy the full SHA e5bc0e2View commit details -
Configuration menu - View commit details
-
Copy full SHA for eb09a9a - Browse repository at this point
Copy the full SHA eb09a9aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 5ab4e01 - Browse repository at this point
Copy the full SHA 5ab4e01View commit details -
Configuration menu - View commit details
-
Copy full SHA for 08c49e6 - Browse repository at this point
Copy the full SHA 08c49e6View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2b0103a - Browse repository at this point
Copy the full SHA 2b0103aView commit details -
Configuration menu - View commit details
-
Copy full SHA for c254319 - Browse repository at this point
Copy the full SHA c254319View commit details
Commits on Sep 27, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 1bd20da - Browse repository at this point
Copy the full SHA 1bd20daView commit details -
No need to play with fire (uninitialized memory). Simply initialize the recv buffer once at startup.
Configuration menu - View commit details
-
Copy full SHA for 8137e73 - Browse repository at this point
Copy the full SHA 8137e73View commit details -
Configuration menu - View commit details
-
Copy full SHA for 166ae86 - Browse repository at this point
Copy the full SHA 166ae86View commit details -
Configuration menu - View commit details
-
Copy full SHA for 93c1fa5 - Browse repository at this point
Copy the full SHA 93c1fa5View commit details -
Configuration menu - View commit details
-
Copy full SHA for 3a134d6 - Browse repository at this point
Copy the full SHA 3a134d6View commit details -
Configuration menu - View commit details
-
Copy full SHA for 61565b4 - Browse repository at this point
Copy the full SHA 61565b4View commit details -
Configuration menu - View commit details
-
Copy full SHA for f65dde5 - Browse repository at this point
Copy the full SHA f65dde5View commit details -
Configuration menu - View commit details
-
Copy full SHA for c6f58dc - Browse repository at this point
Copy the full SHA c6f58dcView commit details -
Configuration menu - View commit details
-
Copy full SHA for 55e650f - Browse repository at this point
Copy the full SHA 55e650fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 92c48de - Browse repository at this point
Copy the full SHA 92c48deView commit details -
Configuration menu - View commit details
-
Copy full SHA for a4d1ef2 - Browse repository at this point
Copy the full SHA a4d1ef2View commit details -
Configuration menu - View commit details
-
Copy full SHA for 75c1de2 - Browse repository at this point
Copy the full SHA 75c1de2View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1ce5455 - Browse repository at this point
Copy the full SHA 1ce5455View commit details
Commits on Sep 29, 2024
-
Configuration menu - View commit details
-
Copy full SHA for f25b0b7 - Browse repository at this point
Copy the full SHA f25b0b7View commit details
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.