Skip to content
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

udp: disable GSO on EINVAL #1637

Merged
merged 1 commit into from
Aug 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions quinn-udp/src/unix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -265,15 +265,15 @@ fn send(
}
io::ErrorKind::WouldBlock => return Err(e),
_ => {
// Some network adapters do not support GSO. Unfortunately, Linux offers no easy way
// for us to detect this short of an I/O error when we try to actually send
// datagrams using it.
// Some network adapters and drivers do not support GSO. Unfortunately, Linux
// offers no easy way for us to detect this short of an EIO or sometimes EINVAL
// when we try to actually send datagrams using it.
#[cfg(target_os = "linux")]
if e.raw_os_error() == Some(libc::EIO) {
if let Some(libc::EIO) | Some(libc::EINVAL) = e.raw_os_error() {
// Prevent new transmits from being scheduled using GSO. Existing GSO transmits
// may already be in the pipeline, so we need to tolerate additional failures.
if state.max_gso_segments() > 1 {
tracing::error!("got EIO, halting segmentation offload");
tracing::error!("got transmit error, halting segmentation offload");
state
.max_gso_segments
.store(1, std::sync::atomic::Ordering::Relaxed);
Expand Down