Skip to content
Open
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
6 changes: 5 additions & 1 deletion src/devices/src/virtio/net/worker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,11 @@ impl NetWorker {
Err(TxError::Backend(WriteError::NothingWritten)) => true,
Err(e) => {
log::error!("Failed to process tx: {e:?}");
false
// Re-enable notifications before breaking so the guest
// can still kick the TX queue on future descriptors.
let _ = self.tx_q.queue.enable_notification(&self.mem);
self.tx_has_deferred_frame = false;
break;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is right:

  • What would be the value of self.tx_has_deferred_frame after the break? before this change the value is false, which means we don't need to set up a timer.
  • Even if the value is false, this is not right since the code is not clear.
  • If we break here, we don't call tx_q.queue.enable_notification(&self.mem) which may not be correct. The current code always call tx_q.queue.enable_notification on each iteration.
  • There is no busy loop - I think the issue is wrong. The purpose of the worker is to write frames from the guest. If we we cannot write frames we should drop the fame, log an error and continue. In the worst case we will have unrecoverable error that will drop all frames and write lot of logs. There is nothing wrong about this, and it will make the issue easy to debug.

The issue was suggested by Gemini, and I opened it for discussion. I suggest to finish the discussion on the issue before making changes.

}
_ => false,
};
Expand Down