Wake-on-LAN not working on "igc" driver - NIC Intel I226-V

Hello everyone

I have a FreeBSD server that has "igc" interfaces, and in theory they are capable of using WOL. When using tcpdump -i <if> -x port 9 when the server is powered on I see the magic packets arrive. I've checked everything BIOS related to WOL, and when the machine is powered off, the network interface lights are still on. From my workstation I can send WOL packages to a Linux server and it wakes up. My workstation is a Linux Ubuntu and I used the command wakeonlan, however I also tried waking up the FreeBSD server from another FreeBSD machine using wake, and nothing.

I've checked everything I could find, but it doesnt seem to want to wake up. I've set ifconfig_igc0="inet 172.16.0.4 netmask 24 wol" on /etc/rc.conf, and I've also set the sysctl dev.igc.0.wake=1 and set it permanent on /etc/sysctl.conf.

The server is running 14.1-RELEASE, and uses a GENERIC kernel.

Here are the capabilities of the network interface, it does detail WOL_UCAST, WOL_MCAS and WOL_MAGIC:

Code:
$> ifconfig -m igc0
igc0: flags=1008843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST,LOWER_UP> metric 0 mtu 1500
        options=4e43fbb<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,JUMBO_MTU,VLAN_HWCSUM,TSO4,TSO6,LRO,WOL_UCAST,WOL_MCAST,WOL_MAGIC,VLAN_HWTSO,RXCSUM_IPV6,TXCSUM_IPV6,HWSTATS,MEXTPG>
        capabilities=4f43fbb<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,JUMBO_MTU,VLAN_HWCSUM,TSO4,TSO6,LRO,WOL_UCAST,WOL_MCAST,WOL_MAGIC,VLAN_HWTSO,NETMAP,RXCSUM_IPV6,TXCSUM_IPV6,HWSTATS,MEXTPG>
        ether 64:62:66:21:dd:b3
        inet 172.16.0.4 netmask 0xc0000000 broadcast 191.255.255.255
        media: Ethernet autoselect (1000baseT <full-duplex>)
        status: active
        supported media:
                media autoselect
                media 2500Base-T
                media 1000baseT
                media 1000baseT mediaopt full-duplex
                media 100baseTX mediaopt full-duplex
                media 100baseTX
                media 10baseT/UTP mediaopt full-duplex
                media 10baseT/UTP
        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>

Is there something I might be missing? I am happy to share any more information needed.

EDIT: For those interested in what hardware I am using, its a Minisforum NPB7 MiniPC which has two Intel I226-V Interfaces. Here is the output of the command pciconf -lv | grep -B 4 ethernet

Code:
igc0@pci0:86:0:0:       class=0x020000 rev=0x04 hdr=0x00 vendor=0x8086 device=0x125c subvendor=0x8086 subdevice=0x0000
    vendor     = 'Intel Corporation'
    device     = 'Ethernet Controller I226-V'
    class      = network
    subclass   = ethernet
igc1@pci0:87:0:0:       class=0x020000 rev=0x04 hdr=0x00 vendor=0x8086 device=0x125c subvendor=0x8086 subdevice=0x0000
    vendor     = 'Intel Corporation'
    device     = 'Ethernet Controller I226-V'
    class      = network
    subclass   = ethernet

 
Last edited:
The motherboard's BIOS also needs to support WOL.
And needs to be activated, too, of course.
Its not the network adapter which switches on your computer.
It only tells the motherboard to switch the power supply (fully) on
.

Sorry. Read too quick. Missed that point.
 
Wol is a very tricky thing. Try to boot your machine with a Ubuntu stick in "live mode" and be sure that you have activated wol on this interface from this OS. Then, shutdown and try a wol. If the machine wakes, it's probably a bug in the FreeBSD driver. If not, you missed something in the BIOS settings or elsewhere.
 
Try to boot your machine with a Ubuntu stick in "live mode" and be sure that you have activated wol on this interface from this OS. Then, shutdown and try a wol.
Well, this took an interesting turn.

Booted into Ubuntu (KDE Neon distro to be exact), then ran the command sudo ethtool -s <ifname> wol g which according to the ethtool manpage, turns on WOL Magic Packet, then powered off the machine using sudo poweroff.

Ran the same command as I always did from my workstation, meaning wakeonlan <mac-address> and the machine powered on! So its either I'm doing something wrong on FreeBSD, or there is a bug on the "igc" driver :(

I know almost nothing about FreeBSD development, but I am happy to assist in any way I can and test out patches.

Here are the settings that Ubuntu sees on the network interface

Code:
$> sudo ethtool enp87s0
Settings for enp87s0:
        Supported ports: [ TP ]
        Supported link modes:   10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Full
                                2500baseT/Full
        Supported pause frame use: Symmetric
        Supports auto-negotiation: Yes
        Supported FEC modes: Not reported
        Advertised link modes:  10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Full
                                2500baseT/Full
        Advertised pause frame use: Symmetric
        Advertised auto-negotiation: Yes
        Advertised FEC modes: Not reported
        Speed: 1000Mb/s
        Duplex: Full
        Auto-negotiation: on
        Port: Twisted Pair
        PHYAD: 0
        Transceiver: internal
        MDI-X: off (auto)
        Supports Wake-on: pumbg
        Wake-on: g
        Current message level: 0x00000007 (7)
                               drv probe link
        Link detected: yes

$> sudo ethtool -i enp87s0
driver: igc
version: 6.5.0-41-generic
firmware-version: 2017:888d
expansion-rom-version:  
bus-info: 0000:57:00.0
supports-statistics: yes
supports-test: yes
supports-eeprom-access: yes
supports-register-dump: yes
supports-priv-flags: yes
 
Make a PR with all elements,
Yep, also the precise i225 that you have, including its revision; there seems to be a lot of difference between various revisions of the i225. Something like pciconf -lv | grep -B 4 ethernet

Couldn't hurt to specify exactly what motherboard and BIOS version you are using. Check your BIOS version too. Unfortunately messages like Wake on Lan not working on driver higher than 1.0.1.4 for Intel l225-V do not inspire much confidence, even though you got your i225 to work with the "aid of Ubuntu".
 
Do you have a working FreeBSD suspend/resume?
If so, what do you get when having suspended FreeBSD and then send a WOL packet?

I have a FreeBSD server that has "igc" interfaces,
Edit: It might be helpful if you can give the exact type/model of this server.

P.S. May I suggest you add a message to your PR 282140 with a link this forum thread as a reference.
 
Do you have a working FreeBSD suspend/resume?
If so, what do you get when having suspended FreeBSD an then send a WOL packet?


Edit: It might be helpful if you can give the exact type/model of this server.

P.S. May I suggest you add a message to your PR 282140 with a link this forum thread as a reference.
Thanks for your suggestion, I added more information on my top post and added a link to my PR. I am still learning on that proper PR etiquette is.

I suspended the FreeBSD system using acpiconf -s 3 and it suspended properly, but sending WOL packets didn't wake it up.

For good measure, I tried it out on Linux (KDE Neon - Ubuntu 22) and when it is suspended, sending the WOL packet does wake it up
 
Thanks
I noticed you also changed the thread title to reflect the i226 NIC, great!

Perhaps I don't have a complete picture of all your experiments, but I'd like you to try:
  1. take your FreeBSD minisforum but boot Ubuntu directly from a USB stick
  2. enable WOL from ubuntu as you mentioned ( sudo ethtool -s <ifname> wol g) and shutdown
  3. take out the Ubuntu USB stick
  4. send a WOL packet from another computer to this FreeBSD computer
 
Thanks
I noticed you also changed the thread title to reflect the i226 NIC, great!

Perhaps I don't have a complete picture of all your experiments, but I'd like you to try:
  1. take your FreeBSD minisforum but boot Ubuntu directly from a USB stick
  2. enable WOL from ubuntu as you mentioned ( sudo ethtool -s <ifname> wol g) and shutdown
  3. take out the Ubuntu USB stick
  4. send a WOL packet from another computer to this FreeBSD computer
Unless I am not noticing a key difference, I have already tried this out. After enabling WOL in Ubuntu (booted from USB) and powering off, the interface turns on and links, and sending a WOL packet to the FreeBSD computer turns it on and continues the boot process to FreeBSD.

It's FreeBSD that when powering it off doesn't seem to process the WOL packet correctly to turn on the machine, which is quite sad since the interface is up and linking. Something in the NIC I226-V must be different from I225. If only I knew a bit more kernel and BSD development to check it out :(
 
It's FreeBSD that when powering it off doesn't seem to process the WOL packet correctly to turn on the machine, which is quite sad since the interface is up and linking. Something in the NIC I226-V must be different from I225. If only I knew a bit more kernel and BSD development to check it out :(
The actual waking of a computer by WOL does not involve the OS (FreeBSD or any Linux). It only involves the NIC.

What I know is that the NIC has to be set in a particular state and has to be left powered on (while the rest of the computer is usually powered off). The NIC functions as a very small controller that acts when receiving the WOL packet: it powers up the rest of the computer.

The problem, as I see it, is that FreeBSD does not provide you with functional tooling that sets your i226 in the desired state; AFAIK there is no comparable ethtool program equivalent for FreeBSD and the ifconfig setting & sysctl you mention do not seem to work. Likely such manipulation will/should work through the NIC driver, icg(4).

It seems that icg(4) has functionality build in for wake on lan, if_igc.c - L637-L647:
Code:
	/*
	 * Get Wake-on-Lan and Management info for later use
	 */
	igc_get_wakeup(ctx);

	/* Enable only WOL MAGIC by default */
	scctx->isc_capenable &= ~IFCAP_WOL;
	if (adapter->wol != 0)
		scctx->isc_capenable |= IFCAP_WOL_MAGIC;

	iflib_set_mac(ctx, hw->mac.addr);
in line with the Product brief Intel i225/i226
However, as you have shown, wake on lan does not seem to work as expected with FreeBSD.

It may be related to what powerstate the PC is powered down to. That may be controlled by the firmware and it may be also controlled by the way the OS shuts down the PC, I don't know the details of this process.

I have a Dell Optiplex that has a firmware setting that controls the powerdown state; if that is set to the absolute minimum (i.e. ~equal to pulling the power plug), then the NIC is also powered down and will not be susceptible to a WOL packet, although I have enabled the wake on lan feature. Perhaps you can verify if you can set the powerstate/powersavings state in your minisforum PC in your BIOS firmware settings. In general the Dell documentation for the Optiplex is very good, however, there wasn't an explicit mention in the section about wake on lan relating to the power setting; allthough in hindsight this relation is logical.
 
If I correctly recall, the wol capacity of a NIC is set at power off time. Linux ethtool uses the NIC driver to send the appropriate values to the hardware. So, if you have a bugged driver, this doesn't work. It once happened to me under Linux.

You can even boot to FreeBSD after using ethtool under Linux. If you power off by removing the power cable, the wol should still working.
 
Back
Top