Running FreeBSD 11.0-CURRENT (11.0-CURRENT #5 r271728: Thu Sep 18 01:18:25 CEST 2014 amd64) on a Lenovo ThinkPad Edge E540 laptop, CPU: Intel(R) Core(TM) i5-4200M CPU @ 2.50GHz (2494.28-MHz K8-class CPU), the built-in LAN adaptor doen't work correctly as it doesn't get up automatically. Symptoms: After booting the system, the OS does recognise the NIC properly and initializes the hardware. But then, the NIC is "dead" or down - no connection. Carrier is "active". Sometimes - sporadically - DHCP offers/requests where fullfilled, but then the NIC is "dead". Solution: After the box and NIC is up, turning the NIC down and then up and waiting a second or two makes the NIC working as expected. This phenomenon occurs on different types of switches (Netgear, HP Procurve, Cisco). The hardware reveals itself to the OS as re0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500 options=8219b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,TSO4,WOL_MAGIC,LINKSTATE> and miibus0: <MII bus> on re0 rgephy0: <RTL8251 1000BASE-T media interface> PHY 1 on miibus0 rgephy0: none, 10baseT, 10baseT-FDX, 10baseT-FDX-flow, 100baseTX, 100baseTX-FDX, 100baseTX-FDX-flow, 1000baseT-FDX, 1000baseT-FDX-master, 1000baseT-FDX-flow, 1000baseT-FDX-flow-master, auto, auto-flow pciconf -lbcev: [...] re0@pci0:4:0:0: class=0x020000 card=0x502817aa chip=0x816810ec rev=0x10 hdr=0x00 vendor = 'Realtek Semiconductor Co., Ltd.' device = 'RTL8111/8168B PCI Express Gigabit Ethernet controller' class = network subclass = ethernet bar [10] = type I/O Port, range 32, base rx3000, size 256, enabled bar [18] = type Memory, range 64, base rxf1d04000, size 4096, enabled bar [20] = type Memory, range 64, base rxf1d00000, size 16384, enabled cap 01[40] = powerspec 3 supports D0 D1 D2 D3 current D0 cap 05[50] = MSI supports 1 message, 64 bit cap 10[70] = PCI-Express 2 endpoint IRQ 1 max data 128(128) link x1(x1) speed 2.5(2.5) ASPM disabled(L0s/L1) cap 11[b0] = MSI-X supports 4 messages, enabled Table in map 0x20[0x0], PBA in map 0x20[0x800] cap 03[d0] = VPD ecap 0001[100] = AER 2 0 fatal 0 non-fatal 1 corrected ecap 0002[140] = VC 1 max VC0 ecap 0003[160] = Serial 1 01000000684ce000 ecap 0018[170] = LTR 1 ecap 001e[178] = unknown 1 PCI-e errors = Correctable Error Detected Corrected = Receiver Error
I reported a similar issue some time ago, this is the relevant thread on net@FreeBSD.org: http://lists.freebsd.org/pipermail/freebsd-net/2013-September/036645.html Some patches were tried at the time but the problem was not solved. I'm currently working around this with a startup script doing: start_cmd="ifconfig ${refix_if} tso" (tso is already on by default, just touching the flag wakes up the adapter). My machine is a Fujitsu siemens tower Esprimo PH300 E85+. pciconf -lbcev: re0@pci0:3:0:0: class=0x020000 card=0x11c01734 chip=0x816810ec rev=0x07 hdr=0x00 vendor = 'Realtek Semiconductor Co., Ltd.' device = 'RTL8111/8168B PCI Express Gigabit Ethernet controller' class = network subclass = ethernet bar [10] = type I/O Port, range 32, base rxd000, size 256, enabled bar [18] = type Prefetchable Memory, range 64, base rxf2104000, size 4096, enabled bar [20] = type Prefetchable Memory, range 64, base rxf2100000, size 16384, enabled cap 01[40] = powerspec 3 supports D0 D1 D2 D3 current D0 cap 05[50] = MSI supports 1 message, 64 bit cap 10[70] = PCI-Express 2 endpoint IRQ 1 max data 128(128) link x1(x1) speed 2.5(2.5) ASPM disabled(L0s/L1) cap 11[b0] = MSI-X supports 4 messages, enabled Table in map 0x20[0x0], PBA in map 0x20[0x800] cap 03[d0] = VPD ecap 0001[100] = AER 1 0 fatal 0 non-fatal 1 corrected ecap 0002[140] = VC 1 max VC0 ecap 0003[160] = Serial 1 0100000004000001 PCI-e errors = Correctable Error Detected Unsupported Request Detected Corrected = Advisory Non-Fatal Error
See also: Bug 197535 - [re] [panic] if_re (Realtek 8168) causes memory write after free and kernel panic and https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=d6e572911a4cb2b9fcd1c26a38d5317a3971f2fd (reported by Luca Pizzamiglio). The proposed patch solved the problems I encountered. Obviously Linux people also encountered this problem and solved it - but FreeBSD not. it would be nice having this nasty and unnecessary issue solved.
A commit references this bug: Author: marius Date: Thu Apr 9 21:35:45 UTC 2015 New revision: 281337 URL: https://svnweb.freebsd.org/changeset/base/281337 Log: Don't enable RX and TX before their initial configuration is done, i. e. after setting up interrupt moderation but before turning interrupts on. This matches what Realtek's r8168 Linux driver does as of version 8.039.00 and fixes problems with certain incarnations of certain MAC revisions like the interface requiring an extra up/down-cycle after boot to start working or DMA configuration not being adhered to. PR: 193743, 197535 MFC after: 1 week Changes: head/sys/dev/re/if_re.c
This has been committed.
Hello. Seems problem exists also in 10.x Can this be backported to 10.x and included in next patchlevel? Thanks.
Re-open per request and comment #5 and assign to committer who resolved
A commit references this bug: Author: marius Date: Sun Jul 5 20:16:38 UTC 2015 New revision: 285177 URL: https://svnweb.freebsd.org/changeset/base/285177 Log: MFC: r281337 Don't enable RX and TX before their initial configuration is done, i. e. after setting up interrupt moderation but before turning interrupts on. This matches what Realtek's r8168 Linux driver does as of version 8.039.00 and fixes problems with certain incarnations of certain MAC revisions like the interface requiring an extra up/down-cycle after boot to start working or DMA configuration not being adhered to. PR: 193743, 197535 Approved by: re (kib) Changes: _U stable/10/ stable/10/sys/dev/re/if_re.c
A commit references this bug: Author: marius Date: Sun Jul 5 20:16:46 UTC 2015 New revision: 285178 URL: https://svnweb.freebsd.org/changeset/base/285178 Log: MFC: r281337 Don't enable RX and TX before their initial configuration is done, i. e. after setting up interrupt moderation but before turning interrupts on. This matches what Realtek's r8168 Linux driver does as of version 8.039.00 and fixes problems with certain incarnations of certain MAC revisions like the interface requiring an extra up/down-cycle after boot to start working or DMA configuration not being adhered to. PR: 193743, 197535 Changes: _U stable/9/sys/ _U stable/9/sys/dev/ stable/9/sys/dev/re/if_re.c
A commit references this bug: Author: marius Date: Sun Jul 5 20:16:52 UTC 2015 New revision: 285179 URL: https://svnweb.freebsd.org/changeset/base/285179 Log: MFC: r281337 Don't enable RX and TX before their initial configuration is done, i. e. after setting up interrupt moderation but before turning interrupts on. This matches what Realtek's r8168 Linux driver does as of version 8.039.00 and fixes problems with certain incarnations of certain MAC revisions like the interface requiring an extra up/down-cycle after boot to start working or DMA configuration not being adhered to. PR: 193743, 197535 Changes: _U stable/8/sys/ _U stable/8/sys/dev/ _U stable/8/sys/dev/re/ stable/8/sys/dev/re/if_re.c