From nobody Wed Aug 17 16:19:29 2022 X-Original-To: dev-commits-src-main@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 4M7Crz3Vrgz4Zq0F; Wed, 17 Aug 2022 16:19:31 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (glebi.us [162.251.186.162]) (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 (2048 bits) client-digest SHA256) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4M7Cry5BvRz3lMp; Wed, 17 Aug 2022 16:19:30 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.16.1/8.16.1) with ESMTPS id 27HGJTp0031551 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Wed, 17 Aug 2022 09:19:29 -0700 (PDT) (envelope-from glebius@freebsd.org) Received: (from glebius@localhost) by cell.glebi.us (8.16.1/8.16.1/Submit) id 27HGJTIn031550; Wed, 17 Aug 2022 09:19:29 -0700 (PDT) (envelope-from glebius@freebsd.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@freebsd.org using -f Date: Wed, 17 Aug 2022 09:19:29 -0700 From: Gleb Smirnoff To: John Baldwin Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: c93db4abf454 - main - udp: call UDP methods from UDP over IPv6 directly Message-ID: References: <202208161940.27GJercD039480@gitrepo.freebsd.org> <62dca1e0-8d66-6291-149e-5785af0e2658@FreeBSD.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <62dca1e0-8d66-6291-149e-5785af0e2658@FreeBSD.org> X-Rspamd-Queue-Id: 4M7Cry5BvRz3lMp X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=softfail (mx1.freebsd.org: 162.251.186.162 is neither permitted nor denied by domain of glebius@freebsd.org) smtp.mailfrom=glebius@freebsd.org X-Spamd-Result: default: False [-3.10 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-0.999]; MIME_GOOD(-0.10)[text/plain]; MLMMJ_DEST(0.00)[dev-commits-src-all@freebsd.org,dev-commits-src-main@freebsd.org]; RCVD_COUNT_THREE(0.00)[3]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; R_DKIM_NA(0.00)[]; ASN(0.00)[asn:27348, ipnet:162.251.186.0/24, country:US]; ARC_NA(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[freebsd.org]; RCPT_COUNT_THREE(0.00)[4]; FREEFALL_USER(0.00)[glebius]; RCVD_TLS_LAST(0.00)[]; TO_DN_SOME(0.00)[]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; HAS_XAW(0.00)[]; MID_RHS_MATCH_FROM(0.00)[] X-ThisMailContainsUnwantedMimeParts: N John, On Wed, Aug 17, 2022 at 09:04:08AM -0700, John Baldwin wrote: J> > diff --git a/sys/netinet6/udp6_usrreq.c b/sys/netinet6/udp6_usrreq.c J> > index a7bdfce97707..6a3ac2abd90b 100644 J> > --- a/sys/netinet6/udp6_usrreq.c J> > +++ b/sys/netinet6/udp6_usrreq.c J> > @@ -131,12 +131,18 @@ VNET_DEFINE(int, zero_checksum_port) = 0; J> > SYSCTL_INT(_net_inet6_udp6, OID_AUTO, rfc6935_port, CTLFLAG_VNET | CTLFLAG_RW, J> > &VNET_NAME(zero_checksum_port), 0, J> > "Zero UDP checksum allowed for traffic to/from this port."); J> > + J> > + J> > +/* netinet/udp_usrreqs.c */ J> > +pr_abort_t udp_abort; J> > +pr_disconnect_t udp_disconnect; J> > +pr_send_t udp_send; J> > + J> J> Oof, can you please put these in a header instead? would seem to be J> a good candidate. I actually don't want to share these functions to anybody. Sometimes we are in a situation when two compilation units are historically separated, while they need to call into each other functions, which by design are private. With declaration in the caller unit I emphasize that nobody except udp6_usrreq.c may call functions from udp_usrreq.c. I find this self-documenting and better than exposing it in udp_var.h or anywhere else. We got many examples of this problem in the network stack. A good example is tcp_init() calling into various sub-inits, all of which are never ever supposed to be called by anybody else. They should have been just static, but historically are separated into separate files. -- Gleb Smirnoff