Welcome! Log In Create A New Profile

Advanced

Realtek r8168 driver on NSA310

Posted by pengu 
Realtek r8168 driver on NSA310
September 06, 2015 02:44PM
I've noticed that on ZyXEL OS 45 MB/s read and 40 MB/s write is possible.
on debian, only 20 - 25 MB/s read and 35 - 38 MB/s write is possible.

the "r8169 driver is built into the kernel so I have to change this.

I'm using the stock kernel 4.2 sources + patch and the r8169 driver is built as module
Now, I could unload / blackist it and use the r8168 driver.


http://pastebin.com/ZkAzBbHX <-bootlog with newer U-Boot and the "r8169 as module:

lsmod | grep r8169
r8169                  58444  0

after unloading, I can use the built r8168.

modprobe  r8168
[  798.429942] r8168 Gigabit Ethernet driver 8.040.00-NAPI loaded
[  798.436796] r8168 0000:01:00.0: no MSI. Back to INTx.
[  798.448318] r8168: This product is covered by one or more of the following patents: US6,570,884, US6,115,776, and US6,327,625.
[  798.460365] r8168  Copyright (C) 2015  Realtek NIC software team <nicfae@realtek.com> 
[  798.460365]  This program comes with ABSOLUTELY NO WARRANTY; for details, please see http://www.gnu.org/licenses/. 
[  798.460365]  This is free software, and you are welcome to redistribute it under certain conditions; see http://www.gnu.org/licenses/.

Now the situation is different:
high read and a bit slow write rates

- 52 - 67 MB/s read (depending on the OS)
- 27 - 32 MB/s write (depending on the OS)

perhaps I could change something bei passing some option(s) to the module

 modinfo r8168
filename:       /lib/modules/4.2.0-rm-1/kernel/drivers/net/ethernet/realtek/r8168.ko
version:        8.040.00-NAPI
license:        GPL
description:    RealTek RTL-8168 Gigabit Ethernet driver
author:         Realtek and the Linux r8168 crew <netdev@vger.kernel.org>
srcversion:     BC1CAF8ECC36006913B85E5
alias:          pci:v00001186d00004300sv00001186sd00004B10bc*sc*i*
alias:          pci:v000010ECd00008168sv*sd*bc*sc*i*
depends:        
vermagic:       4.2.0-rm-1 preempt mod_unload modversions ARMv5 p2v8 
parm:           speed:force phy operation. Deprecated by ethtool (8). (ushort)
parm:           duplex:force phy operation. Deprecated by ethtool (8). (int)
parm:           autoneg:force phy operation. Deprecated by ethtool (8). (int)
parm:           aspm:Enable ASPM. (int)
parm:           s5wol:Enable Shutdown Wake On Lan. (int)
parm:           rx_copybreak:Copy breakpoint for copy-only-tiny-frames (int)
parm:           timer_count:Timer Interrupt Interval. (int)
parm:           eee_enable:Enable Energy Efficient Ethernet. (int)
parm:           hwoptimize:Enable HW optimization function. (ulong)
parm:           debug:Debug verbosity level (0=none, ..., 16=all) (int)

Edit

config and deb files for testing:

linux-4.2.0-kirkwood-rm-1.tar.bz2

after installing , creating uImage and uInitrd, the r8168 driver can be build
please note that you need a newer U-Boot for this to work

https://github.com/mtorromeo/r8168



Edit:

for testing:

debian jessie rootfs, linux-4.2.1 using r8168 driver



Edited 9 time(s). Last edit at 06/15/2016 02:18PM by pengu.
Attachments:
open | download - config.txt (111.4 KB)
Re: NSA310 testing the realtek r8168 driver
September 07, 2015 02:33AM
pengu Wrote:
-------------------------------------------------------
> I've noticed that on ZyXEL OS 45 MB/s
> read and 40 MB/s write is possible.
> on debian, only 20 - 25 MB/s read and 35
> - 38
MB/s write is possible.
>
> the "r8169 driver is built into the kernel so I
> have to change this.
>
> I'm using the stock kernel 4.2 sources + patch and
> the r8169 driver is built as module
> Now, I could unload / blackist it and use the
> r8168 driver.
>
>
> http://pastebin.com/ZkAzBbHX <-bootlog with newer
> U-Boot and the "r8169 as module:
>
>
> lsmod | grep r8169
> r8169                  58444  0 
>
>
> after unloading, I can use the built r8168.
>
>
> modprobe  r8168
> [  798.429942] r8168 Gigabit Ethernet driver
> 8.040.00-NAPI loaded
> [  798.436796] r8168 0000:01:00.0: no MSI. Back to
> INTx.
> [  798.448318] r8168: This product is covered by
> one or more of the following patents: US6,570,884,
> US6,115,776, and US6,327,625.
> [  798.460365] r8168  Copyright (C) 2015  Realtek
> NIC software team <nicfae@realtek.com> 
> [  798.460365]  This program comes with ABSOLUTELY
> NO WARRANTY; for details, please see
> http://www.gnu.org/licenses/. 
> [  798.460365]  This is free software, and you are
> welcome to redistribute it under certain
> conditions; see http://www.gnu.org/licenses/. 
>
>
> Now the situation is different:
> high read and a bit slow write rates
>
> - 52 - 67 MB/s read (depending on the OS)
> - 27 - 32 MB/s write (depending on the OS)
>
> perhaps I could change something bei passing some
> option(s) to the module
>
>
>  modinfo r8168
> filename:      
> /lib/modules/4.2.0-rm-1/kernel/drivers/net/etherne
> t/realtek/r8168.ko
> version:        8.040.00-NAPI
> license:        GPL
> description:    RealTek RTL-8168 Gigabit Ethernet
> driver
> author:         Realtek and the Linux r8168 crew
> <netdev@vger.kernel.org>
> srcversion:     BC1CAF8ECC36006913B85E5
> alias:         
> pci:v00001186d00004300sv00001186sd00004B10bc*sc*i*
> 
> alias:         
> pci:v000010ECd00008168sv*sd*bc*sc*i*
> depends:        
> vermagic:       4.2.0-rm-1 preempt mod_unload
> modversions ARMv5 p2v8 
> parm:           speed:force phy operation.
> Deprecated by ethtool (8). (ushort)
> parm:           duplex:force phy operation.
> Deprecated by ethtool (8). (int)
> parm:           autoneg:force phy operation.
> Deprecated by ethtool (8). (int)
> parm:           aspm:Enable ASPM. (int)
> parm:           s5wol:Enable Shutdown Wake On Lan.
> (int)
> parm:           rx_copybreak:Copy breakpoint for
> copy-only-tiny-frames (int)
> parm:           timer_count:Timer Interrupt
> Interval. (int)
> parm:           eee_enable:Enable Energy Efficient
> Ethernet. (int)
> parm:           hwoptimize:Enable HW optimization
> function. (ulong)
> parm:           debug:Debug verbosity level
> (0=none, ..., 16=all) (int)
>

What tool did you use to test the network speed? they are quite slow with either drivers if those were pure network measurements on a Gbit Ethernet.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)



Edited 1 time(s). Last edit at 09/07/2015 02:47AM by bodhi.
Re: NSA310 testing the realtek r8168 driver
September 07, 2015 02:44AM
this is the real file transfer rate (samba, large file)
the more I apply some modification to /etc/smb.conf, the more it depends on the OS.

shure, I could use nc or iperf but in real life ftp, samba or http is used.

later I'll do some more testing

atm, the situation is like this:

- the r8168 driver offers high read bot slow write rates
- the r8169 driver offers slow read bat normal write rates (compared to other devices using the marvell lan)

I'm using vanilla kernel + your patch + my config

bodhi Wrote:
-------------------------------------------------------
> What tool did you use to test the network speed?
> they are quite slow wit either drivers if those
> were pure network measurements on a Gbit Ethernet.



Edited 1 time(s). Last edit at 09/07/2015 02:45AM by pengu.
Re: NSA310 testing the realtek r8168 driver
September 07, 2015 03:03AM
Quote

shure, I could use nc or iperf but in real life ftp, samba or http is used.

I think this assumption is not quite correct. To compare the network speed between the 2 drivers, we should use iperf. Once you add other file systems, network shares,... into the equation, it's no longer valid. They should be measured separately, IMO.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: NSA310 testing the realtek r8168 driver
September 07, 2015 03:19AM
yes, that's why I've mentioned it.
when using other filesystems, it depends on processes and disk io, cpu performance, amount of ram
they are limiting transfer speeds but you can compare it.

On other boxes I've seen (with some optimisations) 50 - 60 MB/s read and 35 - 40 MB/s write (samba)
one thing concerning the "r8169": samba tuning has no effect.
when using the "r8168" it has (as seen on boxes with marvell lan chip)
Re: NSA310 testing the realtek r8168 driver
September 07, 2015 04:15PM
@pengu,

I will build the kernel version linux-4.2.0-kirkwood-tld-2 with r8169 built as module. I'm still looking at integrating the r8168 module into the kernel source, but it might take a while.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: NSA310 testing the realtek r8168 driver
September 08, 2015 02:16AM
thanks bodhi, but you have to make shure that the "r8169" isn't built into the kernel build it as module as I have done it
so you can simply blacklist it if necessary
when both modules are enabled, the r8169 is prefered
Re: NSA310 testing the realtek r8168 driver
September 08, 2015 08:17PM
pengu,

As long as it is a module, you can remove it and modprobe r8168 in /etc/rc.local. You can also blacklist it and load the r8168 in /etc/initramfs-tools/modules to make it run earlier.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: NSA310 testing the realtek r8168 driver
September 23, 2015 12:59PM
http://pastebin.com/raw.php?i=rLi4GDaZ

new try with up-to-date kernel (4.2.1-kirkwood-rm-1) and blacklisted r8169 module
mostly the same read/write rates.. sorry that I'm still using SMB file transfer .. I'm more or less out of time



Edited 1 time(s). Last edit at 09/23/2015 01:56PM by pengu.
Re: NSA310 testing the realtek r8168 driver
March 15, 2016 07:01AM
I'm trying to make Kernel 4.5 ready for this device.

When building the "r8168" driver, the following has to be change, otherwhise, the driver won't compile:
The function "NETIF_F_ALL_CSUM" was renamed to "NETIF_F_CSUM_MASK"

-> src/r8168_n.c:4212

ATM no NSA310 is here to test but according to this it's only a rename.
Re: Realtek r8168 driver on NSA310
June 15, 2016 02:33PM
a NSA310 box is here again so I could have a closer look again on it.

I tried to compare the raw network throughput (iperf) and I see some differences:
With the "r8169" driver, you can get :

300 - 600 MBit (NSA310 server)
200 - 500 mbit/s (NSA310 client).

This changes a bit when it comes to the "r8168" driver:

700 MBit (NSA310 server)
700 MBIt - 900 MBit (NSA310 client)


The sambe file copy throughput is comparable to earlier tests:

38 - 40 MB/s read (r8169)
21 - 23 MB/s write (r8169)

32 - 36 MB/s read (r8168)
31 - 32 MB/s write (r8168)

When testing on Windows 8.1 (perhaps Windows 10 too) I get different rates with RTL8111 network card:

103 - 107 MB/s read (r8168)
39 - 40 MB/s write (r8168)

I'm using Kernel 4.4.12 for now because I want to have one (working) kernel for all devices and as long as there are some trobles with newer kernels on some devices, I'll stay there.
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: