Date: Thu, 16 Aug 2012 11:37:31 +0300 From: Konstantin Belousov <kostikbel@gmail.com> To: Oleksandr Tymoshenko <gonzo@freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r239318 - head/sys/nfs Message-ID: <20120816083731.GP5883@deviant.kiev.zoral.com.ua> In-Reply-To: <201208160051.q7G0poqM036086@svn.freebsd.org> References: <201208160051.q7G0poqM036086@svn.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
--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--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120816083731.GP5883>