Page MenuHomeFreeBSD

tcp: With the right options in the kernel cc_cubic stays in slowstart always.
ClosedPublic

Authored by rrs on Jun 26 2023, 9:56 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Apr 22, 9:15 PM
Unknown Object (File)
Sun, Apr 7, 5:08 PM
Unknown Object (File)
Mar 30 2024, 7:25 AM
Unknown Object (File)
Feb 13 2024, 4:57 PM
Unknown Object (File)
Jan 14 2024, 9:11 AM
Unknown Object (File)
Dec 23 2023, 12:35 AM
Unknown Object (File)
Oct 12 2023, 2:09 AM
Unknown Object (File)
Aug 15 2023, 11:23 PM

Details

Summary

So this is a subtle bug I have found in cubic. If you compile a number of options into the kernel (accounting and tracking) then
all of the kernel code "knows" the proper offset of t_rttupdatecnt however cubic does not see the options (and htcp too) and thus
will look for the count in the wrong place seeing 0. Which then means it never builds an MIN RTT which then means it
always hangs in slowstart.

Test Plan

Rebuild the kernel with the new tcpcb layout and test to make sure cubic comes out of SS.

Diff Detail

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

Event Timeline

rrs requested review of this revision.Jun 26 2023, 9:56 PM

Why do the CUBIC and HTCP cc modules see a different struct tcpcb than the reset of the code?

I just wondered the exact same thing...

Wouldn't it be better to have opt_inet.h included explicitly in tcp_var.h - since that is where those compile time options appear to be defined? Then any kernel module should have the same visibility to the optional variables. I feel moving the variables around and relying on them to stay in a particular order is brittle...

struct tcpcb depends on TCP_ACCOUNTING, TCP_REQUEST_TRK, TCPPCAP, and TCP_HHOOK. It seems that all these are defined in opt_global.h, except TCP_ACCOUNTING, which is defined in opt_inet.h. This does not look consistent to me. So I think the best might be to move TCP_ACCOUNTING from opt_inet.h to opt_global.h? @rrs Does that also solve the issue?

After looking at this and thinking on it changing the structure is the *wrong* approach since it leaves a landmine in place
that can get someone if they don't include opt_inet.h. The better choice is to make all things that ifdef in the tcppcb to
be in opt_global.h so that the entire kernel always knows what tcpcb looks like.

This revision is now accepted and ready to land.Jun 27 2023, 11:15 AM