Realtek device driver update



  • @TheNarc:

    For example, when 2.4.0 became available, before upgrading I recompiled the Realtek driver on a FreeBSD 11.1 machine and uploaded it to /boot/kernel/ on my pfSense machine.  Then I applied the 2.4.0 pfSense upgrade.  And that's all I had to do, if I recall correctly.  I don't think the 2.4.0 upgrade even removed the if_re_load="YES" from /boot/loader.conf.local that is needed to use the compiled Realtek driver instead of the one built into the kernel.

    I think the main takeaway is that using this compiled Realtek driver is not officially supported by Netgate/pfSense, so it's very much buyer beware.  But my experience has been good so far, and I think it's reasonable to assume - though there's no guarantee - that the current v1.94 Realtek driver which I compiled under FreeBSD 11.1 should work for all FreeBSD 11.x releases, but that a recompilation will be required for the first version of pfSense based on FreeBSD 12.x.

    Thank you!

    Just some thinks to mention, the 1.94 driver you posted works fine with CI327. However, I needed to put in following lines:
    hw.pci.enable_msix="1"
    hw.re.msi_disable="1"

    Without msix re1 wouldnt work. No single packet captured from that interface with tcpdump.



  • With regard to a write-up on how to compile this Realtek driver, user jovimon made a great one:
    https://forum.pfsense.org/index.php?topic=103841.msg775568#msg775568

    Here's a direct link to it as well:
    https://gist.github.com/jovimon/524e116471f249626fd2ccd141f3fe05



  • I have an alternate method to install this driver using only your pfSense instance:

    1. Edit two files using "Diagnostics" > "Edit File":
    • /usr/local/etc/pkg/repos/FreeBSD.conf
    • /usr/local/etc/pkg/repos/pfSense.conf
      Change FreeBSD {enabled: no} to #FreeBSD {enabled: no}, this comments out these lines and enables the FreeBSD repository.
    1. Run the following commands in "Diagnostics" > "Command Prompt":
    • pkg update -r FreeBSD
    • pkg install -y realtek-re-kmod
    1. Re-Disable the FreeBSD Repositories (undo the change in step 1), netgate has them disabled for a reason
    2. Edit /boot/loader.conf.local using "Diagnostics" > "Edit File":
    if_re_load="YES"
    if_re_name="/boot/modules/if_re.ko"
    
    1. Reboot your firewall
    2. Run dmesg using "Diagnostics" > "Command Prompt" and search for your interfaces in the output to verify the version

    The RealTek RealTek Driver with some enhancements has made it into the FreeBSD repos.



  • @sdf_iain Thanks for this information. Do you happen to know whether this is the latest (v1.96) driver? Also, are any details available with respect to the "enhancements"?



  • It is the 1.96 driver, but I don't know what all changes have been made.

    I'm not sure what the exact differences are, but the source is here if you want to try to compare.

    Looks like it might take a bit to compare the two files and see what the exact differences are (mostly because the order of things is different). If I had to guess I'd say the RealTek driver's changes are incorporated into the FreeBSD version of the driver, but that's a guess. diff shows that the order of things (methods, imports, variables) is different.


  • Netgate Administrator

    That source appears to be for the standard FreeBSD driver, that's built into pfSense anyway.

    Is that kernel module loading something different?

    Steve



  • @stephenw10
    My mistake that kernel module SAYS it's the 1.96_04 version from RealTek

    I linked the wrong source, here's the link to the module in ports:
    https://svnweb.freebsd.org/ports/head/net/realtek-re-kmod/

    I have to admit that I do not know how that patch file is applied.

    EDIT:
    A quick dig into the Makefiles seems to imply that the driver is downloaded (from a FreeBSD Cache), then updated using the patch file, and finally built.


  • Netgate Administrator

    Are you testing that in 2.5 I assume?



  • @stephenw10
    2.4.5-RELEASE-p1, the RealTek RealTek driver is generally required for stability.


  • Netgate Administrator

    Hmm, interesting that pkg only appeared to exist in head.....



  • @stephenw10
    Its a very new package. If pfSense was configured to track quarterly instead latest in /etc/pkg/FreeBSD.conf, then the package wouldn't be visible.

    It is possible that it will show up in the branch 2020Q4, when that gets created.


  • Netgate Administrator

    Yeah that would be it. Nice.

    The package should still be install-able via 'pkg add' directly if you have the location. Which is generally better that changing the repo.

    Steve



  • Running a single command replaces steps 1 through 3 that I listed above:
    pkg add https://pkg.FreeBSD.org/FreeBSD:11:amd64/latest/All/realtek-re-kmod-v196.04_2.txz



  • Do you guys know how to turn off Flow Control in this driver for re0 ?


  • Netgate Administrator

    It's a media option so you select it from the connection drop down but it normally does not connect with flowcontrol:

    re1: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
    	description: WAN
    	options=82098<VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,WOL_MAGIC,LINKSTATE>
    	capabilities=18399b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,TSO4,WOL_UCAST,WOL_MCAST,WOL_MAGIC,LINKSTATE,NETMAP>
    	ether 00:0d:b9:37:30:11
    	inet6 fe80::20d:b9ff:fe37:3011%re1 prefixlen 64 scopeid 0x2
    	inet 172.21.16.35 netmask 0xffffff00 broadcast 172.21.16.255
    	media: Ethernet autoselect (1000baseT <full-duplex>)
    	status: active
    	supported media:
    		media autoselect mediaopt flowcontrol
    		media autoselect
    		media 1000baseT mediaopt full-duplex,flowcontrol,master
    		media 1000baseT mediaopt full-duplex,flowcontrol
    		media 1000baseT mediaopt full-duplex,master
    		media 1000baseT mediaopt full-duplex
    		media 1000baseT mediaopt master
    		media 1000baseT
    		media 100baseTX mediaopt full-duplex,flowcontrol
    		media 100baseTX mediaopt full-duplex
    		media 100baseTX
    		media 10baseT/UTP mediaopt full-duplex,flowcontrol
    		media 10baseT/UTP mediaopt full-duplex
    		media 10baseT/UTP
    		media none
    	nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
    

    Steve



  • Ok thanks.

    Looks like it's off by default?


  • Netgate Administrator

    Yes, looks that way. It's certainly off on everything I can check.
    You would have to select 'autoselect flowcontrol' in the interface speed/duplex setting to enable it.

    Steve



  • @stephenw10 said in Realtek device driver update:

    'autoselect flowcontrol'

    'autoselect flowcontrol' doesn't even show up on the drop list. It's currently set to "media 1000baseT full-duplex"

    I'm getting great performance with this driver!



  • @Jiffyjeeff Can you quantify "great performance"?

    I get 600-700 mbps (which is good enough for me).



  • @sdf_iain

    I have this realtek 2.5gbps nic based on the 8125 chip connected to my cable modem's 1gbps wan port. using a short 2ft Cat 8 cable I get 900 to 940 i'm on 1gb plan. Waiting to get one of the new cable modems with the 2.5gbps port. My latency is low between 15-16ms on speed test.


Log in to reply