Skip to content

virtio-net: Add LRO support for TCPv4 and TCPv6 segments#3413

Open
damanm24 wants to merge 38 commits intomicrosoft:mainfrom
damanm24:lro
Open

virtio-net: Add LRO support for TCPv4 and TCPv6 segments#3413
damanm24 wants to merge 38 commits intomicrosoft:mainfrom
damanm24:lro

Conversation

@damanm24
Copy link
Copy Markdown
Contributor

@damanm24 damanm24 commented May 1, 2026

This PR adds LRO support for our virtio-net device and makes the corresponding changes to the TAP and Consomme backends to take advantage of the new feature.

Burette tests showed ~75% improvement in TCP rx throughput with the TAP backend.
Consomme showed a ~37% reduction in CPU usage while maintaining similar rx throughput. Through further experimentation, the throughput improvements here are bounded by Tcp::ConnectionParams::tx_buffer_size (i.e. increasing this parameter (to 512 kb) showed same level of improvement as the TAP backend)

Copilot AI review requested due to automatic review settings May 1, 2026 18:32
@damanm24 damanm24 requested a review from a team as a code owner May 1, 2026 18:32
Co-authored-by: Copilot <copilot@github.com>
Copy link
Copy Markdown
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 introduces receive-side LRO/GSO plumbing for virtio-net by propagating coalesced-packet metadata from network backends (TAP and Consomme) through net_backend::RxMetadata into the virtio-net header (GUEST_TSO4/6).

Changes:

  • Advertise VIRTIO_NET_F_GUEST_TSO4/6 and plumb negotiated guest TSO features into virtio-net RX buffer handling.
  • Extend net_backend::RxMetadata with L3/L2/L3/L4 header length + GSO size fields and populate them in TAP and Consomme RX paths.
  • Update Consomme TCP send path to optionally emit larger-than-MSS frames with TSO metadata.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
vm/devices/virtio/virtio_net/src/lib.rs Advertises guest TSO4/6 and passes negotiated features into RX work-pool setup.
vm/devices/virtio/virtio_net/src/buffers.rs Builds virtio-net RX headers with GSO fields derived from backend-provided metadata.
vm/devices/net/net_tap/src/lib.rs Enables TAP RX offloads and parses vnet headers into new RX GSO metadata fields.
vm/devices/net/net_consomme/src/lib.rs Populates new RX GSO metadata (L3 + header lens + MSS) for packets received from Consomme.
vm/devices/net/net_consomme/consomme/src/tcp.rs Adds ability to emit larger TCP frames flagged as TSO/LRO to downstream client.
vm/devices/net/net_backend/src/lib.rs Extends RxMetadata with GSO/LRO-related fields and defaults.

Comment thread vm/devices/virtio/virtio_net/src/buffers.rs Outdated
Comment thread vm/devices/net/net_tap/src/lib.rs Outdated
Comment thread vm/devices/net/net_tap/src/lib.rs
Comment thread vm/devices/virtio/virtio_net/src/buffers.rs Outdated
Comment thread vm/devices/net/net_consomme/src/lib.rs Outdated
Comment thread vm/devices/net/net_consomme/src/lib.rs
Comment thread vm/devices/net/net_backend/src/lib.rs
Comment thread vm/devices/net/net_consomme/consomme/src/tcp.rs
Comment thread vm/devices/net/net_tap/src/lib.rs
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 1, 2026

Daman Mulye and others added 2 commits May 1, 2026 14:50
Co-authored-by: Copilot <copilot@github.com>
Copilot AI review requested due to automatic review settings May 1, 2026 22:13
Copy link
Copy Markdown
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 7 out of 7 changed files in this pull request and generated 6 comments.

Comment thread vm/devices/virtio/virtio_net/src/buffers.rs
Comment thread vm/devices/net/net_tap/src/lib.rs
Comment thread vm/devices/net/net_tap/src/lib.rs
Comment thread vm/devices/net/net_tap/src/lib.rs
Comment thread vm/devices/net/net_consomme/consomme/src/tcp.rs
Comment thread vm/devices/net/net_consomme/src/lib.rs
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.

2 participants