Jump to content

New Driver for Realtek RTL8111


Mieze
1,593 posts in this topic

Recommended Posts

oh thanks, you've moved on to El Capitan.  is there any compelling reason for me to use 1.2.3 or 2.0.0 under Mavericks, or do you feel 1.2.2 will perform generally as well?  You mentioned that 2.0.0 was made for Yosemite, so I'm not sure if that means 1.2.3 should be the last consideration for Mavericks ,maybe yes?

Link to comment
Share on other sites

AFAIK 2.0.0 was working under Mavericks too, although I haven't tested it myself. By the way, anything below 2.2.1 should still work on Mavericks. Starting with version 2.0.0 I moved to Apple's new driver interface which resolves a number of issues in certain situations, in particular with VMware.

 

Mieze

Link to comment
Share on other sites

I obtained version 2.2.1d3 using git checkout.  Built it.  It seems to be working ok in Mavericks. (See attachment)  

 

I will do some iperf testing later when I get some time and compare between various versions of your realtek driver and also against some others that are out there.  

 

One quick question about the Xcode project, I see there are two schemes, one is called xxxx-v2.  Which scheme is the right one to use for building this?  I used V2, seems to work.  Just asking.

 

I also noticed the Xcode project version number is still 1.4xxx something er other...  FWIW.  That's what gets displayed by GET INFO and other stuff when the kext loads.  The build I attached here has version set to 2.2.1d3, which I guess will be the last working version of this driver up through Yosemite.

RealtekRTL8111.kext.zip

  • Like 1
Link to comment
Share on other sites

I promised some test results.  I was able to get gigabit ethernet out of my mobo once I removed problematic cables it would seem.  I used iperf2 and iperf3 to run through a series of tests between this box and another machine.

 

But definitely found different levels of performance and reliability between the four drivers I tried.  The newest one from Mieze that is supported through Yosemite, version 2.2.1d3, proved to be the best in all regards, reliability and performance.  I am unable to test 2.2.0, as I'm on mavericks.  

 

v2.2.1d3 performed stellar and seemed reliable.  It also used the least cpu to do what it needs to do, with even spread across 4 cores.

 

v1.2.2 was actually very poor in comparison.  It performed 20-30% slower then 2.2.1d3.  It also cratered networking on the mac easily by doing a 2-thread test in iperf.  The mac literally had to be rebooted to get networking back. I don't recommend this version of the driver.

 

The official Apple RTL8169 driver was tested.  This driver actually performed very well, about 5% better then v2.2.1d3.  However it used at least double the CPU and furthermore it did not use all 4 cores of my machine evenly. (note, some of that could be related to the way iperf3 works)

 

Lnx2's driver was also tested, it performed very similarly to the Apple driver in terms of both performance and CPU utilization.

 

Bottom line I'm getting the best performance out of Maize's v2.2.1d3 driver, with lowest CPU.  Its 5% slower then Apple's and LNX2's, but much more efficient with the CPU in some way.  I do not know what led LNX2 and maize to build new drivers instead of the one Apple has provided, that seems to work fine, albeit a bit hard on the CPU.  

 

Howeve with v2.2.1d3 I was able to transfer a file from my linux NAS over to this machine at over 900mbps, transferred 8gb's in under 2 minutes.  As far as I'm concerned that is smokin' performance out of a motherboard chip.

 

I will have to run with this for a while to see if I run into any other operational problems under different networking situations, we shall see, but for now, it looks very solid.

Link to comment
Share on other sites

v1.2.2 was actually very poor in comparison.  It performed 20-30% slower then 2.2.1d3.  It also cratered networking on the mac easily by doing a 2-thread test in iperf.  The mac literally had to be rebooted to get networking back. I don't recommend this version of the driver.

It's not the driver which died but the network stack due to packet buffer exhaustion when it gets flooded with packets. That's the reason why Apple introduced the new driver interface and added a packet scheduler (QFQ). This is also the reason why I switched to the new interface in version 2.0.0.

But definitely found different levels of performance and reliability between the four drivers I tried.  The newest one from Mieze that is supported through Yosemite, version 2.2.1d3, proved to be the best in all regards, reliability and performance.  I am unable to test 2.2.0, as I'm on mavericks.  

That's a power management issue, the more efficient you are, the worse it gets. Version 2.2.1d3 uses the polled mode under heavy load which improves cooperation with power management.

Link to comment
Share on other sites

Bottom line I'm getting the best performance out of Maize's v2.2.1d3 driver, with lowest CPU.  Its 5% slower then Apple's and LNX2's, but much more efficient with the CPU in some way.  I do not know what led LNX2 and maize to build new drivers instead of the one Apple has provided, that seems to work fine, albeit a bit hard on the CPU.  

My driver is the only one which makes full use of the NIC's hardware offload features. That's why it causes less CPU load. Unlike the other drivers it also works with recent chips like the RTL8111G and RTL8111H.

 

Mieze

  • Like 2
Link to comment
Share on other sites

It sounds like you are making a lot of ongoing improvements to this driver.  I hope you will consider coding it in a way so that a version can be built for Mavericks and yosemite with whatever further improvements you come up with.  You have that one line that is forcing El Capitan, which is fine for now..but in the future when you improve it in other ways, it would be good to have a branch that doe snot use that call so that those of us on Mavericks and yosemite will be able to benefit from those other future improvements.  Anyway, nice job and thank you very much for your contribution!

Link to comment
Share on other sites

  • 2 weeks later...

 

Hello and thank you for your hard work. Your kext is great except this occasional KP upon going to sleep (possibly, when the network is under heavy load, but cannot be sure)

 

here is the log:

*** Panic Report ***
panic(cpu 0 caller 0xffffff80003ce40a): Kernel trap at 0xffffff7f82b1347e, type 14=page fault, registers:
CR0: 0x000000008001003b, CR2: 0xffffff81e409c1d0, CR3: 0x00000000093aa000, CR4: 0x00000000001626e0
RAX: 0x0000000000000000, RBX: 0xffffff81a3631000, RCX: 0x00000000000001d0, RDX: 0x0000000000000100
RSP: 0xffffff91f22ebce0, RBP: 0xffffff91f22ebd70, RSI: 0xffffff8024a85c00, RDI: 0x000000000000001d
R8:  0x0000000000000000, R9:  0xffffff8000a9e7c0, R10: 0x0000000000000000, R11: 0x00002ac243f6c62e
R12: 0xffffff81a3631000, R13: 0xffffff81e409c000, R14: 0xffffff81a3631000, R15: 0x0000000000000000
RFL: 0x0000000000010202, RIP: 0xffffff7f82b1347e, CS:  0x0000000000000008, SS:  0x0000000000000010
Fault CR2: 0xffffff81e409c1d0, Error code: 0x0000000000000000, Fault CPU: 0x0, PL: 0

Backtrace (CPU 0), Frame : Return Address
0xffffff91f22eb970 : 0xffffff80002dab12 
0xffffff91f22eb9f0 : 0xffffff80003ce40a 
0xffffff91f22ebbd0 : 0xffffff80003ec273 
0xffffff91f22ebbf0 : 0xffffff7f82b1347e 
0xffffff91f22ebd70 : 0xffffff7f82b13f86 
0xffffff91f22ebd90 : 0xffffff7f81844ae4 
0xffffff91f22ebdc0 : 0xffffff80008b5958 
0xffffff91f22ebe30 : 0xffffff7f81844b4b 
0xffffff91f22ebe80 : 0xffffff7f81848d7c 
0xffffff91f22ebef0 : 0xffffff8000565b8b 
0xffffff91f22ebfb0 : 0xffffff80003c8e27 
      Kernel Extensions in backtrace:
         com.apple.iokit.IONetworkingFamily(3.2)[848B398F-4D96-3024-8092-6CD3534D2CCA]@0xffffff7f8183c000->0xffffff7f8186ffff
         com.insanelymac.RealtekRTL8111(2.2.1d4)[B320DB79-DD55-303F-8181-C1CED8269439]@0xffffff7f82ab2000->0xffffff7f82b18fff
            dependency: com.apple.iokit.IONetworkingFamily(3.2)[848B398F-4D96-3024-8092-6CD3534D2CCA]@0xffffff7f8183c000
            dependency: com.apple.iokit.IOPCIFamily(2.9)[4FE41F9B-2849-322A-BBF8-A94816C003D6]@0xffffff7f80b7d000

BSD process name corresponding to current thread: kernel_task
Boot args: nvda_drv=1 nv_spanmodepolicy=1 kext-dev-mode=1 rootless=0 slide=0 

Mac OS version:
15E65

Kernel version:
Darwin Kernel Version 15.4.0: Fri Feb 26 22:08:05 PST 2016; root:xnu-3248.40.184~3/RELEASE_X86_64
__HIB  text base: 0xffffff8000100000
System model name: iMac13,2 (Mac-FC02E91DDD3FA6A4)

System uptime in nanoseconds: 47013852363025
last loaded kext at 46650209409283: com.apple.driver.AppleXsanScheme	3 (addr 0xffffff7f82b2e000, size 32768)
last unloaded kext at 46780152258995: com.apple.driver.AppleXsanScheme	3 (addr 0xffffff7f82b2e000, size 32768)
loaded kexts:
com.nvidia.CUDA	1.1.0
com.nvidia.web.GeForceWeb	10.1.1
com.nvidia.web.NVDAGK100HalWeb	10.1.1
com.nvidia.web.NVDAResmanWeb	10.1.1
com.usboverdrive.driver.hid	3.2
at.obdev.nke.LittleSnitch	4362
org.hwsensors.driver.GPUSensors	1707
com.insanelymac.RealtekRTL8111	2.2.1d4
org.hwsensors.driver.LPCSensors	1707
net.osrom.kext.Disabler	1.0.1
org.voodoo.driver.VoodooHDA	2.8.8
org.hwsensors.driver.ACPISensors	1707
org.hwsensors.driver.CPUSensors	1707
org.netkas.driver.FakeSMC	1707
com.apple.filesystems.ntfs	3.13
com.apple.driver.ApplePlatformEnabler	2.6.0d0
com.apple.driver.AGPM	110.21.18
com.apple.driver.X86PlatformShim	1.0.0
com.apple.filesystems.autofs	3.0
com.apple.driver.pmtelemetry	1
com.apple.iokit.IOUserEthernet	1.0.1
com.apple.driver.AppleUpstreamUserClient	3.6.1
com.apple.driver.AppleMCCSControl	1.2.13
com.apple.iokit.IOBluetoothSerialManager	4.4.4f4
com.apple.driver.AppleOSXWatchdog	1
com.apple.Dont_Steal_Mac_OS_X	7.0.0
com.apple.driver.AppleIntelHD4000Graphics	10.1.4
com.apple.driver.AppleHV	1
com.apple.driver.AppleLPC	3.1
com.apple.driver.AppleIntelSlowAdaptiveClocking	4.0.0
com.apple.driver.AppleIntelFramebufferCapri	10.1.4
com.apple.driver.AppleRAID	5.1.0
com.apple.AppleFSCompression.AppleFSCompressionTypeDataless	1.0.0d1
com.apple.AppleFSCompression.AppleFSCompressionTypeZlib	1.0.0
com.apple.BootCache	38
com.apple.iokit.IOAHCIBlockStorage	2.8.5
com.apple.driver.AirPort.Atheros40	700.74.5
com.apple.driver.AppleAHCIPort	3.1.8
com.apple.driver.usb.AppleUSBEHCIPCI	1.0.1
com.apple.driver.AppleRTC	2.0
com.apple.driver.AppleACPIButtons	4.0
com.apple.driver.AppleHPET	1.8
com.apple.driver.AppleSMBIOS	2.1
com.apple.driver.AppleAPIC	1.7
com.apple.driver.AppleIntelCPUPowerManagementClient	218.0.0
com.apple.nke.applicationfirewall	163
com.apple.security.quarantine	3
com.apple.security.TMSafetyNet	8
com.apple.driver.AppleIntelCPUPowerManagement	218.0.0
com.apple.kext.triggers	1.0
com.apple.driver.AppleSMBusController	1.0.14d1
com.apple.iokit.IOSMBusFamily	1.1
com.apple.iokit.IOSerialFamily	11
com.apple.iokit.IOBluetoothFamily	4.4.4f4
com.apple.iokit.IOSurface	108.2.1
com.apple.driver.CoreCaptureResponder	1
com.apple.driver.X86PlatformPlugin	1.0.0
com.apple.driver.AppleSMC	3.1.9
com.apple.driver.IOPlatformPluginFamily	6.0.0d7
com.apple.iokit.IOSlowAdaptiveClockingFamily	1.0.0
com.apple.iokit.IOAcceleratorFamily2	205.3
com.apple.AppleGraphicsDeviceControl	3.12.6
com.apple.iokit.IONDRVSupport	2.4.1
com.apple.iokit.IOGraphicsFamily	2.4.1
com.apple.iokit.IOSCSIBlockCommandsDevice	3.7.7
com.apple.iokit.IOUSBMassStorageDriver	1.0.0
com.apple.iokit.IOSCSIArchitectureModelFamily	3.7.7
com.apple.driver.AppleUSBAudio	303.3.1
com.apple.iokit.IOUSBHIDDriver	900.4.1
com.apple.driver.usb.cdc	5.0.0
com.apple.driver.usb.networking	5.0.0
com.apple.driver.usb.AppleUSBHostCompositeDevice	1.0.1
com.apple.driver.usb.AppleUSBHub	1.0.1
com.apple.iokit.IO80211Family	1110.26
com.apple.iokit.IONetworkingFamily	3.2
com.apple.driver.corecapture	1.0.4
com.apple.iokit.IOUSBFamily	900.4.1
com.apple.driver.AppleEFINVRAM	2.0
com.apple.iokit.IOAudioFamily	204.3
com.apple.vecLib.kext	1.2.0
com.apple.iokit.IOAHCIFamily	2.8.1
com.apple.driver.usb.AppleUSBEHCI	1.0.1
com.apple.driver.usb.AppleUSBXHCIPCI	1.0.1
com.apple.driver.usb.AppleUSBXHCI	1.0.1
com.apple.iokit.IOUSBHostFamily	1.0.1
com.apple.driver.AppleUSBHostMergeProperties	1.0.1
com.apple.driver.AppleEFIRuntime	2.0
com.apple.iokit.IOHIDFamily	2.0.0
com.apple.security.sandbox	300.0
com.apple.kext.AppleMatch	1.0.0d1
com.apple.driver.AppleKeyStore	2
com.apple.driver.AppleMobileFileIntegrity	1.0.5
com.apple.driver.AppleCredentialManager	1.0
com.apple.driver.DiskImages	417.2
com.apple.iokit.IOStorageFamily	2.1
com.apple.iokit.IOReportFamily	31
com.apple.driver.AppleFDEKeyStore	28.30
com.apple.driver.AppleACPIPlatform	4.0
com.apple.iokit.IOPCIFamily	2.9
com.apple.iokit.IOACPIFamily	1.4
com.apple.kec.Libm	1
com.apple.kec.pthread	1
com.apple.kec.corecrypto	1.0
Model: iMac13,2, BootROM IM131.010A.B05, 4 processors, Intel Core i7, 3,5 GHz, 16 GB, SMC 2.11f14
Graphics: Intel HD Graphics 4000, Intel HD Graphics 4000, Built-In
Graphics: NVIDIA GeForce GTX 760, NVIDIA GeForce GTX 760, PCIe, 2047 MB
Memory Module: BANK0/DIMM1, 8 GB, DDR3, 2133 MHz, Geil, CL10-11-11D3-2133
Memory Module: BANK1/DIMM1, 8 GB, DDR3, 2133 MHz, Geil, CL10-11-11D3-2133
AirPort: spairport_wireless_card_type_airport_extreme (0x168C, 0x8F), Atheros 9287: 4.0.74.0-P2P
Network Service: Ethernet, Ethernet, en2
Serial ATA Device: OCZ-VERTEX4, 256,06 GB
Serial ATA Device: ST2000DL003-9VT166, 2 TB
Serial ATA Device: ST9750420AS, 750,16 GB
Serial ATA Device: ST9750420AS, 750,16 GB
USB Device: USB 2.0 Bus
USB Device: Hub
USB Device: Mass Storage Device
USB Device: USB 2.0 Bus
USB Device: Hub
USB Device: USB Keyboard
USB Device: Composite Device
USB Device: USB 3.0 Bus
USB Device: Hub
USB Device: Hub
USB Device: Monitor Webcam
USB Device: G500
Thunderbolt Bus: 

Link to comment
Share on other sites

 

Hello and thank you for your hard work. Your kext is great except this occasional KP upon going to sleep (possibly, when the network is under heavy load, but cannot be sure)

 

here is the log:

First, the system isn't going to sleep when there is heavy network load. Second, I haven't seen a single sleep/wake related kernel panic with my drivers for years which wasn't the result of a broken DSDT. Either way you need to patch it or one of the patches you applied is incorrect.

 

Mieze

Link to comment
Share on other sites

Would you have any ideas as to why an onboard 8111C on a EP45-UD3P would be stuttering with both the 2.0 and 2.2.1d3?  Just installed 10.11, and had only been on 10.6 before that.  Its obviously legacy, but I'm surprised.  I can run a diagnostic if its helpful.  Network transfers happen in short spurts (for instance 8.4 MB), as does any type of streaming.  Share drives get dropped quickly, and file transfers tend to break.

 

Strangely, the Lnx2Mac 0.9 kext seems to work, but I hope to figure this out,  and go with the more up-to-date solution.

Thanks so much.

Link to comment
Share on other sites

Would you have any ideas as to why an onboard 8111C on a EP45-UD3P would be stuttering with both the 2.0 and 2.2.1d3?  Just installed 10.11, and had only been on 10.6 before that.  Its obviously legacy, but I'm surprised.  I can run a diagnostic if its helpful.  Network transfers happen in short spurts (for instance 8.4 MB), as does any type of streaming.  Share drives get dropped quickly, and file transfers tend to break.

 

Strangely, the Lnx2Mac 0.9 kext seems to work, but I hope to figure this out,  and go with the more up-to-date solution.

Thanks so much.

This topic has been discussed in detail a few weeks ago in this thread. If I had the time, I would take a look at it but I'm already overworked and I'm spending much more time on my hackintosh projects than I should. Sorry!

 

Mieze

  • Like 2
Link to comment
Share on other sites

.........

 

The official Apple RTL8169 driver was tested.  This driver actually performed very well, about 5% better then v2.2.1d3.  However it used at least double the CPU and furthermore it did not use all 4 cores of my machine evenly. (note, some of that could be related to the way iperf3 works)

...........

What means "official Apple RTL8169 driver" (last in 10.6.8)?

My 8111C have terrible "out" speed (5Mbit). "In" speed - 1Gb.  2.2.1 Driver

 

04:00.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller [10ec:8168] (rev 02) (subsys 1458:e000)

Link to comment
Share on other sites

There is an 8169 driver floating around and my understanding is that this was made by Apple somewhere along the line, but I don't know how up to date it is.  Here is one instance of it, but I don't know if this is the most up to date version, it very well might be:

 

http://www.insanelymac.com/forum/topic/297277-realtek-rtl81698110-driver/

This driver was made for 10.7 by Realtek, not Apple, and it hasn't been update since 2011. Please see: http://www.realtek.com.tw/downloads/downloadsView.aspx?Langid=1&PNid=13&PFid=5&Level=5&Conn=4&DownTypeID=3&GetDown=false

 

Mieze

Link to comment
Share on other sites

Anyway, your driver is better Mieze!  

 

I was just providing whatever info I could find about it since someone asked.  The one I tested is packaged with [url="http://www.insanelymac.com/forum/topic/279450-why-insanelymac-does-not-support-tonymacx86/"]#####[/url]...not sure if that's the same one..  We're not supposed to mention that tool around here apparently.  Its probably found in numerous places.  its definitely pretty fast, but hard on the CPU.

Link to comment
Share on other sites

This driver was made for 10.7 by Realtek, not Apple, and it hasn't been update since 2011. Please see: http://www.realtek.com.tw/downloads/downloadsView.aspx?Langid=1&PNid=13&PFid=5&Level=5&Conn=4&DownTypeID=3&GetDown=false

 

Mieze

 

This driver (10.7 by Realtek) have best speed on 1Gb link but It causes  to reboot the computer under high load (SMB, AFP, 1GbLink) in El Capitan. =(

Driver from Mieze 100% stable but It has abnormal "behavior" while "Upload" files on 8111C (slow 3-10 Mbit upload and freeze for some time in this moment)

Link to comment
Share on other sites

This driver (10.7 by Realtek) have best speed on 1Gb link but It causes  to reboot the computer under high load (SMB, AFP, 1GbLink) in El Capitan. =(

Driver from Mieze 100% stable but It has abnormal "behavior" while "Upload" files on 8111C (slow 3-10 Mbit upload and freeze for some time in this moment)

Try to disable TSO in the driver's Info.plist (see post#1). This helps in case the machine on the other side can't cope with it. If it doesn't help, fix your machine (interrupt handling, power management, etc.).

 

Mieze

  • Like 1
Link to comment
Share on other sites

Try to disable TSO in the driver's Info.plist (see post#1). This helps in case the machine on the other side can't cope with it. If it doesn't help, fix your machine (interrupt handling, power management, etc.).

 

Mieze

TY!!!!

TSO4 off, TSO6 off.... all ok! (but the increased CPU load, what expected....)

TSO4 on,  TSO6 off - don’t work

TSO4 off, TSO6 on - all ok!

 

What is wrong with TSO4?

This is hardware problem RTL8111C?

Link to comment
Share on other sites

TY!!!!

TSO4 off, TSO6 off.... all ok! (but the increased CPU load, what expected....)

TSO4 on,  TSO6 off - don’t work

TSO4 off, TSO6 on - all ok!

 

What is wrong with TSO4?

This is hardware problem RTL8111C?

In principle there is nothing wrong with TSO and the Realtek NIC, but it might interfere with certain features of TCP on machines with a bad configuration. The problem is located on the target machine which doesn't cope with it and slows down communication.

 

Mieze 

  • Like 2
Link to comment
Share on other sites

In principle there is nothing wrong with TSO and the Realtek NIC, but it might interfere with certain features of TCP on machines with a bad configuration. The problem is located on the target machine which doesn't cope with it and slows down communication.

 

Mieze 

Target machine my Linux NAS.

I understand. But I had a problem with internet speed test. With TSO4 on - 100 download and 10 upload. (TSO4 off 100/100)

 

Anyway, thank you. Problem solved. I wrote, because it might be interesting for you. Sorry for wasting your time. )

Link to comment
Share on other sites

Target machine my Linux NAS.

I understand. But I had a problem with internet speed test. With TSO4 on - 100 download and 10 upload. (TSO4 off 100/100)

 

Anyway, thank you. Problem solved. I wrote, because it might be interesting for you. Sorry for wasting your time. )

 

What Mieze is saying is that there might be something wrong with the network config on your linux NAS.  I get gigabit in both directions between my hackintosh and my readynas linux NAS using this driver and no tweaks to the Info.plist.  If your linux NAS is not able to receive the incoming data, then it will slow down your outbound performance from your 8111.  

 

If you're trying to do your test by writing to the HDD on the linux NAS, that could also effect performance.  I recommend you use iperf3 for testing because it eliminates disk i/o from the equation.  linux NAS can also have limited cpu  capability, which might impact its ability to process incoming data fast enough to keep up with gigabit.

Link to comment
Share on other sites

What Mieze is saying is that there might be something wrong with the network config on your linux NAS.  I get gigabit in both directions between my hackintosh and my readynas linux NAS using this driver and no tweaks to the Info.plist.  If your linux NAS is not able to receive the incoming data, then it will slow down your outbound performance from your 8111.  

 

If you're trying to do your test by writing to the HDD on the linux NAS, that could also effect performance.  I recommend you use iperf3 for testing because it eliminates disk i/o from the equation.  linux NAS can also have limited cpu  capability, which might impact its ability to process incoming data fast enough to keep up with gigabit.

I understand. But I had a problem with internet speed test. With TSO4 on - 100 download and 10 upload. (TSO4 off 100/100)

I noticed that all who have problems with the speed use 8111C. 

Link to comment
Share on other sites

×
×
  • Create New...