From owner-svn-src-head@freebsd.org Wed Feb 24 01:25:15 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8BE90AB2BFF; Wed, 24 Feb 2016 01:25:15 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6C519762; Wed, 24 Feb 2016 01:25:15 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 878F3B94A; Tue, 23 Feb 2016 20:25:13 -0500 (EST) From: John Baldwin To: Randall Stewart Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r295927 - in head/sys/netinet: . tcp_stacks Date: Tue, 23 Feb 2016 17:25:09 -0800 Message-ID: <7907269.jj0Ooylupy@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <201602231753.u1NHrdhU078634@repo.freebsd.org> References: <201602231753.u1NHrdhU078634@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 23 Feb 2016 20:25:13 -0500 (EST) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Feb 2016 01:25:15 -0000 On Tuesday, February 23, 2016 05:53:39 PM Randall Stewart wrote: > Author: rrs > Date: Tue Feb 23 17:53:39 2016 > New Revision: 295927 > URL: https://svnweb.freebsd.org/changeset/base/295927 > > Log: > This fixes the fastpath code to have a better module initialization sequence when > included in loader.conf. It also fixes it so that no matter if some one incorrectly > specifies a load order, the lists and such will be initialized on demand at that > time so no one can make that mistake. > > Reviewed by: hiren > Differential Revision: D5189 > > Modified: > head/sys/netinet/tcp_stacks/fastpath.c > head/sys/netinet/tcp_subr.c > > Modified: head/sys/netinet/tcp_stacks/fastpath.c > ============================================================================== > --- head/sys/netinet/tcp_stacks/fastpath.c Tue Feb 23 16:01:34 2016 (r295926) > +++ head/sys/netinet/tcp_stacks/fastpath.c Tue Feb 23 17:53:39 2016 (r295927) > @@ -2453,4 +2453,4 @@ static moduledata_t new_tcp_fastpaths = > }; > > MODULE_VERSION(kern_tcpfastpaths, 1); > -DECLARE_MODULE(kern_tcpfastpaths, new_tcp_fastpaths, SI_SUB_PSEUDO, SI_ORDER_ANY); > +DECLARE_MODULE(kern_tcpfastpaths, new_tcp_fastpaths, SI_SUB_PROTO_DOMAIN, SI_ORDER_ANY); > > Modified: head/sys/netinet/tcp_subr.c > ============================================================================== > --- head/sys/netinet/tcp_subr.c Tue Feb 23 16:01:34 2016 (r295926) > +++ head/sys/netinet/tcp_subr.c Tue Feb 23 17:53:39 2016 (r295927) > @@ -263,9 +263,20 @@ static struct tcp_function_block tcp_def > 0 > }; > > +int t_functions_inited = 0; > struct tcp_funchead t_functions; > static struct tcp_function_block *tcp_func_set_ptr = &tcp_def_funcblk; > > +static void > +init_tcp_functions() > +{ > + if (t_functions_inited == 0) { > + TAILQ_INIT(&t_functions); > + rw_init_flags(&tcp_function_lock, "tcp_func_lock" , 0); > + t_functions_inited = 1; > + } You could use TAILQ_INITIALIZER and RW_SYSINIT instead of this helper function to provide more deteriministic initialization. -- John Baldwin