Page MenuHomeFreeBSD

Address two incorrect calculations and enhance readability of PRR code
ClosedPublic

Authored by rscheff on Feb 19 2021, 11:55 PM.
Tags
None
Referenced Files
Unknown Object (File)
Nov 26 2024, 2:13 AM
Unknown Object (File)
Nov 25 2024, 6:03 PM
Unknown Object (File)
Nov 22 2024, 7:57 PM
Unknown Object (File)
Nov 19 2024, 11:16 PM
Unknown Object (File)
Nov 5 2024, 9:06 AM
Unknown Object (File)
Nov 4 2024, 2:59 AM
Unknown Object (File)
Oct 17 2024, 12:35 PM
Unknown Object (File)
Oct 16 2024, 5:45 AM
Subscribers

Details

Summary

While further investigating the reported performance degradations caused
by cwnd sometimes becoming zero during PRR loss recovery, found two subtle
bugs. One was due to an implicit typecast from int to uint by the
in-kernel max() macro. The other an oversight in the hand-coded
implementation of a CEILING() division, where a macro "howmany()" exists,
which is performing an integer-ceiling division.

Further enhanced the readability by using the appropriate, correct type
imax/imin functions, for the PRR calculation match the pseudocode.

Also changed the temporary variables from long to int, as TCP generally
only used 32 bit sequence space - and thus cwnd.

  • address second instance of cwnd potentially becoming zero
  • fix sublte bug due to implicit int to uint typecase in max()
  • fix bug due to typo in hand-coded CEILING() function by using howmany() macro
  • use int instead of long
  • replace if conditionals with easier to read imax/imin (as in pseudocode)...

Diff Detail

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