Page MenuHomeFreeBSD

vtnet: offer VIRTIO_NET_F_GUEST_CSUM independently of RXCSUM
Needs ReviewPublic

Authored by timo.voelker_fh-muenster.de on Thu, Aug 20, 6:31 PM.
Tags
None
Referenced Files
F168010241: D59052.id.diff
Tue, Aug 25, 9:46 PM
F167982189: D59052.diff
Tue, Aug 25, 6:06 PM
F167909019: D59052.id184534.diff
Tue, Aug 25, 9:30 AM
Unknown Object (File)
Mon, Aug 24, 1:16 PM
Unknown Object (File)
Sun, Aug 23, 6:53 PM
Unknown Object (File)
Sun, Aug 23, 6:20 PM
Unknown Object (File)
Sun, Aug 23, 8:52 AM
Unknown Object (File)
Fri, Aug 21, 1:55 AM
Subscribers

Details

Summary

Always offer the VIRTIO_NET_F_GUEST_CSUM feature to the host, and not only if RXCSUM is enabled on vtnet. Instead of using RXCSUM to control whether this feature will be negotiated with the host, just use it to control whether the VIRTIO_NET_HDR_F_DATA_VALID flag on an incoming packet is processed (i.e., translated to the corresponding mbuf flag only if RXCSUM is enabled on the vtnet interface).

This has two benefits.

  1. Enabling/disabling RXCSUM on vtnet does not require feature renegotiation.
  1. The host is always allowed to send locally generated TCP or UDP packets to the guest without computing a full checksum (by setting the VIRTIO_NET_HDR_F_NEEDS_CSUM flag) and not only if the guest has enabled RXCSUM on vtnet. Since locally generated packets do not require a checksum, this saves otherwise unnecessarily wasted computing power.

If a user of a FreeBSD guest really does not want to negotiate the VIRTIO_NET_F_GUEST_CSUM feature with the host, it still can disable the loader tunable hw.vtnet.csum_disable.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped