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
F163142050: D51291.id159595.diff
Mon, Jul 20, 11:42 AM
Unknown Object (File)
Sun, Jul 19, 2:54 AM
Unknown Object (File)
Sat, Jul 18, 12:57 PM
Unknown Object (File)
Sun, Jul 12, 3:42 AM
Unknown Object (File)
Wed, Jul 8, 5:11 PM
Unknown Object (File)
Sat, Jul 4, 3:11 AM
Unknown Object (File)
Fri, Jul 3, 9:30 AM
Unknown Object (File)
Sun, Jun 21, 10:40 PM

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.