Closed stormshield-damiend closed 10 months ago
I do think this should not be just one commit. I'd suggest at least some commits like this:
cmsg.rs
to cmsg/mod.rs
cmsg
into multiple modules without any other changescmsg
to new structure on the Unix side that can accomodate the changes for WindowsInstead of depending on once_cell, could we use OnceLock
instead? We'd have to bump the MSRV a bunch...
I do think this should not be just one commit. I'd suggest at least some commits like this:
* Move `cmsg.rs` to `cmsg/mod.rs`
Ok i can do that
* Further splitting of `cmsg` into multiple modules without any other changes
Something like encoder.rs
/ decoder.rs
/ iterator.rs
?
* Change `cmsg` to new structure on the Unix side that can accomodate the changes for Windows
Sure i can do that
* Add changes for Windows
In one commit ?
Instead of depending on once_cell, could we use
OnceLock
instead? We'd have to bump the MSRV a bunch...
Yes i can do that, but this is your and @Ralith calls.
I do think this should not be just one commit. I'd suggest at least some commits like this:
* Move `cmsg.rs` to `cmsg/mod.rs`
Ok i can do that
* Further splitting of `cmsg` into multiple modules without any other changes
Something like
encoder.rs
/decoder.rs
/iterator.rs
?
Sorry, I meant splitting along the lines of the split you have now (so in this commit, just splitting unix.rs
out of mod.rs
).
* Change `cmsg` to new structure on the Unix side that can accomodate the changes for Windows
Sure i can do that
* Add changes for Windows
In one commit?
If you think there are multiple stages that can each compile and pass tests, that might be nice?
Instead of depending on once_cell, could we use
OnceLock
instead? We'd have to bump the MSRV a bunch...Yes i can do that, but this is your and @Ralith calls.
Let's see what @Ralith thinks.
I have taken into account @djc remarks. I still need to add Safety comments where needed.
Instead of depending on once_cell, could we use OnceLock instead? We'd have to bump the MSRV a bunch...
Our rule of thumb is 6 months, right? 1.70 is just about there, so I'm fine with it. Tokio's still on 1.63, but probably they just haven't had any need to change, and there's no sense letting that hold us back arbitrarily. It's also a really trivial update, though, so I'm also happy to judge it non-blocking and handle it personally in a followup if @stormshield-damiend wants to stay focused.
Instead of depending on once_cell, could we use OnceLock instead? We'd have to bump the MSRV a bunch...
Our rule of thumb is 6 months, right? 1.70 is just about there, so I'm fine with it. Tokio's still on 1.63, but probably they just haven't had any need to change, and there's no sense letting that hold us back arbitrarily. It's also a really trivial update, though, so I'm also happy to judge it non-blocking and handle it personally in a followup if @stormshield-damiend wants to stay focused.
Fine with me, lets keep the once_cell
dependency and remove it later.
Rebased to include the new quinn-udp tests, but the cfg gates in quinn-udp/tests/tests.rs will need to be relaxed to validate the new functionality.
Addressed outstanding comments. Currently failing:
ecn_v4
: ECN codepoint is not successfully set on transmit (per Wireshark) though we do seem to correctly receive the unset state.ecn_v6
: No packet is received when setting the CE codepoint. I guess we don't actually need this? Weird behavior, still.Dropped ECN CE from the test and fixed the IPv4 ECN cmsg. Should be good to go now.
Added GSO and GRO support while I was at it. I wasn't able to observe GRO working in loopback tests, but at least it isn't hurting.
Bulk benchmark on Windows has ~doubled performance with GSO.
Thanks for taking care of this! This is a huge and long overdue improvement to our performance and reliability on Windows.
This adds support for ECN on Windows using
WSARecvMsg()
andWSASendMsg()
from WinSock API.This solves #765.
Some points need to be discussed or done :
WSARecvMSG()
cannot be accessed directly, we need to retrieve its function pointer using a dedicated call toWSAIoctl()
. This detection may fail on old versions of windows (it seems to have been added as an extension in Windows XP). Do we keep the old API as a fallback (as currently done in the draft PR) ?Some possible long term tasks or benefits :
Feel free to comment on this draft.