From nobody Mon Mar 18 15:53:00 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Tyzs929Rzz5F06F; Mon, 18 Mar 2024 15:53:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Tyzs91F2Cz4bwJ; Mon, 18 Mar 2024 15:53:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1710777181; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yoKDcYdmIB11B96dhUf/gUfIow2ccrVGDAupBQF49Ko=; b=NbFpPPDJn2Xw8kcnUk+iIkShn06Nr0r93O/hXR0dFmudJQ17lDmk+2VKNv9pbdUwZsjtlP 4jn6ivPgFdj1yyFeO5SE/E4318ED/PtQ6GwLQAWcCmtxjHfCH6d2IVn5g5F78mrFapO72C 5f29yFZQ3zhHYp1ztwtYwZPXmJOgUU/VlBF/TzbvfGhdiddRGjSWphJ88DZy165IrEAb3N 0S9urQQqkO5zSv204uFqjGY/xLqjX1BFVMm0ijUOjg6OrJRC55Nv9THr9LsMTr3shTU1js I1Bwoa2SAfKtNZttgDLJRfC0X/1ONFecucrJV/FRlU6Rf+kLe/e183ZW0JTdew== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1710777181; a=rsa-sha256; cv=none; b=Gg7aZtwA4oKqTi+rLPvgvYZI2575Fg3eJuf1R/fEmqEh2jB1dulJWp/32TeRxZc2PGrcx6 ZUXN9fMC4u8U4nHPSjcqn6TN53fSOxKbDafdTz5ANSSaBZGYFtQWVR5uNjBx34eiWDkubC 8GWnv06fuH2sVSljZ0+ocIV7aliLX2NZK7ZwCQ1rElR3C9rgbwzPWg3QS06F3ZqwW1ypWQ LtKvy3fqM0lRynejQoeoxacq8uGsLFauVsc+umgRXHgkrbanJzMH/GBJvLv9uoFxCVne+P 7GKHzY2alAFMYmi7BGgTPt1hSWyOuKLjTZ1kUabeS3AoVQfgzoeJWN6yagHVFA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1710777181; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yoKDcYdmIB11B96dhUf/gUfIow2ccrVGDAupBQF49Ko=; b=tVcjqp9lfnG5ssHbHvZCPzi5kxBzu0idt60q+8NygWkeu5F2Wz55WlZ0C5/uD/8PVItVc3 8ZGmN68cZmYpp3ZHUDSI/L75PVtE0c5NJuJgGLOp1OUW48wMkihkCU6HiQfrJB++ek9rv7 0fsEddkgA3K1mQ6N/9zyHHkEr4VFMAh+dr6FdXAPWzrMqn9wO9u8/9spL6Eq9LVbSp5FPZ 6Wx663FeVP0D2WlSjR2D/h6kUV/c8tcLJQC1F4DLNL1plGpZoIROMh+qVv+ClQV7wNbOfR jK8LN7p0cVIOMit7SUv8TVkDUlTf38TA+Uu/uINGf0b+d1JIYy1bGM7innYTog== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Tyzs90Y2wzT97; Mon, 18 Mar 2024 15:53:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 42IFr0ok000983; Mon, 18 Mar 2024 15:53:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 42IFr0pZ000980; Mon, 18 Mar 2024 15:53:00 GMT (envelope-from git) Date: Mon, 18 Mar 2024 15:53:00 GMT Message-Id: <202403181553.42IFr0pZ000980@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: d62c4607e8a3 - main - sockets: remove unused KPIs to manipulate sockets List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d62c4607e8a3613253d613c0d3417cccd02b2c57 Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=d62c4607e8a3613253d613c0d3417cccd02b2c57 commit d62c4607e8a3613253d613c0d3417cccd02b2c57 Author: Gleb Smirnoff AuthorDate: 2024-03-18 15:50:30 +0000 Commit: Gleb Smirnoff CommitDate: 2024-03-18 15:50:30 +0000 sockets: remove unused KPIs to manipulate sockets These KPIs were added in dd0e6c383a9f0 and through 15 years had zero use. They slightly remind what IfAPI does for struct ifnet. But IfAPI does that for the sake of large collection of NIC drivers not being aware of struct ifnet. For the sockets it is unclear what could be a large collection of externally written kernel modules that need extensively use sockets and not be aware of their internals at the same time. This isolation of a structure knowledge requires a lot of work, and just throwing in a few KPIs isn't helpful. Reviewed by: kib, olce, markj Differential Revision: https://reviews.freebsd.org/D44311 --- sys/kern/uipc_socket.c | 101 --------------------------------------------- sys/netinet/in_pcb.c | 7 ---- sys/netinet/tcp_fastopen.h | 1 + sys/netinet/tcp_offload.h | 2 + sys/sys/socket.h | 23 ----------- 5 files changed, 3 insertions(+), 131 deletions(-) diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index 18ecf1409fd7..9a29df8b0340 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -4254,34 +4254,6 @@ sotoxsocket(struct socket *so, struct xsocket *xso) } } -struct sockbuf * -so_sockbuf_rcv(struct socket *so) -{ - - return (&so->so_rcv); -} - -struct sockbuf * -so_sockbuf_snd(struct socket *so) -{ - - return (&so->so_snd); -} - -int -so_state_get(const struct socket *so) -{ - - return (so->so_state); -} - -void -so_state_set(struct socket *so, int val) -{ - - so->so_state = val; -} - int so_options_get(const struct socket *so) { @@ -4309,76 +4281,3 @@ so_error_set(struct socket *so, int val) so->so_error = val; } - -int -so_linger_get(const struct socket *so) -{ - - return (so->so_linger); -} - -void -so_linger_set(struct socket *so, int val) -{ - - KASSERT(val >= 0 && val <= USHRT_MAX && val <= (INT_MAX / hz), - ("%s: val %d out of range", __func__, val)); - - so->so_linger = val; -} - -struct protosw * -so_protosw_get(const struct socket *so) -{ - - return (so->so_proto); -} - -void -so_protosw_set(struct socket *so, struct protosw *val) -{ - - so->so_proto = val; -} - -void -so_sorwakeup(struct socket *so) -{ - - sorwakeup(so); -} - -void -so_sowwakeup(struct socket *so) -{ - - sowwakeup(so); -} - -void -so_sorwakeup_locked(struct socket *so) -{ - - sorwakeup_locked(so); -} - -void -so_sowwakeup_locked(struct socket *so) -{ - - sowwakeup_locked(so); -} - -void -so_lock(struct socket *so) -{ - - SOCK_LOCK(so); -} - -void -so_unlock(struct socket *so) -{ - - SOCK_UNLOCK(so); -} diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c index 16a3707e7c89..d966f8e386fe 100644 --- a/sys/netinet/in_pcb.c +++ b/sys/netinet/in_pcb.c @@ -2847,13 +2847,6 @@ inp_4tuple_get(struct inpcb *inp, uint32_t *laddr, uint16_t *lp, *fp = inp->inp_fport; } -struct inpcb * -so_sotoinpcb(struct socket *so) -{ - - return (sotoinpcb(so)); -} - /* * Create an external-format (``xinpcb'') structure using the information in * the kernel-format in_pcb structure pointed to by inp. This is done to diff --git a/sys/netinet/tcp_fastopen.h b/sys/netinet/tcp_fastopen.h index ee860941fdb8..f70de4bb8947 100644 --- a/sys/netinet/tcp_fastopen.h +++ b/sys/netinet/tcp_fastopen.h @@ -79,6 +79,7 @@ struct tcp_fastopen_ccache { uint32_t secret; }; +struct tcpcb; #ifdef TCP_RFC7413 void tcp_fastopen_init(void); void tcp_fastopen_destroy(void); diff --git a/sys/netinet/tcp_offload.h b/sys/netinet/tcp_offload.h index b397336ab487..c76408ccd07f 100644 --- a/sys/netinet/tcp_offload.h +++ b/sys/netinet/tcp_offload.h @@ -38,6 +38,8 @@ extern int registered_toedevs; +struct tcpcb; + int tcp_offload_connect(struct socket *, struct sockaddr *); void tcp_offload_listen_start(struct tcpcb *); void tcp_offload_listen_stop(struct tcpcb *); diff --git a/sys/sys/socket.h b/sys/sys/socket.h index 3e24db552618..91fafdec672a 100644 --- a/sys/sys/socket.h +++ b/sys/sys/socket.h @@ -713,33 +713,10 @@ __END_DECLS #ifdef _KERNEL struct socket; -struct inpcb *so_sotoinpcb(struct socket *so); -struct sockbuf *so_sockbuf_snd(struct socket *); -struct sockbuf *so_sockbuf_rcv(struct socket *); - -int so_state_get(const struct socket *); -void so_state_set(struct socket *, int); - int so_options_get(const struct socket *); void so_options_set(struct socket *, int); int so_error_get(const struct socket *); void so_error_set(struct socket *, int); - -int so_linger_get(const struct socket *); -void so_linger_set(struct socket *, int); - -struct protosw *so_protosw_get(const struct socket *); -void so_protosw_set(struct socket *, struct protosw *); - -void so_sorwakeup_locked(struct socket *so); -void so_sowwakeup_locked(struct socket *so); - -void so_sorwakeup(struct socket *so); -void so_sowwakeup(struct socket *so); - -void so_lock(struct socket *so); -void so_unlock(struct socket *so); - #endif /* _KERNEL */ #endif /* !_SYS_SOCKET_H_ */