From owner-freebsd-net@FreeBSD.ORG Mon Jan 16 19:46:56 2012 Return-Path: Delivered-To: freebsd-net@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 43F5D1065676 for ; Mon, 16 Jan 2012 19:46:56 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from mail.allbsd.org (gatekeeper-int.allbsd.org [IPv6:2001:2f0:104:e002::2]) by mx1.freebsd.org (Postfix) with ESMTP id B01E98FC0C for ; Mon, 16 Jan 2012 19:46:55 +0000 (UTC) Received: from alph.allbsd.org ([IPv6:2001:2f0:104:e010:862b:2bff:febc:8956]) (authenticated bits=128) by mail.allbsd.org (8.14.4/8.14.4) with ESMTP id q0GJkeZf084901; Tue, 17 Jan 2012 04:46:50 +0900 (JST) (envelope-from hrs@FreeBSD.org) Received: from localhost (localhost [IPv6:::1]) (authenticated bits=0) by alph.allbsd.org (8.14.4/8.14.4) with ESMTP id q0GJkblW086025; Tue, 17 Jan 2012 04:46:40 +0900 (JST) (envelope-from hrs@FreeBSD.org) Date: Tue, 17 Jan 2012 04:45:33 +0900 (JST) Message-Id: <20120117.044533.1784742896398431105.hrs@allbsd.org> To: dk@neveragain.de From: Hiroki Sato In-Reply-To: <20120110102405.GA82356@neveragain.de> References: <20120110102405.GA82356@neveragain.de> X-PGPkey-fingerprint: BDB3 443F A5DD B3D0 A530 FFD7 4F2C D3D8 2793 CF2D X-Mailer: Mew version 6.3.51 on Emacs 23.3 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Multipart/Signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="--Security_Multipart0(Tue_Jan_17_04_45_33_2012_849)--" Content-Transfer-Encoding: 7bit X-Virus-Scanned: clamav-milter 0.97 at gatekeeper.allbsd.org X-Virus-Status: Clean X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.3 (mail.allbsd.org [IPv6:2001:2f0:104:e001::32]); Tue, 17 Jan 2012 04:46:53 +0900 (JST) X-Spam-Status: No, score=-104.4 required=13.0 tests=BAYES_00, CONTENT_TYPE_PRESENT, QENCPTR2, RDNS_NONE, SPF_SOFTFAIL, USER_IN_WHITELIST autolearn=no version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on gatekeeper.allbsd.org Cc: freebsd-net@FreeBSD.org Subject: Re: Unnecessary sleep in network.subr: ipv6_up() X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jan 2012 19:46:56 -0000 ----Security_Multipart0(Tue_Jan_17_04_45_33_2012_849)-- Content-Type: Multipart/Mixed; boundary="--Next_Part(Tue_Jan_17_04_45_33_2012_075)--" Content-Transfer-Encoding: 7bit ----Next_Part(Tue_Jan_17_04_45_33_2012_075)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Dennis Koegel wrote in <20120110102405.GA82356@neveragain.de>: dk> Cheers, dk> dk> problem: Having a *lot* of IPv6 interfaces (Vlan interfaces in this case) dk> causes a huge and annoying delay time at system boot in 9.0R. dk> dk> ipv6_up() in network.subr does this: dk> dk> + # wait for DAD dk> + sleep `${SYSCTL_N} net.inet6.ip6.dad_count` dk> + sleep 1 dk> dk> This happens for each and every interface, at a minimum (and default) of dk> two seconds per interface. dk> dk> It seems the behaviour was introduced with r197139. Before this merge, dk> /etc/rc.d/network_ipv6 did the same sleeps, but only once for the whole dk> network startup. dk> dk> I don't see why this should happen per interface, so I suggest the extra dk> sleeps are limited to "once per network startup" once again (or maybe dk> removed?). Can you try the attached patch and let me know if it works fine on your system? -- Hiroki ----Next_Part(Tue_Jan_17_04_45_33_2012_075)-- Content-Type: Text/X-Patch; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="etc_dadwait.20120117-1.diff" Index: etc/network.subr =================================================================== --- etc/network.subr (revision 230227) +++ etc/network.subr (working copy) @@ -559,10 +559,6 @@ ipv6_prefix_hostid_addr_common ${_if} alias && _ret=0 ipv6_accept_rtadv_up ${_if} && _ret=0 - # wait for DAD - sleep `${SYSCTL_N} net.inet6.ip6.dad_count` - sleep 1 - return $_ret } Index: etc/rc.d/netif =================================================================== --- etc/rc.d/netif (revision 230227) +++ etc/rc.d/netif (working copy) @@ -123,16 +123,26 @@ _cooked_list="`list_net_interfaces`" fi + _dadwait= _fail= _ok= for ifn in ${_cooked_list}; do if ${_func} ${ifn} $2; then _ok="${_ok} ${ifn}" + if ipv6if ${ifn}; then + _dadwait=1 + fi else _fail="${_fail} ${ifn}" fi done + # inet6 address configuration needs sleep for DAD. + if [ -n "${_dadwait}" ]; then + sleep `${SYSCTL_N} net.inet6.ip6.dad_count` + sleep 1 + fi + _str= if [ -n "${_ok}" ]; then case ${_func} in ----Next_Part(Tue_Jan_17_04_45_33_2012_075)---- ----Security_Multipart0(Tue_Jan_17_04_45_33_2012_849)-- Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEABECAAYFAk8Ufl0ACgkQTyzT2CeTzy3sNQCfXds1WoPW+0VaVmVZZvGnOVtG PesAn0sjZ077ENZgwnbfKIhYrqjATcUC =yLXv -----END PGP SIGNATURE----- ----Security_Multipart0(Tue_Jan_17_04_45_33_2012_849)----