# problems with if_re: RTL8111/8168B



## tbyte (Mar 16, 2012)

There are some weird problems with the built-in realtek ethernet card under FreeBSD (works in windows and linux). Sometimes it work normally sometimes it loses more than 30% of the packets and it can't reach more than 1.5-2MB/s on a gigabit network.


```
re0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=209b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,WOL_MAGIC>
        ether e4:11:5b:33:d6:d4
        inet 10.0.0.84 netmask 0xffffff00 broadcast 10.0.0.255
        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
        media: Ethernet autoselect (1000baseT <full-duplex>)
        status: active

re0@pci0:38:0:0:        class=0x020000 card=0x167c103c chip=0x816810ec rev=0x06 hdr=0x00
    vendor     = 'Realtek Semiconductor Co., Ltd.'
    device     = 'RTL8111/8168B PCI Express Gigabit Ethernet controller'
    class      = network
    subclass   = ethernet
```


I tried disabling rx and tx chksum - same thing. I disabled msi/msix (hw.re.msi_disable=1, 
hw.re.msix_disable=1) and nothing changed. I'm kind of out of options 

FreeBSD 9.0-STABLE #1: Thu Mar 15 02:59:58 EET 2012 amd64 on a HP Probook 4530s.

Regards, Iasen.


----------



## rob34 (Mar 29, 2012)

I'm having the same problem running on 9.0 Release.  The same hardware ran fine on 8.2.  The NIC is integrated into an Asus desktop motherboard.

I also tried changing the checksum settings but those changes yielded no improvement.  No errors are reported to either the console or /var/log/messages.

My computers are all connected to an 8 port Netgear switch.  I know that the switch is functional because all other PCs are running at normal gigabit ethernet speeds.  I did switch the problematic PC's switch port and patch cable but that didn't seem to help at all.

I noticed that the Windows Task Manager shows an initial spike of around 25 MB/s when I copy files to/from the FreeBSD 9.0 machine, but after about 1 second it drops to 1-2 MB/s.  I get the same performance when copying data via apache22, samba and ftp.

From /etc/rc.conf:

```
ifconfig_re0="inet 192.168.2.53 netmask 255.255.255.0"
```


```
re0@pci0:3:0:0: class=0x020000 card=0xd6138086 chip=0x816810ec rev=0x03 hdr=0x00
    vendor     = 'Realtek Semiconductor Co., Ltd.'
    device     = 'RTL8111/8168B PCI Express Gigabit Ethernet controller'
    class      = network
    subclass   = ethernet

re0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=389b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,WOL_UCAST,WOL_MCAST,WOL_MAGIC>
        ether 00:1c:c0:e7:3f:11
        inet 192.168.2.53 netmask 0xffffff00 broadcast 192.168.2.255
        inet6 fe80::21c:c0ff:fee7:3f11%re0 prefixlen 64 scopeid 0x1
        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
        media: Ethernet autoselect (1000baseT <full-duplex>)
        status: active
```


----------



## yongari@ (Apr 12, 2012)

Please open a new PR with detailed information.


----------

