Page MenuHomeFreeBSD

tcp: improve layout of struct tcpcb
ClosedPublic

Authored by tuexen on Jul 17 2023, 6:45 PM.
Tags
None
Referenced Files
F86860647: D41059.id.diff
Wed, Jun 26, 4:47 PM
Unknown Object (File)
Mon, Jun 3, 6:27 AM
Unknown Object (File)
May 22 2024, 11:31 AM
Unknown Object (File)
May 4 2024, 6:27 AM
Unknown Object (File)
Apr 26 2024, 11:55 PM
Unknown Object (File)
Apr 26 2024, 11:55 PM
Unknown Object (File)
Apr 26 2024, 10:39 PM
Unknown Object (File)
Apr 26 2024, 10:39 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.