This logic can lead to a busy-loop if process_tx() returns a persistent error other than NothingWritten. In such cases, tx_has_deferred_frame will be false, and if the guest continues to supply TX buffers (has_new_entries is true), this loop will repeatedly call process_tx() and fail. The loop should be broken on any error from process_tx() to avoid this.
let result = self.process_tx();
self.tx_has_deferred_frame =
matches!(result, Err(TxError::Backend(WriteError::NothingWritten)));
if let Err(e) = result {
if !self.tx_has_deferred_frame {
log::error!("Failed to process tx: {e:?}");
}
break;
}
if !self.tx_q.queue.enable_notification(&self.mem).unwrap() {
break;
}
Originally posted by @gemini-code-assist[bot] in #556 (comment)
This logic can lead to a busy-loop if
process_tx()returns a persistent error other thanNothingWritten. In such cases,tx_has_deferred_framewill befalse, and if the guest continues to supply TX buffers (has_new_entriesistrue), this loop will repeatedly callprocess_tx()and fail. The loop should be broken on any error fromprocess_tx()to avoid this.Originally posted by @gemini-code-assist[bot] in #556 (comment)