-
Notifications
You must be signed in to change notification settings - Fork 119
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
fix(s2n-quic-transport): only allow GSO of MTU-sized packets #1613
Conversation
7db775a
to
305edf3
Compare
@@ -34,7 +34,7 @@ impl Snapshot { | |||
assert!(rss < 30_000, "{rss}"); | |||
} | |||
"post-close" => { | |||
assert_eq!(rss, 0, "{rss}"); | |||
assert!(rss < 128, "{rss}"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why did this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it has to do with one of our dependencies. It's failing for me in other PRs as well so it doesn't seem related here:
https://github.com/aws/s2n-quic/actions/runs/4028993317/jobs/6926443934
}); | ||
|
||
if transmit_result.is_ok() { | ||
if queue.has_capacity() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only error I see that was coming out of this previously was ConnectionOnTransmitError::NoDatagram
, just wanted to check that its ok to continue iteration in that case
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah the idea is to not rely on if the connection decided to transmit something or not. Instead we want to know what the actual capacity of the queue is and make the decision that way.
Co-authored-by: Wesley Rosenblum <[email protected]>
Description of changes:
I noticed an issue when determining if a transmission can be included as a GSO segment or not. The current logic is to allow any packet sizes to be considered for GSO, as long we aren't MTU probing. This isn't really ideal, since a previous transmission to the same tuple could have been a small ACK packet. This means we're artificially clamping MTU to the small ACK size, rather than allowing the connection to transmit a full MTU.
This change, instead, only allows GSO on transmissions if the segment size is
>=
than the path's MTU for the current transmission mode. This results in more connections transmitting correctly, rather than bailing since we may end up deciding to not write a packet if the segment size is too small (initial packets, etc).Call-outs:
In experimentation, I also noticed the socket buffer queue sizes were somewhat small and will many concurrent connections I was filling it up a lot. This PR includes a default that is double the previous, as well as an unstable configuration of the value via environment variables.
I'm going to be revamping the IO implementation in the next coming weeks, and this environment variable will likely be gone after I'm done.
Testing:
I wrote a handshake fuzzer for this test. I'm planning on submitting a PR and put it under
/tools
later.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.