Page MenuHomeFreeBSD

sockets: provide solisten_clone(), solisten_enqueue()
ClosedPublic

Authored by glebius on Aug 7 2022, 7:16 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Nov 15, 4:45 AM
Unknown Object (File)
Fri, Nov 8, 5:09 AM
Unknown Object (File)
Wed, Nov 6, 2:31 PM
Unknown Object (File)
Tue, Nov 5, 6:44 AM
Unknown Object (File)
Thu, Oct 31, 4:52 PM
Unknown Object (File)
Oct 17 2024, 3:45 PM
Unknown Object (File)
Oct 17 2024, 3:25 AM
Unknown Object (File)
Oct 17 2024, 2:29 AM
Subscribers

Details

Summary

as alternative KPI to sonewconn(). The latter has three stages:

  • check the listening socket queue limits
  • allocate a new socket
  • call into protocol attach method
  • link the new socket into the listen queue of the listening socket

The attach method, originally designed for a creation of socket by the
socket(2) syscall has slightly different semantics than attach of a socket
cloned by listener. Make it possible for protocols to call into the
first stage, then perform a different attach, and then call into the
final stage. The first stage, that checks limits and clones a socket
is called solisten_clone(), and the function that enqueues the socket
is solisten_enqueue().

Diff Detail

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

Event Timeline

tuexen added inline comments.
sys/kern/uipc_socket.c
712–716

Should this be "solisten_clone: instead of "sonewconn:?

719–720

Should this be "solisten_clone: instead of "sonewconn:?

sys/sys/socketvar.h
477

Should there be variable names for consistency?

480

Should there be a variable name for consistency?

glebius added inline comments.
sys/kern/uipc_socket.c
719–720

This was done intentionally. The sonewconn log message is known to sysadmins since previous century, has multiple references in the Internet discussions. It is what happens when a web server is too slow to accept connections. Also, we have a test that looks for exactly for this particular message.

sys/sys/socketvar.h
480

Should there be a variable name for consistency?

I'm not sure. I personally prefer to get rid of them, usually in a creeping way - when editing the code. Not sure this matches project policy, though. My rationale is that we can have freedom to rename variables in the implementation without touching headers. Also shortens declarations. And style(9) has nothing on this topic.

tuexen added inline comments.
sys/kern/uipc_socket.c
719–720

Maybe add a short comment stating that it is done intentionally. If not, someone might think it is a copy and past error and fixes it.

This revision is now accepted and ready to land.Aug 8 2022, 9:56 PM
glebius marked an inline comment as done.

Shorten argument list for solisten_enqueue(). No functional changes.

This revision now requires review to proceed.Aug 8 2022, 9:57 PM
glebius added inline comments.
sys/kern/uipc_socket.c
719–720

Yep, that's a good idea!

glebius marked an inline comment as done.

Add comment on why do we start log message with "sonewconn:".

This revision is now accepted and ready to land.Aug 9 2022, 1:32 PM