Author Topic: Realtek RTL8111/8168B GigE Nic - stops after 2 - 40 minutes  (Read 9040 times)

JoTraGo

  • Zen Apprentice
  • *
  • Posts: 10
  • Karma: +1/-0
    • View Profile
Realtek RTL8111/8168B GigE Ethernet Card
Zentyal 2.2.2 on Ubuntu 10.04lts


My Symptoms
I have been running Zentyal 2.2.1 on Ubuntu 10.04lts for some time with no network problems
My machine is an HPdx2300 with onboard 100MB Intel Lan chip
and an separate PCIExpress Realtek  RTL8111/8168B GigE Card

I upgraded by way of a clean install to Zentyal 2.2.2 on the same hardware
The Realtek card would just stop working after anything form 2 to 40 minutes
No other obvious symptoms, entries in logs - just no comms

After some researching it seems that there are some issues with these cards Ubuntu
Ubuntu 10.04 makes RTL8111/8168B network card unusable until cold reboot
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/573259


Slow performance ~200Kb/s and others

Further Research suggested a simpler explanation
By default Ubuntu loads the r8169 driver instead of the r8168

AND

Realtek have released a very recent (May2012) updated r8168 driver for linux
r8168-8.031.00.tar.bz2
LINUX driver for kernel 3.x and 2.6.x and 2.4.x  6.017.00  2012/5/24


ESSENTIALLY
Ubuntu by default loads the 8169 driver
Realtek have the latest 8168 driver
You need to replace the 8169 with the 8168

Check if this situation pertains in your environment
sudo lshw -C network
 description: Ethernet interface
       product: RTL8111/8168B PCI Express Gigabit Ethernet controller
       vendor: Realtek Semiconductor Co., Ltd.
       physical id: 0
       bus info: pci@0000:02:00.0 [pci@0000:02:00.0]
       logical name: eth0
       version: 03
       serial: 00:0a:cd:1a:fc:1a
       size: 1GB/s
       capacity: 1GB/s
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress msix vpd cap_list rom ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd 1000bt 1000bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=r8169 driverversion=2.3LK-NAPI duplex=full ip=192.168.42.1 latency=0 link=yes multicast=yes port=MII speed=1GB/s
       resources: irq:26 ioport:be00(size=256) memory:fd8ff000-fd8fffff memory:fdefc000-fdefffff(prefetchable) memory:fde00000-fde1ffff(prefetchable)

OK you have the r8168 card
and
Hmmm Ubuntu has loaded the r8169 driver!



This HowTo covers replacing the Ubuntu included r8169 driver
with the Realtek r8168 driver above.

I found that the Readme included with the driver covered most things
A couple of extra steps were taken from this HowTo
http://unixblogger.wordpress.com/2011/10/18/the-pain-of-an-realtek-rtl8111rtl8168-ethernet-card/

I followed the readme then added bits from the HowTo as required
This was performed on Zentyal 2.2.2 on Ubuntu 10.04LTS


1. Get root privileges
Open the Administrator Console on Zentyal Desktop

2. Get the requirements (This is required to build the module - not mentioned in Readme)
To build and install the driver, we need the kernel headers and the build tools like gcc. To get them, just easily type in a terminal:
apt-get install build-essential

3. Get the driver
Now, go to the official download page from Realtek for the Linux/UNIX Driver for the RTL8111/RTL8168 ethernet card and download the latest driver version. 8.031.00 (as of june 2012)
Link: Realtek Download Page (http://www.realtek.com.tw/downloads/downloadsView.aspx?Langid=1&PNid=13&PFid=5&Level=5&Conn=4&DownTypeID=3&GetDown=false#2)

4. Untar the archive
The driver is compressed to an archive. So uncompress it with the following command:
tar xfvj r8168-8.031.00.tar.bz2
NOTE: Please do not forget to replace the “r8168-8.031.00.tar.bz2? with the driver version which you have downloaded!
It untars into a subdirectory r8168-8.031.00 which contains a script autorun.sh which does all the hard work for you

4a. Run the provided install script
cd r8168-8.031.00
./autorun.sh

Should get to "Completed"
You can check what it did in the Log.txt in the r8168-x.yyy.zz folder

That’s it! After a reboot you should have the best possible performance with the RTL8111/RTL8168 and hopefully no other network problems

After the reboot you can check if the right driver is loaded by again running:
sudo lshw -C network

Happiness!   :)


robb

  • Guest
Re: Realtek RTL8111/8168B GigE Nic - stops after 2 - 40 minutes
« Reply #1 on: June 13, 2012, 09:18:29 am »
Thank you for your work and sharing this with the community! (+1!)

Escorpiom

  • Zen Hero
  • *****
  • Posts: 897
  • Karma: +25/-1
    • View Profile
Re: Realtek RTL8111/8168B GigE Nic - stops after 2 - 40 minutes
« Reply #2 on: June 13, 2012, 02:53:08 pm »
I'm curious if this issue will be present in Ubuntu 12 / Zentyal 3.0 also, if it is it might be a good idea to make a howto out of it.

Cheers.
Marcus' Rule:
Blanks & capitals = avoid it and you'll avoid problems...

ichat

  • Zen Hero
  • *****
  • Posts: 795
  • Karma: +28/-16
  • RTFM!
    • View Profile
Re: Realtek RTL8111/8168B GigE Nic - stops after 2 - 40 minutes
« Reply #3 on: June 14, 2012, 11:19:05 am »
if im not mistaking my  esxi is  using this chip in pci- passthrough with no errors at al not in  2.2.1 2.2.2  nor in   2.3  but i did upgrade from 2.2.1 tot 2.2.2 witch may have led to my system loading the old driver config.

anyway, also after testing the 2.2 on a real box with this chip didn't not get me a reproduction of this error,   i wonder why..

anyway - its always good to show people how to fix these glitches   i hope ubuntu will fix this soon..   


All tips hints and advices are based on my personal experience.
As I try my best to be as accurate as possible, following my advice is always at your own risk,
I claim absolutely NO responsibility in any way!

Felix_FV

  • Zen Apprentice
  • *
  • Posts: 7
  • Karma: +0/-0
    • View Profile
Re: Realtek RTL8111/8168B GigE Nic - stops after 2 - 40 minutes
« Reply #4 on: June 20, 2012, 12:43:07 pm »
I love you man :)
I have some problems.

Joeg1484

  • Zen Monk
  • **
  • Posts: 68
  • Karma: +2/-0
    • View Profile
Re: Realtek RTL8111/8168B GigE Nic - stops after 2 - 40 minutes
« Reply #5 on: March 01, 2013, 05:31:42 am »
WOW...  Very nice performance now with the new driver...

I'm running Zentyal in a KVM and was getting really crappy network performance! This picked things up a little :)

Thanks for the tip!!!
Joe

shaqan

  • Zen Apprentice
  • *
  • Posts: 14
  • Karma: +0/-0
    • View Profile
Re: Realtek RTL8111/8168B GigE Nic - stops after 2 - 40 minutes
« Reply #6 on: April 09, 2013, 07:09:51 am »
to be on the safe side, get decent Intel (1000MT/CT/GT) NIC.. Plenty of those for sale in EBay and you can pick up even cards meant for servers for quite cheap.

Realtek's have stability problems even under Windows, not to mention often enough in Linux or BSD-s..
especially RTL8139 series is horrendous

Also, often they have problems using Bus Master DMA (or wont support it at all) which leads to using a lot of system CPU resources, near gigabit speeds, usage of CPU becomes quite noticeable..
« Last Edit: April 09, 2013, 07:12:11 am by shaqan »