Page MenuHomeFreeBSD

tcp: improve layout of struct tcpcb
ClosedPublic

Authored by tuexen on Jul 17 2023, 6:45 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Apr 22, 1:14 PM
Unknown Object (File)
Sat, Apr 19, 4:53 PM
Unknown Object (File)
Tue, Mar 25, 6:00 PM
Unknown Object (File)
Feb 22 2025, 4:43 AM
Unknown Object (File)
Feb 14 2025, 4:29 PM
Unknown Object (File)
Feb 14 2025, 10:55 AM
Unknown Object (File)
Feb 14 2025, 10:49 AM
Unknown Object (File)
Feb 11 2025, 5:26 PM
Subscribers

Details

Summary

Move the conditional stuff to the end. I hope we can remove TCPPCAP in FreeBSD 15.

Not using #ifdef for TCP_ACCOUNTING and TCP_REQUEST_TRK would increase the size of the struct. I am open to it, but based on a discussion with rrs@, the compromise was to move them to the end.

Diff Detail

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

Event Timeline

tuexen added a reviewer: gallatin.

Moving to the end is certainly sensible. Have you checked for any padding holes on at least LP64 with ptype /o in GDB?

sys/netinet/tcp_var.h
473

You're creating a 7 byte alignment hole.. I'd try to keep the uint8_t's together. Eg, put TCP_ACCOUNTING in a different place, and put the tcp_hybrid* after tcp_sendfile_track.

sys/netinet/tcp_var.h
473

When moving TCP_ACCOUNTING around, it is not at the end anymore... That is the only intention here...

Avoid holes on 64-bit systems when all options are defined.

sys/netinet/tcp_var.h
473

Moved things around, now avoiding any holes on 64-bit platforms when TCP_ACCOUNTING and TCP_REQUEST_TRK is defined.

I think this will work much better. Thanks

About t_osd. It seems to be used only by alternative cc modules. Can we move it into their software context structures?

This revision was not accepted when it landed; it landed in state Needs Review.Jul 19 2023, 12:51 PM
This revision was automatically updated to reflect the committed changes.