fix: respecting max_datagrams in poll_transmit#2185
Conversation
That code exists so that the application layer can easily opt out of GSO without needing to replace the UDP socket abstraction. |
How about |
|
Oh, you were concerned about the upper bound? We could probably get rid of that entirely, yeah. |
d339e2c to
aeffe92
Compare
Is this something that could be done here in this PR? |
Sure, in a separate commit. |
|
(Be sure to rebase on main to appease CI.) |
aeffe92 to
5900957
Compare
Should we keep the current quinn behavior by moving this max cap over there? From what I see, currently linux systems would start dumping 64 segments instead of 10. Maybe set a default of max 10 in there, but also expose a way to set accordingly? |
That'd be safer than removing it outright, though bare quinn-proto users will still be affected. IMO we should consider relaxing it entirely, but if you're not interested in doing testing that (especially on Windows where the kernel-enforced limit is a full 512 datagrams) we could leave it to future work.
We should avoid offering configuration knobs unless there's clear motivation to support multiple cases, i.e. evidence that no one value is adequate for the vast majority of users. |
|
Could I then move the 10 limit to quinn in this PR and then open an issue to follow up relaxing it? I could maybe work on that later. As far as where to cap it, maybe here is a good place: |
SGTM, thanks!
Yep, that's the spot. |
8e7e23a to
5b6baab
Compare
…tu is large enough to batch When a TLP is the first in the batch and initial mtu is large enough to allow for batching it still should stay under the max_datagrams limit
5b6baab to
d4a5dcf
Compare
|
Would be good to get another round of review from @Ralith before merging. |
flub
left a comment
There was a problem hiding this comment.
Good catch. I remember looking at this and wondering that this was an odd way to check that condition, but didn't realise it would lead to this bug.
Hello,
I've been playing with quinn-proto recently and I noticed that, sometimes, when the maximum segment is large enough quinn will go over the max_datagrams limit of poll_transmit. I believe this PR will fix this issue.
Also, considering that quin-proto is a low level crate, it feels like this code:
quinn/quinn-proto/src/connection/mod.rs
Lines 454 to 457 in 434c358
should be removed and left for the upper level code to decide what max limit they truly want to use.