From nobody Thu Dec 02 18:49:05 2021 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 F280B18A9589; Thu, 2 Dec 2021 18:49:06 +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 4J4lNf0C22z3rBx; Thu, 2 Dec 2021 18:49:06 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 CFE3F224B2; Thu, 2 Dec 2021 18:49:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1B2In52o068901; Thu, 2 Dec 2021 18:49:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1B2In5nj068900; Thu, 2 Dec 2021 18:49:05 GMT (envelope-from git) Date: Thu, 2 Dec 2021 18:49:05 GMT Message-Id: <202112021849.1B2In5nj068900@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: 565655f4e33e - main - inpcb: reduce some aliased functions after removal of PCBGROUP. 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: 565655f4e33e6e04c53c1c566b50fc07fd685f2f Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638470946; 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=d1itidWcuZNjqMtG91hDeRhpE+WIbZCguwoEM2MM5fY=; b=mr86Kq+Xt5/kpYs564z95Q3duyYTKCKjYhvEPBmP0PoZYxxxFXwZI8PBpUbcLWHsYX6qaD nM5iRcl8P1JehqgumWgBH6FvRXSdq0UnAp+XQEyvGgn4coJR3yLeMmoiD5GsYdV0bmClQs eoaF8LI+VQ8DrxiXP1wNVxc27RP8FUrL3jqi8J4upXyAJyQPEESEO1IJsVzUms5Gru30Lj 0xo8D2cAyO2WaMDTFbQQcSbef5x0xfV4P6yVxW6M2VN9QIQEcdrElkwg22FE4ReS4gPTqH yxnZ4ylr4Ro95FIbUXivj+MBunwFKMO8lyl1JQ0NpmnjCS25SwNDLp/8iJJmDQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638470946; a=rsa-sha256; cv=none; b=J1v6EyG9FkwKKXvTijQi5BFWjF1VitUPkGpBLPvAH9XxK4ZwDxGdPIEFxkQsSYZj9nMpgq OzJcqlgcHkowNfOtz0O5TO7cRBljAhqei6gVEDwnF/rX8iA21t7DaKvmJpwD22auhOb7tG CRw/2b47G/Xj3cskAnyy8O+cemp+DCG+GoB5NZRZEEYEKx8jaCLeNLYOegmt2USS0Zy//x JvNyfi5FVeJYpvHLn4nRxT2GblB8sJUg3Ku2EjneVsYw9XtSKQV2wUjM/jvDxlc0MqQ5gB yvi7kSPPJ/oDuRM9pZnuAnbvXaz6OW8SfMxMogNlEuIzk4KnjWUOrsPbgBCTrQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=565655f4e33e6e04c53c1c566b50fc07fd685f2f commit 565655f4e33e6e04c53c1c566b50fc07fd685f2f Author: Gleb Smirnoff AuthorDate: 2021-12-02 18:48:48 +0000 Commit: Gleb Smirnoff CommitDate: 2021-12-02 18:48:48 +0000 inpcb: reduce some aliased functions after removal of PCBGROUP. Reviewed by: rrs Differential revision: https://reviews.freebsd.org/D33021 --- sys/netinet/in_pcb.c | 42 +++++++----------------------------------- sys/netinet/in_pcb.h | 6 +----- sys/netinet/tcp_syncache.c | 4 ++-- sys/netinet/udp_usrreq.c | 2 +- sys/netinet6/in6_pcb.c | 4 ++-- sys/netinet6/udp6_usrreq.c | 2 +- 6 files changed, 14 insertions(+), 46 deletions(-) diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c index f1ac46b28477..ecca470805d2 100644 --- a/sys/netinet/in_pcb.c +++ b/sys/netinet/in_pcb.c @@ -1072,8 +1072,8 @@ in_pcbbind_setup(struct inpcb *inp, struct sockaddr *nam, in_addr_t *laddrp, * then pick one. */ int -in_pcbconnect_mbuf(struct inpcb *inp, struct sockaddr *nam, - struct ucred *cred, struct mbuf *m, bool rehash) +in_pcbconnect(struct inpcb *inp, struct sockaddr *nam, struct ucred *cred, + bool rehash) { u_short lport, fport; in_addr_t laddr, faddr; @@ -1109,9 +1109,9 @@ in_pcbconnect_mbuf(struct inpcb *inp, struct sockaddr *nam, inp->inp_faddr.s_addr = faddr; inp->inp_fport = fport; if (rehash) { - in_pcbrehash_mbuf(inp, m); + in_pcbrehash(inp); } else { - in_pcbinshash_mbuf(inp, m); + in_pcbinshash(inp); } if (anonport) @@ -1119,13 +1119,6 @@ in_pcbconnect_mbuf(struct inpcb *inp, struct sockaddr *nam, return (0); } -int -in_pcbconnect(struct inpcb *inp, struct sockaddr *nam, struct ucred *cred) -{ - - return (in_pcbconnect_mbuf(inp, nam, cred, NULL, true)); -} - /* * Do proper source address selection on an unbound socket in case * of connect. Take jails into account as well. @@ -2285,8 +2278,8 @@ in_pcblookup_mbuf(struct inpcbinfo *pcbinfo, struct in_addr faddr, /* * Insert PCB onto various hash lists. */ -static int -in_pcbinshash_internal(struct inpcb *inp, struct mbuf *m) +int +in_pcbinshash(struct inpcb *inp) { struct inpcbhead *pcbhash; struct inpcbporthead *pcbporthash; @@ -2355,20 +2348,6 @@ in_pcbinshash_internal(struct inpcb *inp, struct mbuf *m) return (0); } -int -in_pcbinshash(struct inpcb *inp) -{ - - return (in_pcbinshash_internal(inp, NULL)); -} - -int -in_pcbinshash_mbuf(struct inpcb *inp, struct mbuf *m) -{ - - return (in_pcbinshash_internal(inp, m)); -} - /* * Move PCB to the proper hash bucket when { faddr, fport } have been * changed. NOTE: This does not handle the case of the lport changing (the @@ -2376,7 +2355,7 @@ in_pcbinshash_mbuf(struct inpcb *inp, struct mbuf *m) * not change after in_pcbinshash() has been called. */ void -in_pcbrehash_mbuf(struct inpcb *inp, struct mbuf *m) +in_pcbrehash(struct inpcb *inp) { struct inpcbinfo *pcbinfo = inp->inp_pcbinfo; struct inpcbhead *head; @@ -2402,13 +2381,6 @@ in_pcbrehash_mbuf(struct inpcb *inp, struct mbuf *m) CK_LIST_INSERT_HEAD(head, inp, inp_hash); } -void -in_pcbrehash(struct inpcb *inp) -{ - - in_pcbrehash_mbuf(inp, NULL); -} - /* * Remove PCB from various lists. */ diff --git a/sys/netinet/in_pcb.h b/sys/netinet/in_pcb.h index 813c87559de3..47ecbd4f121b 100644 --- a/sys/netinet/in_pcb.h +++ b/sys/netinet/in_pcb.h @@ -766,9 +766,7 @@ int in_pcballoc(struct socket *, struct inpcbinfo *); int in_pcbbind(struct inpcb *, struct sockaddr *, struct ucred *); int in_pcbbind_setup(struct inpcb *, struct sockaddr *, in_addr_t *, u_short *, struct ucred *); -int in_pcbconnect(struct inpcb *, struct sockaddr *, struct ucred *); -int in_pcbconnect_mbuf(struct inpcb *, struct sockaddr *, struct ucred *, - struct mbuf *, bool); +int in_pcbconnect(struct inpcb *, struct sockaddr *, struct ucred *, bool); int in_pcbconnect_setup(struct inpcb *, struct sockaddr *, in_addr_t *, u_short *, in_addr_t *, u_short *, struct inpcb **, struct ucred *); @@ -777,7 +775,6 @@ void in_pcbdisconnect(struct inpcb *); void in_pcbdrop(struct inpcb *); void in_pcbfree(struct inpcb *); int in_pcbinshash(struct inpcb *); -int in_pcbinshash_mbuf(struct inpcb *, struct mbuf *); int in_pcbladdr(struct inpcb *, struct in_addr *, struct in_addr *, struct ucred *); int in_pcblbgroup_numa(struct inpcb *, int arg); @@ -791,7 +788,6 @@ void in_pcbnotifyall(struct inpcbinfo *pcbinfo, struct in_addr, int, struct inpcb *(*)(struct inpcb *, int)); void in_pcbref(struct inpcb *); void in_pcbrehash(struct inpcb *); -void in_pcbrehash_mbuf(struct inpcb *, struct mbuf *); int in_pcbrele_rlocked(struct inpcb *); int in_pcbrele_wlocked(struct inpcb *); void in_losing(struct inpcb *); diff --git a/sys/netinet/tcp_syncache.c b/sys/netinet/tcp_syncache.c index 39ec65df7426..7dd8443cad65 100644 --- a/sys/netinet/tcp_syncache.c +++ b/sys/netinet/tcp_syncache.c @@ -943,8 +943,8 @@ syncache_socket(struct syncache *sc, struct socket *lso, struct mbuf *m) laddr = inp->inp_laddr; if (inp->inp_laddr.s_addr == INADDR_ANY) inp->inp_laddr = sc->sc_inc.inc_laddr; - if ((error = in_pcbconnect_mbuf(inp, (struct sockaddr *)&sin, - thread0.td_ucred, m, false)) != 0) { + if ((error = in_pcbconnect(inp, (struct sockaddr *)&sin, + thread0.td_ucred, false)) != 0) { inp->inp_laddr = laddr; if ((s = tcp_log_addrs(&sc->sc_inc, NULL, NULL, NULL))) { log(LOG_DEBUG, "%s; %s: in_pcbconnect failed " diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c index a9d534fbc8c0..efd5c77ca8c5 100644 --- a/sys/netinet/udp_usrreq.c +++ b/sys/netinet/udp_usrreq.c @@ -1697,7 +1697,7 @@ udp_connect(struct socket *so, struct sockaddr *nam, struct thread *td) } NET_EPOCH_ENTER(et); INP_HASH_WLOCK(pcbinfo); - error = in_pcbconnect(inp, nam, td->td_ucred); + error = in_pcbconnect(inp, nam, td->td_ucred, true); INP_HASH_WUNLOCK(pcbinfo); NET_EPOCH_EXIT(et); if (error == 0) diff --git a/sys/netinet6/in6_pcb.c b/sys/netinet6/in6_pcb.c index 6f3cd120d1c8..629593bb365c 100644 --- a/sys/netinet6/in6_pcb.c +++ b/sys/netinet6/in6_pcb.c @@ -516,9 +516,9 @@ in6_pcbconnect_mbuf(struct inpcb *inp, struct sockaddr *nam, (htonl(ip6_randomflowlabel()) & IPV6_FLOWLABEL_MASK); if (rehash) { - in_pcbrehash_mbuf(inp, m); + in_pcbrehash(inp); } else { - in_pcbinshash_mbuf(inp, m); + in_pcbinshash(inp); } return (0); diff --git a/sys/netinet6/udp6_usrreq.c b/sys/netinet6/udp6_usrreq.c index 5939b631a1ab..5ce3a1fd1a78 100644 --- a/sys/netinet6/udp6_usrreq.c +++ b/sys/netinet6/udp6_usrreq.c @@ -1215,7 +1215,7 @@ udp6_connect(struct socket *so, struct sockaddr *nam, struct thread *td) NET_EPOCH_ENTER(et); INP_HASH_WLOCK(pcbinfo); error = in_pcbconnect(inp, (struct sockaddr *)&sin, - td->td_ucred); + td->td_ucred, true); INP_HASH_WUNLOCK(pcbinfo); NET_EPOCH_EXIT(et); /*