Skip to content

Conversation

@benhillis
Copy link
Member

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.

@benhillis benhillis requested a review from a team as a code owner February 10, 2026 16:20
Copilot AI review requested due to automatic review settings February 10, 2026 16:20
Copy link
Contributor

Copilot AI left a 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_packet failures 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.

@benhillis benhillis force-pushed the fix/virtio_net-malformed-tx branch from a181ecd to fa52f5b Compare February 10, 2026 18:36
@benhillis benhillis requested a review from a team as a code owner February 10, 2026 18:36
@benhillis benhillis requested a review from Copilot February 10, 2026 18:38
Copy link
Contributor

Copilot AI left a 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.

@github-actions
Copy link

OpenVMM Team added 3 commits February 10, 2026 19:47
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.
Copy link
Contributor

Copilot AI left a 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.

Comment on lines +842 to +851
match err {
WorkerError::Packet(_) => {
tracelimit::warn_ratelimited!(
error = &err as &dyn std::error::Error,
"dropping malformed tx packet"
);
continue;
}
other => return Err(other),
}
Copy link

Copilot AI Feb 10, 2026

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.

Suggested change
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);

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant