Page MenuHomeFreeBSD

tuntap: add IFCAP_TXCSUM and IFCAP_TXCSUM_IPV6
AbandonedPublic

Authored by timo.voelker_fh-muenster.de on Jul 13 2025, 3:47 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, May 17, 3:57 PM
Unknown Object (File)
Sun, May 17, 3:35 PM
Unknown Object (File)
Sun, May 17, 10:21 AM
Unknown Object (File)
Sun, May 17, 12:46 AM
Unknown Object (File)
Wed, May 13, 5:42 PM
Unknown Object (File)
Sat, May 9, 10:21 AM
Unknown Object (File)
Apr 27 2026, 6:45 AM
Unknown Object (File)
Apr 19 2026, 3:07 AM

Details

Reviewers
kevans
tuexen
Summary

Add IFCAP_TXCSUM and IFCAP_TXCSUM_IPV6 to if_capabilities of tun/tap interfaces. If enabled, csum flags are translated into virtio-net header flags. If the virtio-net header is not available, an error gets returned when reading from the character device.
This will be used to add tx checksum offload functionality for a bhyve guest.

Test Plan

Run

ifconfig tap0 create
ifconfig tap0 txcsum txcsum6

and verify using

ifconfig tap0

that the offloading flags are actually set.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

No functional changes. Just modified comments and code style.

@timo.voelker_fh-muenster.de Is it intended that this patch now contains the changes from D51289?

@timo.voelker_fh-muenster.de Is it intended that this patch now contains the changes from D51289?

No it wasn't. Thanks for noting.

This patch was needed for D51688, but D51688 has changed and now uses the fact that the capabilities are added when a vnet_hdr_len > 0 is set, which obsoletes this patch.