Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 29 Oct 2020 11:18:45 -0700
From:      Cy Schubert <Cy.Schubert@cschubert.com>
To:        Konstantin Belousov <kostikbel@gmail.com>
Cc:        Cy Schubert <cy@freebsd.org>, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   Re: svn commit: r367049 - stable/12/libexec/rc/rc.d
Message-ID:  <202010291818.09TIIjlV049416@slippy.cwsent.com>
In-Reply-To: <20201029161751.GA2654@kib.kiev.ua>
References:  <202010260118.09Q1IGo7016376@repo.freebsd.org>  <20201029161751.GA2654@kib.kiev.ua>

next in thread | previous in thread | raw e-mail | index | archive | help
In message <20201029161751.GA2654@kib.kiev.ua>, Konstantin Belousov writes:
> On Mon, Oct 26, 2020 at 01:18:16AM +0000, Cy Schubert wrote:
> > Author: cy
> > Date: Mon Oct 26 01:18:15 2020
> > New Revision: 367049
> > URL: https://svnweb.freebsd.org/changeset/base/367049
> > 
> > Log:
> >   MFC r366857:
> >   Destroy cloned interfaces at netif stop, netif restart and shutdown.
> >   This is especially important during shutdown because a child interface
> >   of lagg with WOL enabled will not enable WOL at interface shutdown and
> >   thus no WOL to wake up the device (and machine).
> >   
> >   PR:		158734, 109980
> >   Reported by:	Antonio Huete Jimenez <tuxillo at quantumachine.net>
> >   		Marat N.Afanasyev <marat at zealot.ksu.ru>
> >   reviewed by:	kp
> > 
> > Modified:
> >   stable/12/libexec/rc/rc.d/netif
> > Directory Properties:
> >   stable/12/   (props changed)
> > 
> > Modified: stable/12/libexec/rc/rc.d/netif
> > ===========================================================================
> ===
> > --- stable/12/libexec/rc/rc.d/netif	Mon Oct 26 00:37:31 2020	(r36704
> 8)
> > +++ stable/12/libexec/rc/rc.d/netif	Mon Oct 26 01:18:15 2020	(r36704
> 9)
> > @@ -28,7 +28,7 @@
> >  # PROVIDE: netif
> >  # REQUIRE: FILESYSTEMS iovctl serial sppp sysctl
> >  # REQUIRE: hostid ipfs
> > -# KEYWORD: nojailvnet
> > +# KEYWORD: nojailvnet shutdown
> >  
> >  . /etc/rc.subr
> >  . /etc/network.subr
> After this change, shutdown of my stable/12 router looks like this:
>
> Stopping devd.
> Waiting for PIDS: 1120.
> Oct 29 18:09:52 tom minissdpd[1619]: setsockopt(udp, IP_DROP_MEMBERSHIP)(vlan
> 1): Can't assign requested address
> /etc/rc.shutdown: WARNING: vlan1 does not exist.  Skipped.
> /etc/rc.shutdown: WARNING: vlan2 does not exist.  Skipped.
> /etc/rc.shutdown: WARNING: vlan3 does not exist.  Skipped.
> /etc/rc.shutdown: WARNING: vlan4 does not exist.  Skipped.
> /etc/rc.shutdown: WARNING: vlan5 does not exist.  Skipped.
> Stopping Network: lo0 re0 re1 pflog0 gif0.
> lo0: flags=8048<LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
>         options=680003<RXCSUM,TXCSUM,LINKSTATE,RXCSUM_IPV6,TXCSUM_IPV6>
>         groups: lo
>         nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
> re0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
>         options=201b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,WOL_MAGIC>
>         ether e0:d5:5e:50:93:04
>         media: Ethernet autoselect (1000baseT <full-duplex>)
>         status: active
>         nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
> re1: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
>         options=201b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,WOL_MAGIC>
>         ether e0:d5:5e:50:93:05
>         media: Ethernet autoselect (100baseTX <full-duplex>)
>         status: active
>         nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
> pflog0: flags=100<PROMISC> metric 0 mtu 33160
>         groups: pflog
> gif0: flags=8010<POINTOPOINT,MULTICAST> metric 0 mtu 1280
>         options=80000<LINKSTATE>
>         tunnel inet 176.36.249.139 --> 216.66.84.46
>         groups: gif
>         nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
> Destroyed clone interfaces: gif0.
> Writing entropy file: .
> .
> Terminated
> Oct 29 18:09:53 tom syslogd: exiting on signal 15
> pflog0: promiscuous mode disabled
> Waiting (max 60 seconds) for system process `vnlru' to stop... done
> Waiting (max 60 seconds) for system process `syncer' to stop...
> Syncing disks, vnodes remaining... 14 2 2 1 1 1 0 0 0 0 done
>

The messages are innocuous. We could disable printing of the messages 
during shutdown though.

The patch resolves an issue where one or both interfaces with WOL enabled 
are members of a lagg(4) and since the lagg(4) is not torn down during 
shutdown WOL isn't enabled in the NIC prior to power off. This results in 
no WOL when interfaces are members of a lagg(4). Without the patch my 
machines with lagg(4) fail to wake on lan after being powered off.

Another alternative would be to tear down cloned interfaces in the kernel 
prior to calling device_shutdown or device_suspend for each physical 
interface, both of which enable WOL in drivers that support this feature.


-- 
Cheers,
Cy Schubert <Cy.Schubert@cschubert.com>
FreeBSD UNIX:  <cy@FreeBSD.org>   Web:  https://FreeBSD.org
NTP:           <cy@nwtime.org>    Web:  https://nwtime.org

	The need of the many outweighs the greed of the few.





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202010291818.09TIIjlV049416>