Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Realtek device driver update

    Scheduled Pinned Locked Moved
    Hardware
    10
    44
    11.0k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • V
      VAMike
      last edited by

      @Harvy66:

      Driver support is a FreeBSD issue, not pfSense. "perform fine on many OSs" is subjective. I've had to deal with many Realtek NICs over the years and while they may stream Netflix fine, if you try to remotely approach 1Gb speeds, you will seriously hose the computer. The best Realtek I've seen managed to get my Intel i5 quad core to about 70% cpu(90k interrupts per second) usage while only peaking about 1.4Gb/s. Compare that to my Intel i210 NICs that are getting 1.9Gb/s+ while hanging out around 1-5% cpu(3k interrupts per second). These tests were done in Windows where Realtek has the best driver support.

      Well, that doesn't match my experience. Since "realtek network card" details basically nothing about the chipset in question, I can't comment more than that.

      1 Reply Last reply Reply Quote 0
      • ?
        Guest
        last edited by

        @VAMike:

        @Harvy66:

        Driver support is a FreeBSD issue, not pfSense. "perform fine on many OSs" is subjective. I've had to deal with many Realtek NICs over the years and while they may stream Netflix fine, if you try to remotely approach 1Gb speeds, you will seriously hose the computer. The best Realtek I've seen managed to get my Intel i5 quad core to about 70% cpu(90k interrupts per second) usage while only peaking about 1.4Gb/s. Compare that to my Intel i210 NICs that are getting 1.9Gb/s+ while hanging out around 1-5% cpu(3k interrupts per second). These tests were done in Windows where Realtek has the best driver support.

        Well, that doesn't match my experience. Since "realtek network card" details basically nothing about the chipset in question, I can't comment more than that.

        In my experience the 8169, 8188 and 8111 were all pretty bad under load on Windows, Linux, MacOS and BSD. There are a few more chips but those are the ones that stood out to me. They are of course not as bad as the Nvidia nForce/MCP or Atheros L2 and L1 chips.

        1 Reply Last reply Reply Quote 0
        • V
          VAMike
          last edited by

          @johnkeates:

          @VAMike:

          @Harvy66:

          Driver support is a FreeBSD issue, not pfSense. "perform fine on many OSs" is subjective. I've had to deal with many Realtek NICs over the years and while they may stream Netflix fine, if you try to remotely approach 1Gb speeds, you will seriously hose the computer. The best Realtek I've seen managed to get my Intel i5 quad core to about 70% cpu(90k interrupts per second) usage while only peaking about 1.4Gb/s. Compare that to my Intel i210 NICs that are getting 1.9Gb/s+ while hanging out around 1-5% cpu(3k interrupts per second). These tests were done in Windows where Realtek has the best driver support.

          Well, that doesn't match my experience. Since "realtek network card" details basically nothing about the chipset in question, I can't comment more than that.

          In my experience the 8169, 8188 and 8111 were all pretty bad under load on Windows, Linux, MacOS and BSD. There are a few more chips but those are the ones that stood out to me. They are of course not as bad as the Nvidia nForce/MCP or Atheros L2 and L1 chips.

          The numbers also don't particularly mean anything (they basically indicate the attachment type). The letters indicate what level of functionality is implemented. It's somewhat opaque, but honestly much easier to get a clear explanation of than intel's naming mess. (Quick: what's the difference between an i219-LM, an i219-V, an i211, an i350, an x520, and an x710? And that's probably about 10% of intel's current part list.)

          Just to throw out some actual data, the only rtl I have online at the moment is an 8111G on a N3150 (1.6GHz braswell/atom). It hits about 1.86Gbps with a few hundred interrupts per second on linux–and that interface happens to be a on a software bridge, which probably impacts the performance a bit.

          1 Reply Last reply Reply Quote 0
          • C
            chrcoluk
            last edited by

            I think this is for FreeBSD not pfSense to fix.

            For whatever reason FreeBSD does not implement the latest realtek driver, which has been shown time and time again to fix issues on realtek hardware (check the FreeBSD forums and mailing lists).

            It is possible no one has ever done a PR to get the driver updated, I havent checked that.

            Realtek hardware is adequate on windows for home and light business environments,, the issue on FreeBSD is the driver.

            If you not willing to update the driver, I highly recommend disabling checksum offloading for realtek hardware to resolve various issues, this doesnt solve everything on realtek but fixes about 90% of observed issues I have seen over the past decade or so.  Since realtek has no interrupt moderation feature, one option to also consider is enabling polling, which will moderate the interrupts OS side.

            pfSense CE 2.7.2

            1 Reply Last reply Reply Quote 0
            • ?
              Guest
              last edited by

              @chrcoluk:

              I think this is for FreeBSD not pfSense to fix.

              For whatever reason FreeBSD does not implement the latest realtek driver, which has been shown time and time again to fix issues on realtek hardware (check the FreeBSD forums and mailing lists).

              It is possible no one has ever done a PR to get the driver updated, I havent checked that.

              Realtek hardware is adequate on windows for home and light business environments,, the issue on FreeBSD is the driver.

              If you not willing to update the driver, I highly recommend disabling checksum offloading for realtek hardware to resolve various issues, this doesnt solve everything on realtek but fixes about 90% of observed issues I have seen over the past decade or so.  Since realtek has no interrupt moderation feature, one option to also consider is enabling polling, which will moderate the interrupts OS side.

              Polling is no longer available in 2.4 as only legacy and broken hardware used to profit from that.

              1 Reply Last reply Reply Quote 0
              • C
                chrcoluk
                last edited by

                polling works as I tested it, but yeah I did my own custom kernel with it available and had to be configured in the terminal not GUI.

                Thanks for clarifying its no longer officially supported.

                pfSense CE 2.7.2

                1 Reply Last reply Reply Quote 0
                • ?
                  Guest
                  last edited by

                  @chrcoluk:

                  polling works as I tested it.

                  Well, it's not in the GUI is what I meant.

                  1 Reply Last reply Reply Quote 0
                  • C
                    chrcoluk
                    last edited by

                    Sorry I updated my reply now as you replied again.

                    On 2.4.1 and newer tho the pfSense kernel is no longer in a public repo (or at least wasnt a month or so ago) so a custom kernel now no longer is possible, when I enabled it was on 2.4 dev.

                    pfSense CE 2.7.2

                    1 Reply Last reply Reply Quote 0
                    • ?
                      Guest
                      last edited by

                      @TheNarc:

                      I've been running successfully with Realtek NICs for a long time now using Realtek's official driver compiled and loaded as a module.

                      @TheNarc: Any chance you would have a step-by-step about how to compile the driver and the tools' setup? I gave a try but ran into lots of warnings and errors and the compilation failed. I might not have had the right compiler. FreeBSD 11.1 continues to be a challenge for me.

                      1 Reply Last reply Reply Quote 0
                      • T
                        TheNarc
                        last edited by

                        Yeah I'll try to do this when I get a chance.  I just want to make sure I can give it the effort it deserves, because there are a good number of steps involved and I won't be doing anyone any favors if I try to slap something together quickly that glosses over or omits certain things :)  I've always done it in Virtualbox too, which simplifies some things but complicates others.  For example, in my case the path of least resistance for getting the compiled driver off the FreeBSD VM was to SCP it to a Linux machine on the same network running SSH.  But that's not going to be the path of least resistance for most setups, probably.  Anyway, yes, I will try to remember to do this, it just may not be in the very near future . . .

                        1 Reply Last reply Reply Quote 0
                        • K
                          Kyraksi
                          last edited by

                          @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.

                          1 Reply Last reply Reply Quote 0
                          • T
                            TheNarc
                            last edited by

                            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

                            1 Reply Last reply Reply Quote 0
                            • S
                              sdf_iain
                              last edited by

                              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.

                              T J 2 Replies Last reply Reply Quote 0
                              • T
                                TheNarc @sdf_iain
                                last edited by

                                @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"?

                                1 Reply Last reply Reply Quote 0
                                • S
                                  sdf_iain
                                  last edited by

                                  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.

                                  1 Reply Last reply Reply Quote 0
                                  • stephenw10S
                                    stephenw10 Netgate Administrator
                                    last edited by

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

                                    Is that kernel module loading something different?

                                    Steve

                                    S 1 Reply Last reply Reply Quote 0
                                    • S
                                      sdf_iain @stephenw10
                                      last edited by sdf_iain

                                      @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.

                                      1 Reply Last reply Reply Quote 0
                                      • stephenw10S
                                        stephenw10 Netgate Administrator
                                        last edited by

                                        Are you testing that in 2.5 I assume?

                                        S 1 Reply Last reply Reply Quote 0
                                        • S
                                          sdf_iain @stephenw10
                                          last edited by

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

                                          1 Reply Last reply Reply Quote 0
                                          • stephenw10S
                                            stephenw10 Netgate Administrator
                                            last edited by

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

                                            S 1 Reply Last reply Reply Quote 0
                                            • S
                                              sdf_iain @stephenw10
                                              last edited by

                                              @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.

                                              1 Reply Last reply Reply Quote 1
                                              • stephenw10S
                                                stephenw10 Netgate Administrator
                                                last edited by

                                                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

                                                1 Reply Last reply Reply Quote 0
                                                • S
                                                  sdf_iain
                                                  last edited by

                                                  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

                                                  1 Reply Last reply Reply Quote 1
                                                  • J
                                                    Jiffyjeeff
                                                    last edited by

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

                                                    1 Reply Last reply Reply Quote 0
                                                    • stephenw10S
                                                      stephenw10 Netgate Administrator
                                                      last edited by

                                                      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

                                                      1 Reply Last reply Reply Quote 0
                                                      • J
                                                        Jiffyjeeff
                                                        last edited by

                                                        Ok thanks.

                                                        Looks like it's off by default?

                                                        1 Reply Last reply Reply Quote 0
                                                        • stephenw10S
                                                          stephenw10 Netgate Administrator
                                                          last edited by

                                                          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

                                                          1 Reply Last reply Reply Quote 0
                                                          • J
                                                            Jiffyjeeff
                                                            last edited by

                                                            @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!

                                                            S 1 Reply Last reply Reply Quote 1
                                                            • S
                                                              sdf_iain @Jiffyjeeff
                                                              last edited by

                                                              @Jiffyjeeff Can you quantify "great performance"?

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

                                                              J 1 Reply Last reply Reply Quote 0
                                                              • J
                                                                Jiffyjeeff @sdf_iain
                                                                last edited by

                                                                @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.

                                                                J 1 Reply Last reply Reply Quote 1
                                                                • J
                                                                  jshoe @sdf_iain
                                                                  last edited by

                                                                  This post is deleted!
                                                                  1 Reply Last reply Reply Quote 0
                                                                  • J
                                                                    Jiffyjeeff @Jiffyjeeff
                                                                    last edited by

                                                                    @jiffyjeeff

                                                                    I resolved my issue by using a different switch that was 2.5gbps capable.

                                                                    J 1 Reply Last reply Reply Quote 0
                                                                    • J
                                                                      jshoe @Jiffyjeeff
                                                                      last edited by

                                                                      @jiffyjeeff That's not possible for me right now. I updated the drivers using the method above and will wait to see what happens. Is the method above the correct way to update the drivers? Why is the repository blocked by default? In other instructions I've read they skip the editing the two files commenting out the code. Another post I read someone ran a single command and it supposedly updated the driver. I will put up the links when I get a chance.

                                                                      J 1 Reply Last reply Reply Quote 0
                                                                      • J
                                                                        Jiffyjeeff @jshoe
                                                                        last edited by

                                                                        @jshoe I believe the driver should be apart of the freebsd version pfsens 2.5.2 is built on? Is the realtek driver not loading? have you checked dmesg in the command prompt?

                                                                        J 1 Reply Last reply Reply Quote 0
                                                                        • J
                                                                          jshoe @Jiffyjeeff
                                                                          last edited by

                                                                          @jiffyjeeff I have the newest version and a version number wasn't listed until after I used the method above. I read many people have this issue with the builtin driver. Do you know any of the answers to what I asked by chance?

                                                                          1 Reply Last reply Reply Quote 0
                                                                          • stephenw10S
                                                                            stephenw10 Netgate Administrator
                                                                            last edited by

                                                                            In 2.5.2 just do this: https://forum.netgate.com/post/962889

                                                                            Steve

                                                                            J 1 Reply Last reply Reply Quote 0
                                                                            • J
                                                                              jshoe @stephenw10
                                                                              last edited by jshoe

                                                                              @stephenw10 I started a new post since this is so old.

                                                                              https://forum.netgate.com/topic/167257/realtek-network-card-packet-loss

                                                                              I will try this but I already performed the steps above in this post. It says all packages are up to date.

                                                                              Thanks

                                                                              1 Reply Last reply Reply Quote 0
                                                                              • First post
                                                                                Last post

                                                                              Looks like your connection to Netgate Forum was lost, please wait while we try to reconnect.