Bug 232708 - Wake on LAN doesn't work for any of my NIC cards (em0, bge0)
Summary: Wake on LAN doesn't work for any of my NIC cards (em0, bge0)
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 11.2-RELEASE
Hardware: amd64 Any
: --- Affects Only Me
Assignee: freebsd-net (Nobody)
Keywords: regression
Depends on:
Reported: 2018-10-26 11:50 UTC by George B
Modified: 2019-04-22 16:13 UTC (History)
3 users (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description George B 2018-10-26 11:50:20 UTC
WOL does not seem to be working after an upgrade from 11.1 to 11.2-RELEASE-p4. 
I have an HP (NL40) microserver with an HP NC360T and WOL works for neither the on-board bge0 BCM5723 Gigabit Ethernet PCIe or the em0/1 82571EB Gigabit Ethernet Controller.

What I find strange is that ifconfig -m em0 reports
WOL as capability but not as an option ...

em0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 9000
        ether 00:24:81:7c:05:a8
        hwaddr 00:24:81:7c:05:a8
        media: Ethernet autoselect (1000baseT <full-duplex>)
        status: active
        supported media:
                media autoselect
                media 1000baseT
                media 1000baseT mediaopt full-duplex
                media 100baseTX mediaopt full-duplex
                media 100baseTX
                media 10baseT/UTP mediaopt full-duplex
                media 10baseT/UTP

I always had problems getting the bge0 WOL (since version 8) working with WOL but this is the first time I am having problems with the NC360T.

Any help would be appreciated ...
Comment 1 Marek Zarychta 2018-10-26 12:31:03 UTC
It's not a bug, it's a feature. I assume you have enabled WoL in BIOS/UEFI.
The interface should be brought up with one of its WoL capabilities, so in /etc/rc.conf you should have at least :
ifconfig_em0="up wol_magic"

I got it working with I217-LM, but the machine could be suspended only once, suspending after resume works, but workstation wakes up almost immediately. Next long lasting sleep state is possible after reboot. It's probably another feature.
Comment 2 George B 2018-10-26 13:40:59 UTC
Thanks for the reply,
(In reply to Marek Zarychta from comment #1)
I've had this Kit for over 4 years now so yes WoL is BIOS enabled.
I have already tried bringing up WOL capabilities on boot but that is not the problem I think. It seems that the option is missing... altogether 
In 11.1 I even had bge0 working thanks to this https://github.com/NamTaf/if_bge_wol patch.

No luck so far with 11.2
Comment 3 Marek Zarychta 2018-10-28 16:22:55 UTC
I can also confirm that on fresh 11.2-STABLE r339662 it is impossible to enable wol_magic option for NC360T NIC which is based on em(4) Intel  82571EB. I am able to turn this option on and off for em(4) NICs based on Intel: 82546EB, 82541GI, 82566MM, I217-LM though. The breakage in 11-STABLE  occurred between r326425 and r339662.
Comment 4 Kaho Toshikazu 2018-10-30 08:55:43 UTC
(In reply to Marek Zarychta from comment #3)

> The breakage in 11-STABLE  occurred between r326425 and r339662.

Really? Between these revisions, the almost changes are additions of support
for kaby Lake generation chips. The other changes are only comments corrections.

Can you revert r323079 or r322955? They have changes related WOL.
Comment 5 Marek Zarychta 2019-01-02 15:31:33 UTC
(In reply to Kaho Toshikazu from comment #4)
I am sorry I have been ignoring your reply for such a long time. I can't experiment much with this box as it's almost retired, cold spare backup. I'll move the NIC to another box when I found a replacement.
Comment 6 Kaho Toshikazu 2019-01-21 08:26:45 UTC
(In reply to Marek Zarychta from comment #5)

I recommend to use a new hardware and a new release like 12.0-RELEASE.
But try the patch, if you really test. 

Index: sys/dev/e1000/if_em.c
--- sys/dev/e1000/if_em.c       (revision 343252)
+++ sys/dev/e1000/if_em.c       (working copy)
@@ -2508,6 +2508,7 @@
        E1000_WRITE_REG(&adapter->hw, E1000_WUC, 0);
+       E1000_WRITE_REG(&adapter->hw, E1000_WUFC, 0);
Comment 7 Marek Zarychta 2019-01-22 12:08:37 UTC
(In reply to Kaho Toshikazu from comment #6)
Thank you for the patch. I have applied it on r343301, but the issue hasn't been resolved. Still "wol_magic" option can't be enabled for 82571EB.