Page MenuHomeFreeBSD

tcp: avoid useless calculations in tcp_account_for_send() when len is 0
ClosedPublic

Authored by gallatin on Sep 14 2021, 2:54 PM.
Tags
None
Referenced Files
F135425441: D31959.diff
Sun, Nov 9, 6:17 PM
Unknown Object (File)
Mon, Nov 3, 1:16 PM
Unknown Object (File)
Fri, Oct 31, 2:20 AM
Unknown Object (File)
Wed, Oct 29, 11:19 PM
Unknown Object (File)
Wed, Oct 29, 3:05 PM
Unknown Object (File)
Wed, Oct 29, 2:41 PM
Unknown Object (File)
Wed, Oct 29, 2:39 PM
Unknown Object (File)
Sun, Oct 26, 7:27 PM
Subscribers

Details

Summary

When the length is 0, the retransmit rate could not have changed, so avoid doing math to determine if we need to move a TLS connection from hardware to software.

This also fixes a potential bug when switching from an old or buggy TCP stack which does not call into tcp_account_for_send(). In this case, the first call into tcp_account_for_send() will find the t_sndbytes and t_snd_rxt_bytes as 0, and if that first call is for a rexmit, we'll hit a divide-by-zero bug unless we guard against a zero length.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable