From owner-svn-src-all@FreeBSD.ORG Thu Aug 16 08:37:36 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DDC92106564A; Thu, 16 Aug 2012 08:37:35 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 741BE8FC0A; Thu, 16 Aug 2012 08:37:34 +0000 (UTC) Received: from skuns.kiev.zoral.com.ua (localhost [127.0.0.1]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id q7G8bhf2080026; Thu, 16 Aug 2012 11:37:43 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5) with ESMTP id q7G8bVvP030817; Thu, 16 Aug 2012 11:37:31 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5/Submit) id q7G8bVKu030816; Thu, 16 Aug 2012 11:37:31 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 16 Aug 2012 11:37:31 +0300 From: Konstantin Belousov To: Oleksandr Tymoshenko Message-ID: <20120816083731.GP5883@deviant.kiev.zoral.com.ua> References: <201208160051.q7G0poqM036086@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="iq/fWD14IMVFWBCD" Content-Disposition: inline In-Reply-To: <201208160051.q7G0poqM036086@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.0 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r239318 - head/sys/nfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Aug 2012 08:37:36 -0000 --iq/fWD14IMVFWBCD Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Aug 16, 2012 at 12:51:50AM +0000, Oleksandr Tymoshenko wrote: > Author: gonzo > Date: Thu Aug 16 00:51:50 2012 > New Revision: 239318 > URL: http://svn.freebsd.org/changeset/base/239318 >=20 > Log: > Merge somewhat modified r230399 from projects/armv6: > =20 > Add timeout to wait for network controllers to appear when netbooting. > =20 > USB ethernet adapter initialization usually is delayed and > they're not available immidiately after autoconfiguration. So we need > to wait a bit before giving up > =20 > Reviewed by: stas@ >=20 > Modified: > head/sys/nfs/bootp_subr.c >=20 > Modified: head/sys/nfs/bootp_subr.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/nfs/bootp_subr.c Wed Aug 15 22:51:01 2012 (r239317) > +++ head/sys/nfs/bootp_subr.c Thu Aug 16 00:51:50 2012 (r239318) > @@ -82,6 +82,14 @@ __FBSDID("$FreeBSD$"); > #define BOOTP_SETTLE_DELAY 3 > #endif > =20 > +/*=20 > + * Wait 10 seconds for interface appearance > + * USB ethernet adapters might reqquire some time to pop up s/qq/q/ > + */ > +#ifndef BOOTP_IFACE_WAIT_TIMEOUT > +#define BOOTP_IFACE_WAIT_TIMEOUT 10 > +#endif > + > /* > * What is the longest we will wait before re-sending a request? > * Note this is also the frequency of "RPC timeout" messages. > @@ -1515,6 +1523,8 @@ bootpc_init(void) > #endif > struct nfsv3_diskless *nd; > struct thread *td; > + int timeout =3D BOOTP_IFACE_WAIT_TIMEOUT * hz; > + int delay =3D hz / 10; According to style(9), initialization and declaration shall be separated. > =20 > nd =3D &nfsv3_diskless; > td =3D curthread; > @@ -1567,6 +1577,7 @@ bootpc_init(void) > allocifctx(gctx); > #endif > =20 > +retry: > ifctx =3D STAILQ_FIRST(&gctx->interfaces); > IFNET_RLOCK(); > TAILQ_FOREACH(ifp, &V_ifnet, if_link) { > @@ -1613,6 +1624,11 @@ bootpc_init(void) > =20 > if (STAILQ_EMPTY(&gctx->interfaces) || > STAILQ_FIRST(&gctx->interfaces)->ifp =3D=3D NULL) { > + if (timeout > 0) { > + pause("bootpc", delay); > + timeout -=3D delay; > + goto retry; > + } > #ifdef BOOTP_WIRED_TO > panic("%s: Could not find interface specified " > "by BOOTP_WIRED_TO: " --iq/fWD14IMVFWBCD Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (FreeBSD) iEYEARECAAYFAlAssUsACgkQC3+MBN1Mb4h3pQCgjZ3Yj2OTGDDWNEvG2IzPVhvR xBcAoI/fJ/8UozSUeLsvpu34rGEDaLl6 =0zfw -----END PGP SIGNATURE----- --iq/fWD14IMVFWBCD--