HomeFreeBSD

vtnet: improve checksum offloading

Description

vtnet: improve checksum offloading

When transmitting a packet over the vtnet interface, map the
csum flags CSUM_DATA_VALID | CSUM_PSEUDO_HDR to the virtio
flag VIRTIO_NET_HDR_F_DATA_VALID.
When receiving a packet over the virtio network channel, translate
the virtio flag VIRTIO_NET_HDR_F_NEEDS_CSUM not to CSUM_DATA_VALID |
CSUM_PSEUDO_HDR, but to CSUM_TCP, CSUM_TCP_IPV6, CSUM_UDP, or
CSUM_UDP_IPV6.
The second change fixes a series of issue related to checksum
offloading for if_vtnet.
While there, improve the stats counters to allow a detailed view
on what is going on in relation to checksum offloading.

PR: 165059
Reviewed by: tuexen, manpages
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D51686

Details

Provenance
timo.voelker_fh-muenster.deAuthored on Sep 8 2025, 8:38 PM
tuexenCommitted on Sep 8 2025, 8:38 PM
Reviewer
tuexen
Differential Revision
D51686: vtnet: fix translation between mbuf and virtio flags
Parents
rGf217bc7651a4: Revert "vtnet: improve checksum offloading"
Branches
Unknown
Tags
Unknown