diff options
author | Gleb Smirnoff <glebius@FreeBSD.org> | 2022-08-10 18:09:34 +0000 |
---|---|---|
committer | Gleb Smirnoff <glebius@FreeBSD.org> | 2022-08-10 18:09:34 +0000 |
commit | 07285bb4c22c026a50f69149d5dae03169b15fe4 (patch) | |
tree | 847d6bae12b7b9baf3f7a726da2b63db12c73d52 /sys/sys | |
parent | 8f5a0a2e4f315a03caaa2d51efdcf837e303e510 (diff) | |
download | src-07285bb4c22c026a50f69149d5dae03169b15fe4.tar.gz src-07285bb4c22c026a50f69149d5dae03169b15fe4.zip |
tcp: utilize new solisten_clone() and solisten_enqueue()
This streamlines cloning of a socket from a listener. Now we do not
drop the inpcb lock during creation of a new socket, do not do useless
state transitions, and put a fully initialized socket+inpcb+tcpcb into
the listen queue.
Before this change, first we would allocate the socket and inpcb+tcpcb via
tcp_usr_attach() as TCPS_CLOSED, link them into global list of pcbs, unlock
pcb and put this onto incomplete queue (see 6f3caa6d815). Then, after
sonewconn() we would lock it again, transition into TCPS_SYN_RECEIVED,
insert into inpcb hash, finalize initialization of tcpcb. And then, in
call into tcp_do_segment() and upon transition to TCPS_ESTABLISHED call
soisconnected(). This call would lock the listening socket once again
with a LOR protection sequence and then we would relocate the socket onto
the complete queue and only now it is ready for accept(2).
Reviewed by: rrs, tuexen
Differential revision: https://reviews.freebsd.org/D36064
Diffstat (limited to 'sys/sys')
-rw-r--r-- | sys/sys/socketvar.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/sys/socketvar.h b/sys/sys/socketvar.h index ed797c6d6239..678642eeff6d 100644 --- a/sys/sys/socketvar.h +++ b/sys/sys/socketvar.h @@ -498,6 +498,7 @@ int soreceive_generic(struct socket *so, struct sockaddr **paddr, struct uio *uio, struct mbuf **mp0, struct mbuf **controlp, int *flagsp); void sorele_locked(struct socket *so); +void sodealloc(struct socket *); int soreserve(struct socket *so, u_long sndcc, u_long rcvcc); void sorflush(struct socket *so); int sosend(struct socket *so, struct sockaddr *addr, struct uio *uio, |