Skip to content

tunnet: offer USO6 so a guest kernel enables UDP segmentation offload - #539

Merged
CMGS merged 1 commit into
mainfrom
tunnet/offer-uso6
Nov 9, 2026
Merged

CMGS merged 1 commit into
mainfrom
tunnet/offer-uso6

Conversation

@CMGS

@CMGS CMGS commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

The guest kernel enables USO only when both USO4 and USO6 are offered. The host's hello offered USO4 alone, so the guest's tun0 kept tx-udp-segmentation off. Every frame the guest sent therefore carried a single datagram, and the host's UDP GSO path never ran.

Change

  • OffloadUSO6 = 0x40 is added to segmentable.
  • The host still drops an IPv6 frame, as it drops any non-IPv4 packet.
  • docs/advanced-network.md: the hello table and the offload paragraph now list USO6.
  • TestRouterAnnouncesRewritesAndPassesOnlyReplies asserts that the host hello carries both TSO4 and the USO pair. The test fails against the old segmentable.

Evidence (hardware, base e38c762; 8 runs per arm in ABBABAAB order)

Guest sender Before After Change
UDP_SEGMENT → server netns 972 Mbit/s 2438 Mbit/s +151%, p=0.0008
UDP_SEGMENT → host veth 878 Mbit/s 1897 Mbit/s +116%, p=0.0008
Plain UDP +0.8% / +0.7%
  • With the change, a guest frame carries 42 datagrams.
  • The two arms' ranges do not overlap.
  • No frames were dropped across the 64 runs.

Host to guest is unaffected: the host merges only TCP toward the guest.

Gates

  • make go-lint: 10× 0 issues.
  • asl -forwarder=false ./...: clean on both GOOS.
  • go test -race ./tunnet/: ok.

The guest enables USO only as the USO4 and USO6 pair, and the host offered
USO4 alone, so every guest frame carried one datagram. With USO6 offered,
UDP_SEGMENT senders in the guest run at 2438 vs 972 Mbit/s to a server
netns and 1897 vs 878 Mbit/s to the host (8 ABBA runs each, p=0.0008);
plain UDP is unchanged. The host still drops IPv6 frames as it drops any
non-IPv4 packet.
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