HomeFreeBSD

sctp, tcp, udp: improve deferred computation of checksums

Description

sctp, tcp, udp: improve deferred computation of checksums

When the SCTP, TCP, or UDP implementation send a packet, it does not
compute the corresponding checksum but defers that. The network layer
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 doesn't have the requested
capability.
Do this not only for packets being sent by the local SCTP, TCP,
and UDP stack, but also when forwarding packets. Furthermore, when
such packets are delivered to a local SCTP, TCP, or UDP stack, do not
compute or validate the checksum, since such packets never have been on
the wire.
This allows to support checksum offloading also in the case of local
virtual machines or jails.
Support for epair, vtnet, and tap interfaces will be added in
separate commits.

Reviewed by: kp, rgrimes, tuexen, manpages
Differential Revision: https://reviews.freebsd.org/D51475

(cherry picked from commit bcb298fa9e23c1192c5707086a67d3b396186abc)

Details

Provenance
timo.voelker_fh-muenster.deAuthored on Aug 1 2025, 10:09 AM
tuexenCommitted on Sep 5 2025, 6:48 PM
Reviewer
kp
Differential Revision
D51475: sctp, tcp, udp: improve deferred computation of checksums
Parents
rG5c00ab0924b2: tcp: improve variable and constant names
Branches
Unknown
Tags
Unknown