Page MenuHomeFreeBSD

sysctl net.inet.tcp.ktlslist: do not rely on global generation for ktls sessions
ClosedPublic

Authored by kib on Jun 24 2025, 2:57 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Aug 15, 3:57 PM
Unknown Object (File)
Wed, Aug 13, 8:21 PM
Unknown Object (File)
Wed, Aug 13, 5:33 AM
Unknown Object (File)
Tue, Aug 12, 7:48 PM
Unknown Object (File)
Tue, Aug 12, 2:48 PM
Unknown Object (File)
Sun, Aug 10, 6:25 PM
Unknown Object (File)
Tue, Aug 5, 12:59 AM
Unknown Object (File)
Mon, Jul 28, 12:59 AM

Details

Summary
Disallow parallel executions for the sysctl, which makes it possible to
have the generation count for the sysctl requests itself instead of for the
sessions.  When the first pass over inpcbs is done, assign them the
request' gen count.  On the second pass, only externalize the inpcbs
with ktls sessions which gen count is equal to the current request.

This way, we can be sure that the second pass does not copy out more
inpcbs than was counted for in the first pass, while eliminating the
global atomic op during ktls session creation.

Requested by:   gallatin

Diff Detail

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

Event Timeline

kib requested review of this revision.Jun 24 2025, 2:57 AM
markj added inline comments.
sys/netinet/tcp_subr.c
2695

Add a lock assertion here?

Thank you for moving to this solution, away from a global atomic.

This revision was not accepted when it landed; it landed in state Needs Review.Jun 24 2025, 3:59 PM
This revision was automatically updated to reflect the committed changes.