-
Notifications
You must be signed in to change notification settings - Fork 167
virtio_net: don't kill worker on malformed tx packet #2777
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
base: main
Are you sure you want to change the base?
Conversation
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.
Pull request overview
This PR prevents the virtio_net TX worker loop from permanently exiting when it encounters a malformed TX descriptor chain (e.g., empty payload). Instead of propagating the error out of main_loop, it logs a warning and continues processing subsequent packets.
Changes:
- Catch
queue_tx_packetfailures in the TX receive path and continue the worker loop. - Emit a warning when a malformed TX packet is dropped instead of terminating the queue-pair worker.
a181ecd to
fa52f5b
Compare
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.
Pull request overview
Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.
A single malformed TX packet (e.g. empty payload) caused queue_tx_packet to return an error that propagated through the main_loop, permanently killing the worker for that queue pair. Instead, log a warning and continue processing.
fa52f5b to
a9fae07
Compare
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.
Pull request overview
Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.
| match err { | ||
| WorkerError::Packet(_) => { | ||
| tracelimit::warn_ratelimited!( | ||
| error = &err as &dyn std::error::Error, | ||
| "dropping malformed tx packet" | ||
| ); | ||
| continue; | ||
| } | ||
| other => return Err(other), | ||
| } |
Copilot
AI
Feb 10, 2026
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.
This match err { ... } moves err, but the logging line inside the WorkerError::Packet(_) arm still references err (error = &err ...). This should fail to compile with a "use of moved value" error. Restructure to match on &err (or use if let WorkerError::Packet(_) = &err { ... }) so you can borrow for logging and still propagate the owned err in the non-packet case.
| match err { | |
| WorkerError::Packet(_) => { | |
| tracelimit::warn_ratelimited!( | |
| error = &err as &dyn std::error::Error, | |
| "dropping malformed tx packet" | |
| ); | |
| continue; | |
| } | |
| other => return Err(other), | |
| } | |
| if let WorkerError::Packet(_) = &err { | |
| tracelimit::warn_ratelimited!( | |
| error = &err as &dyn std::error::Error, | |
| "dropping malformed tx packet" | |
| ); | |
| continue; | |
| } | |
| return Err(err); |
A single malformed TX packet (e.g. empty payload) caused queue_tx_packet to return an error that propagated through the main_loop, permanently killing the worker for that queue pair. Instead, log a warning and continue processing.