consomme: perf improvements#3555
Open
Brian-Perkins wants to merge 4 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR targets performance improvements in the net_consomme networking backend by reducing per-packet overhead in the virtio queue TX path and optimizing the TCP fast path (ACK behavior, socket settings) while adding richer diagnostics via inspectable counters/histograms.
Changes:
- Reuse a TX scratch buffer in the queue to avoid per-packet heap allocations, and add a stored waker to wake the poll loop when RX buffers become available.
- Update the TCP implementation to reduce ACK traffic (defer pure ACKs to poll cycles), disable Nagle (
TCP_NODELAY), and refine window-scaling behavior to activate only after the handshake completes. - Add aggregate and per-connection TCP statistics for inspect/diagnostics.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
vm/devices/net/net_consomme/src/lib.rs |
Adds TX scratch-buffer reuse and queue waker handling to reduce allocations and improve wakeups when RX buffers reappear. |
vm/devices/net/net_consomme/consomme/src/tcp.rs |
TCP-path perf/behavior changes (ACK coalescing, window-scaling activation timing, TCP_NODELAY) plus new inspect stats; includes a new “re-arm waker” read when TX buffer fills. |
jstarks
reviewed
May 22, 2026
jstarks
reviewed
May 22, 2026
jstarks
reviewed
May 22, 2026
jstarks
reviewed
May 22, 2026
jstarks
reviewed
May 22, 2026
jstarks
reviewed
May 22, 2026
jstarks
reviewed
May 22, 2026
|
This PR modifies files containing For more on why we check whole files, instead of just diffs, check out the Rustonomicon |
Comment on lines
+455
to
+458
| // Reuse the scratch buffer to avoid per-packet heap allocation. | ||
| let mut buf = std::mem::take(&mut self.state.tx_scratch); | ||
| buf.clear(); | ||
| buf.resize(meta.len as usize, 0); |
Comment on lines
+247
to
+255
| /// Bytes sent from host to guest. | ||
| bytes_tx_to_guest: Counter, | ||
| /// Bytes received from guest to host. | ||
| bytes_rx_from_guest: Counter, | ||
| /// Packets sent from host to guest. | ||
| pkts_tx_to_guest: Counter, | ||
| /// Packets received from guest to host. | ||
| pkts_rx_from_guest: Counter, | ||
| /// ACKs sent. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.