RTL8111/8168B Network Card & FreeBSD

Hello,

We are trying to install FreeBSD on a computer that uses the network card mentioned above. The network card is running under linux without problems.

The card is neither detected by the FreeBSD installer when attempting to setup the network, nor after the system installation when booting from HD. We've tested FreeBSD 8.x, 9.x and 10.x; same issues with this card.

We cannot use a different network card (this one is onboard. The micro ATX mainboard has no room left for any other device)

pciconf -l -v
Code:
none2@pci0:3:0:0:	class=0x020000 card=0x81681849 chip=0x816810ec rev=0x0c hdr=0x00
    vendor     = 'Realtek Semiconductor Co., Ltd.'
    device     = 'RTL8111/8168B PCI Express Gigabit Ethernet controller'
    class      = network
    subclass   = ethernet

dmesg
Code:
re0: <RealTek 8168/8111 B/C/CP/D/DP/E/F PCIe Gigabit Ethernet> port 0xd000-0xd0ff mem 0xf3204000-0xf3204fff,0xf3200000-0xf3203fff irq 19 at device 0.0 on pci3
re0: Using 1 MSI-X message
re0: Chip rev. 0x4c000000
re0: MAC rev. 0x00000000
re0: Unknown H/W revision: 0x4c000000
device_attach: re0 attach returned 6

ifconfig -a
Code:
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
	options=600003<RXCSUM,TXCSUM,RXCSUM_IPV6,TXCSUM_IPV6>
	inet6 ::1 prefixlen 128 
	inet6 fe80::1%lo0 prefixlen 64 scopeid 0x5 
	inet 127.0.0.1 netmask 0xff000000 
	nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>

Even though dmesg shows the device re0, it remains unknown to ifconfig.


Best Regards
Danny
 
You need to load the NIC driver: # kldload if_re. If you get message:
Code:
kldload: can't load if_re: File exists
Then you need to check whether the hardware (NIC) is damaged. Do further diagnostics and make sure that
The network card is running under linux without problems.
Is actually a rigorous statement and not a trivial working appearance. The source code for FreeBSD and linux for almost all hardware drivers is the same.
 
Code:
re0: Unknown H/W revision: 0x4c000000

This is a sure sign that this version of the card is not supported by the driver. Realtek has a nasty habit of changing the internals of their network cards in incompatible ways while keeping the hardware vendor and product IDs the same. You'll have to ask this on the freebsd-net mailing list to get further assistance.
 
We've tested the NIC on linux for several days now, transfering several GB of data. The NIC is working on linux without any issues.

Code:
kldload: can't load if_re: File exists
I assume this message pops up, because if_re is already loaded in the generic kernel so that it can't be loaded again as a module.

Any patches or workarounds? What about USB NICs on FreeBSD?


What is the best way to address this bug?
 
Like I said post on the mailing list or file a PR. This issue has to be brought into the attention of a developer who can take a look at the problem and then patch the driver to support this unsupported version of the NIC.
 
[Solved] RTL8111/8168B Network Card & FreeBSD

After describing the problem via mailing-list, I was told there is already the following patch available:

http://lists.freebsd.org/pipermail/freebsd-net/attachments/20131023/e1d480e3/attachment.bin

After correcting a little typo in the containing header-file, and recompiling the if_re module, the device went up and works like a charm on FreeBSD 9.1.

I will upgrade the system to FreeBSD 9.2 next weekend and see if the patch works there as well.

Problem solved.


Greetings
Danny
 
I have dealt with similar issues and finally solved them.
I found the two following posts a bit misleading:
You need to load the NIC driver: # kldload if_re. If you get message:
Code:
kldload: can't load if_re: File exists
Then you need to check whether the hardware (NIC) is damaged. Do further diagnostics and make sure that

Is actually a rigorous statement and not a trivial working appearance. The source code for FreeBSD and linux for almost all hardware drivers is the same.

Code:
re0: Unknown H/W revision: 0x4c000000

This is a sure sign that this version of the card is not supported by the driver. Realtek has a nasty habit of changing the internals of their network cards in incompatible ways while keeping the hardware vendor and product IDs the same. You'll have to ask this on the freebsd-net mailing list to get further assistance.
It actually turned out that there where more than one "if_re.ko"-driver files. After a quick
find / -name if_re.ko and overwriting all occurrences, the issue was finally solved.
 
Top