HomeFreeBSD

ip: improve deferred computation of checksums

Description

ip: improve deferred computation of checksums

This patch adds the same functionality for the IPv4 header checksum
as was done erlier for the SCTP/TCP/UDP transport checksum.
When the IP implementation sends a packet, it does not compute the
corresponding checksum but defers that. It will determine whether the
network interface selected for the packet has the requested capability
and computes the checksum in software, if the selected network
interface does not have the requested capability.
Do this not only for packets being sent by the local IP stack, but
also when forwarding packets. Furthermore, when such packets are
delivered to a local IP stack, do not compute or validate the checksum,
since such packets have never been on the wire. This allows to support
checksum offloading also in the case of local virtual machines or
jails. Support for epair interfaces will be added in a separate commit.

Reviewed by: pouria, tuexen
Differential Revision: https://reviews.freebsd.org/D54455
Event: Wiesbaden Hackathon 2026

(cherry picked from commit 6f15ba8004c3fdc2fb12f0cd6618d1b3a40aab7d)

Details

Provenance
timo.voelker_fh-muenster.deAuthored on Jan 20 2026, 10:30 AM
tuexenCommitted on Apr 26 2026, 7:42 AM
Reviewer
pouria
Differential Revision
D54455: ip: improve deferred computation of checksums
Parents
rG1e5aff8e5bc6: contrib/tzdata: import tzdata 2026b
Branches
Unknown
Tags
Unknown