virtio_net: don't kill worker on malformed tx packet#2777
virtio_net: don't kill worker on malformed tx packet#2777benhillis wants to merge 3 commits intomicrosoft:mainfrom
Conversation
There was a problem hiding this comment.
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
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
| match err { | ||
| WorkerError::Packet(_) => { | ||
| tracelimit::warn_ratelimited!( | ||
| error = &err as &dyn std::error::Error, | ||
| "dropping malformed tx packet" | ||
| ); | ||
| continue; | ||
| } | ||
| other => return Err(other), | ||
| } |
There was a problem hiding this comment.
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); |
|
this has been fixed in a different change |
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.