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
Unknown Object (File)
Mon, Mar 25, 9:45 AM
Unknown Object (File)
Dec 23 2023, 5:08 AM
Unknown Object (File)
Dec 14 2023, 9:44 PM
Unknown Object (File)
Oct 23 2023, 6:20 PM
Unknown Object (File)
Jul 14 2023, 9:07 PM
Unknown Object (File)
Jun 28 2023, 8:28 PM
Unknown Object (File)
Jun 28 2023, 8:28 PM
Unknown Object (File)
Jun 28 2023, 8:25 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 Skipped
Unit
Tests Skipped