Re: Annoyance with recent parallelism in rc.d

From: Alexey Shuvaev <shuvaev_at_physik.uni-wuerzburg.de>
Date: Tue, 17 Feb 2009 23:05:57 +0100
On Tue, Feb 17, 2009 at 10:13:58AM +0900, Pyun YongHyeon wrote:
> Would you try attached patch? I don't like the patch but it may
> reduce number of link state change message generated by dhclient.
> 
Seems to be so. Not sure it solves the problem entirely:

[snip]
/dev/ad6p8: FILE SYSTEM CLEAN; SKIPPING CHECKS
/dev/ad6p8: clean, 5999509 free (41045 frags, 744808 blocks, 0.5% fragmentation)

msk0: link state changed to DOWN
Starting Network: lo0 msk0.
Removing stale Samba tdb files:  done
Feb 17 21:49:22  ntpd[1295]: getaddrinfo: "wrzx03.rz.uni-wuerzburg.de" invalid h
ost address, ignored
Feb 17 21:49:22  ntpd[1295]: getaddrinfo: "wep4001.physik.uni-wuerzburg.de" inva
lid host address, ignored
Configuring syscons: blanktime screensaver.
Configuring jails:.
Starting jails:.
moused: unable to open /dev/ums0: Device busy

Tue Feb 17 21:49:23 CET 2009

FreeBSD/amd64 (wep4035) (ttyv0)

login:

After all I have ntpd running & connected to upstream ntp server.
This is without synchronous_dhclient="YES" in rc.conf.
I have some feeling that the problem is not localized to msk driver only,
so... if you don't like the patch I'm ok to live with synchronous dhclient.

Alexey.

> Index: sys/dev/msk/if_msk.c
> ===================================================================
> --- sys/dev/msk/if_msk.c	(revision 188700)
> +++ sys/dev/msk/if_msk.c	(working copy)
> _at__at_ -943,8 +943,11 _at__at_
>  			else {
>  				MSK_IF_LOCK(sc_if);
>  				ifp->if_mtu = ifr->ifr_mtu;
> -				if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0)
> +				if ((ifp->if_drv_flags &
> +				    IFF_DRV_RUNNING) != 0) {
> +					ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
>  					msk_init_locked(sc_if);
> +				}
>  				MSK_IF_UNLOCK(sc_if);
>  			}
>  		}
> _at__at_ -2726,6 +2729,7 _at__at_
>  			if_printf(sc_if->msk_ifp, "watchdog timeout "
>  			   "(missed link)\n");
>  		ifp->if_oerrors++;
> +		ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
>  		msk_init_locked(sc_if);
>  		return;
>  	}
> _at__at_ -2750,6 +2754,7 _at__at_
>  
>  	if_printf(ifp, "watchdog timeout\n");
>  	ifp->if_oerrors++;
> +	ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
>  	msk_init_locked(sc_if);
>  	if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd))
>  		taskqueue_enqueue(taskqueue_fast, &sc_if->msk_tx_task);
> _at__at_ -2828,8 +2833,10 _at__at_
>  	mskc_reset(sc);
>  	for (i = 0; i < sc->msk_num_port; i++) {
>  		if (sc->msk_if[i] != NULL && sc->msk_if[i]->msk_ifp != NULL &&
> -		    ((sc->msk_if[i]->msk_ifp->if_flags & IFF_UP) != 0))
> +		    ((sc->msk_if[i]->msk_ifp->if_flags & IFF_UP) != 0)) {
> +			sc->msk_if[i]->msk_ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
>  			msk_init_locked(sc->msk_if[i]);
> +		}
>  	}
>  	sc->msk_suspended = 0;
>  
> _at__at_ -3515,6 +3522,9 _at__at_
>  	sc = sc_if->msk_softc;
>  	mii = device_get_softc(sc_if->msk_miibus);
>  
> +	if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0)
> +		return;
> +
>  	error = 0;
>  	/* Cancel pending I/O and free all Rx/Tx buffers. */
>  	msk_stop(sc_if);
Received on Tue Feb 17 2009 - 21:05:59 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:42 UTC