-
Notifications
You must be signed in to change notification settings - Fork 124
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
feat(udp): use sendmmsg and recvmmsg #1741
Closed
Closed
Commits on Mar 21, 2024
-
Read up to `BATCH_SIZE = 32` with single `recvmmsg` syscall. Previously `neqo_bin::udp::Socket::recv` would use `recvmmsg`, but provide a single buffer to write into only, effectively using `recvmsg` instead of `recvmmsg`. With this commit `Socket::recv` provides `BATCH_SIZE` number of buffers on each `recvmmsg` syscall, thus reading more than one datagram at a time if available.
Configuration menu - View commit details
-
Copy full SHA for cfcea21 - Browse repository at this point
Copy the full SHA cfcea21View commit details
Commits on Apr 3, 2024
-
Configuration menu - View commit details
-
Copy full SHA for e2e54fa - Browse repository at this point
Copy the full SHA e2e54faView commit details -
Configuration menu - View commit details
-
Copy full SHA for 1a813e4 - Browse repository at this point
Copy the full SHA 1a813e4View commit details
Commits on Apr 4, 2024
-
Configuration menu - View commit details
-
Copy full SHA for b6cd481 - Browse repository at this point
Copy the full SHA b6cd481View commit details -
Configuration menu - View commit details
-
Copy full SHA for 22da54f - Browse repository at this point
Copy the full SHA 22da54fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 3f9eb9c - Browse repository at this point
Copy the full SHA 3f9eb9cView commit details -
Configuration menu - View commit details
-
Copy full SHA for dfd0226 - Browse repository at this point
Copy the full SHA dfd0226View commit details -
Configuration menu - View commit details
-
Copy full SHA for a262e37 - Browse repository at this point
Copy the full SHA a262e37View commit details -
Configuration menu - View commit details
-
Copy full SHA for 7681cf0 - Browse repository at this point
Copy the full SHA 7681cf0View commit details
Commits on Apr 5, 2024
-
Configuration menu - View commit details
-
Copy full SHA for c2b0721 - Browse repository at this point
Copy the full SHA c2b0721View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5d314b6 - Browse repository at this point
Copy the full SHA 5d314b6View commit details -
fix(http3): don't call stream_has_pending_data on send_data
`<SendMessage as Sendstream>::send_data` attempts to send a slice of data down into the QUIC layer, more specifically `neqo_transport::Connection::stream_send_atomic`. While it attempts to send any existing buffered data at the http3 layer first, it does not itself fill the http3 layer buffer, but instead only sends data, if the lower QUIC layer has capacity, i.e. only if it can send the data down to the QUIC layer right away. https://github.com/mozilla/neqo/blob/5dfe106669ccb695187511305c21b8e8a8775e91/neqo-http3/src/send_message.rs#L168-L221 `<SendMessage as Sendstream>::send_data` is called via `Http3ServerHandler::send_data`. The wrapper first marks the stream as `stream_has_pending_data`, marks itself as `needs_processing` and then calls down into `<SendMessage as Sendstream>::send_data`. https://github.com/mozilla/neqo/blob/5dfe106669ccb695187511305c21b8e8a8775e91/neqo-http3/src/connection_server.rs#L51-L74 Thus the latter always marks the former as `stream_has_pending_data` even though the former never writes into the buffer and thus might actually not have pending data. Why is this problematic? 1. Say that the buffer of the `BufferedStream` of `SendMessage` is empty. 2. Say that the user attempts to write data via `Http3ServerHandler::send_data`. Despite not filling the http3 layer buffer, the stream is marked as `stream_has_pending_data`. 3. Say that next the user calls `Http3Server::process`, which will call `Http3Server::process_http3`, which will call `Http3ServerHandler::process_http3`, which will call `Http3Connection::process_sending`, which will call `Http3Connection::send_non_control_streams`. `Http3Connection::send_non_control_streams` will attempt to flush all http3 layer buffers of streams marked via `stream_has_pending_data`, e.g. the stream from step (2). Thus it will call `<SendMessage as SendStream>::send` (note `send` and not the previous `send_data`). This function will attempt the stream's http3 layer buffer. In the case where the http3 layer stream buffer is empty, it will enqueue a `DataWritable` event for the user. Given that the buffer of our stream is empty (see (1)) such `DataWritable` event is always emitted. https://github.com/mozilla/neqo/blob/5dfe106669ccb695187511305c21b8e8a8775e91/neqo-http3/src/send_message.rs#L236-L264 The user, on receiving the `DataWritable` event will attempt to write to it via `Http3ServerHandler::send_data`, back to step (2), thus closing the busy loop. How to fix? This commit adds an additional check to the `has_pending_data` function to ensure it indeed does have pending data. This breaks the above busy loop.
Configuration menu - View commit details
-
Copy full SHA for 158fc73 - Browse repository at this point
Copy the full SHA 158fc73View commit details -
Configuration menu - View commit details
-
Copy full SHA for 3beb0c5 - Browse repository at this point
Copy the full SHA 3beb0c5View commit details
Commits on Apr 6, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 611f531 - Browse repository at this point
Copy the full SHA 611f531View commit details
Commits on Apr 7, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 6e6801c - Browse repository at this point
Copy the full SHA 6e6801cView commit details
Commits on Apr 16, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 3f63dc2 - Browse repository at this point
Copy the full SHA 3f63dc2View commit details -
fix(SendMessage): always use available send space
Always use up send space on QUIC layer to ensure receiving `ConnectionEvent::SendStreamWritable` event when more send space is available. See mozilla#1819 for details. This commit implements option 2. Fixes mozilla#1819.
Configuration menu - View commit details
-
Copy full SHA for 1a7d2bf - Browse repository at this point
Copy the full SHA 1a7d2bfView commit details -
Configuration menu - View commit details
-
Copy full SHA for 38fca6b - Browse repository at this point
Copy the full SHA 38fca6bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 7052274 - Browse repository at this point
Copy the full SHA 7052274View 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.