Page MenuHomeFreeBSD

solisten: separate listening sockets from data flow sockets
AbandonedPublic

Authored by glebius on Jan 27 2017, 12:46 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Nov 3, 5:29 AM
Unknown Object (File)
Sun, Nov 3, 5:29 AM
Unknown Object (File)
Sun, Nov 3, 5:28 AM
Unknown Object (File)
Sun, Nov 3, 5:18 AM
Unknown Object (File)
Oct 23 2024, 11:59 AM
Unknown Object (File)
Oct 15 2024, 12:22 PM
Unknown Object (File)
Oct 14 2024, 3:16 PM
Unknown Object (File)
Sep 30 2024, 10:23 PM
Subscribers

Details

Reviewers
rwatson
Group Reviewers
network
manpages
transport
Summary

If we look into current struct socket, we see that some functional fields
belong to normal data flow sockets, and other belong to listening socket.
They are never used simultaneously. Now, if we look at socket API, we see
that once a socket underwent transformation to a listening socket, only 3
regular syscalls now may be called: listen(2), accept(2) and close(2) and
a subset of ioctl() and setsockopt() parameters is accepted. A listening
socket cannot be closed from the protocol side, only from user side. So,
listening socket is so different from a dataflow socket, that separating
them looks architecturally right thing to do.

The benefits are:

  1. Nicer code (I hope).
  2. Smaller 'struct socket'.
  3. Having two different locks for socket and solisten, we can try to get rid of ACCEPT_LOCK global lock.

The patch is in a very pre-alpha state. It has been run only in my bhyve VM.

It passes regression tests from tools/regression/sockets and tests/sys,
including the race tests.

For TCP it passes basic functionality testing, but could be there are still
races remaining after ACCEPT_LOCK removal.

For SCTP the patch is unfinished yet. The tricky thing with SCTP is that it
can un-listen a listening socket back to normal socket, doing listen(fd, 0)
on it. My patch has API for that I started working on SCTP, but temporarily
put this problem aside. It looks solvable, but I don't know yet how to test
it. Better first see results with TCP.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 7160
Build 7330: arc lint + arc unit

Event Timeline

glebius retitled this revision from to solisten: separate listening sockets from data flow sockets.
glebius updated this object.
glebius edited the test plan for this revision. (Show Details)
glebius added a reviewer: network.
bz added a subscriber: bz.

Just on principle. Too bad Sam 's not here.

glebius edited edge metadata.

Just a few updates.

Patch radically changed and development moved to https://github.com/glebius/FreeBSD (branch solisten).