Realtek RTL8125/8126/8127 new driver 2.5/5/10GBE

brnrd

Developer
Hi all,

Work is underway to add the OpenBSD driver for Realtek RTL8125/8126/8127 to FreeBSD base (in -HEAD).
See thread in https://lists.freebsd.org/archives/freebsd-current/2025-November/009481.html

This new driver works for me (both versions of realtek-re-kmod repeatedly crash my system) and some other people.
With sufficient testing in 15.0 (and perhaps 14.3) we may get the driver backported to these versions.

For testing, I created the net/realtek-rge-kmod port.

https://www.freshports.org/net/realtek-rge-kmod/

Feedback that it works is helpful, as is reporting issues with the if_rge driver.
The port should show up in the FreeBSD-ports-kmod pkg repo for 14 and 15 soon.

Cheers, Bernard.
 
Don't have that hardware myself, so cannot test. But this is going to make a whole bunch of people very happy.

With sufficient testing in 15.0 (and perhaps 14.3) we may get the driver backported to these versions.
By that I presume you mean backported to stable/14 and stable/15, so they'll be included in 14.4 and 15.1 when the time comes.

(Moving this to "Networking", I've put other network driver issues there too, can't do much networking without a working driver)
(Edit: stickied the post too)
 
Seems to work on the ASROCK TRX50 motherboard. using 15-stable
with 1 x 2.5 Gigabit LAN 10/100/1000/2500 Mb/s (Dragon RTL8125BG) chipset.
Switch is Cisco 1 Gbit so no high 2.5 Gbit test possible

Code:
rge0: flags=1008843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST,LOWER_UP> metric 0 mtu 1500
        options=9b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM>
        ether 9c:6b:00:a8:af:18
        inet 192.168.XXX.XXX  netmask 0xffffff00 broadcast 192.168.XXX.255
        media: Ethernet autoselect (1000baseT <full-duplex>)
        status: active
        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
 
Don't have that hardware myself, so cannot test. But this is going to make a whole bunch of people very happy.


By that I presume you mean backported to stable/14 and stable/15, so they'll be included in 14.4 and 15.1 when the time comes.

(Moving this to "Networking", I've put other network driver issues there too, can't do much networking without a working driver)
(Edit: stickied the post too)
Thanks!

Not sure what Adrian's plans are. He mentioned "short lived port" which I'm very much in favor of! Please check mailinglist thread for more info.
 
Note that FreshPorts' /net/realtek-rge-kmod will not display packages in the 'kmods' repositories, only the 'default' ones. (dvl@ , Dan Langille has that in the works, I don't know its current status.)

With respect to the 'kmods', when having been build remotely sucessfully and distributed, I'll be expecting it to appear in the repositories of the ports tree:
  1. FreeBSD-kmods for stable/14 and 14.3-RELEASE
  2. FreeBSD-ports-kmods for stable/15 and 15.0-RELEASE

However, if past is prologue, it may well appear too (and possibly even sooner) in the 'default' repositories of the ports tree:
  1. FreeBSD for stable/14 and 14.3-RELEASE
  2. FreeBSD-ports for stable/15 and 15.0-RELEASE
Such as is the case with the 'established' realtek drivers:
Rich (BB code):
[1-0] # pkg rquery -e '%n~realtek-r*' '[%R] %n %v' | column -t
[FreeBSD-ports]        realtek-re-kmod     1101.00.1500068
[FreeBSD-ports]        realtek-re-kmod198  198.00.1500068
[FreeBSD-ports-kmods]  realtek-re-kmod     1101.00.1500068
[FreeBSD-ports-kmods]  realtek-re-kmod198  198.00.1500068

Edit: given the normal practices, the package will not appear in quarterly, only in latest for now. With a new quarter, in about a month, I'm expecting it to appear in quarterly too.
 
Not sure what Adrian's plans are.
Us dyed-in-the-wool FreeBSD users and developers will know, but new users regularly have trouble understanding how the FreeBSD development process works. I was trying to say it won't be added to the existing releases. Once a version has been released (X.Y-RELEASE) responsibility is handed over to the security officer. And they only accept security or errata (significant breakages), never new features, drivers or anything of that order.
 
Now available as a package.

This is 14.3-RELEASE using "latest":
Rich (BB code):
[0-0] # date -u
Wed Dec  3 18:35:57 UTC 2025
[1-0] # pkg rquery -e '%n~realtek-r*' '[%R] %n %v' | column -t
[FreeBSD]        realtek-re-kmod     1101.00.1403000
[FreeBSD]        realtek-re-kmod198  198.00.1403000
[FreeBSD-kmods]  realtek-re-kmod     1101.00.1403000
[FreeBSD-kmods]  realtek-re-kmod198  198.00.1403000
[FreeBSD-kmods]  realtek-rge-kmod    20251129.1403000

This is on 15.0-RELEASE using "latest"
Rich (BB code):
[1-0] # pkg rquery -e '%n~realtek-r*' '[%R] %n %v'|column -t
[FreeBSD-ports]        realtek-re-kmod     1101.00.1500068
[FreeBSD-ports]        realtek-re-kmod198  198.00.1500068
[FreeBSD-ports-kmods]  realtek-re-kmod     1101.00.1500068
[FreeBSD-ports-kmods]  realtek-re-kmod198  198.00.1500068
[FreeBSD-ports-kmods]  realtek-rge-kmod    20251129.1500068
 
With sufficient testing in 15.0 (and perhaps 14.3) [...]
Is this experimental version not capable or not intended to be run on a 13 branch?

I'm not an expert in Makefiles and therefore I might very well be overlooking the obvious, but in the Makefile and in its package description I don't see it specifically being specified or mentioned that it is not for the 13 branch:
Code:
 # pkg inf -D realtek-rge-kmod
realtek-rge-kmod-20251129.1403000:
On install:
!!! This port is EXPERIMENTAL !!!

Add the following lines to your /boot/loader.conf
to load the FreeBSD rge(4) driver.

if_rge_load="YES"

On upgrade:
!!! This port is EXPERIMENTAL !!!

Add the following lines to your /boot/loader.conf
to load the FreeBSD rge(4) driver.

if_rge_load="YES"

Also users might try to build it when running a 13 branch version.

Note that allthough this is a 'kmods' driver package, as you can see abvove the 'established' realtek 'kmods' driver packages do also appear in the 'default' package repository, i.e. FreeBSD and FreeBSD-ports.
 
Feedback that it works is helpful
Works perfectly and unnoticed so far; however, I also had no problems with the previous realtek-re-kmod. Mainboard ASRock "B650M-H/M.2+" (should have Realtek RTL8111H which is recognized as RTL8125).
 
Likewise, both work fine for me, re and rge. Freebsd 15-stable. In terms of preformance for general desktop usage I don't notice any difference but my link is limited to 200mbps on average.
 
What a day to read this. I published an article about the driver(s) issue with Realtek RTL8125 exactly on this day a year ago. Back then, it was necessary to fetch an alternative driver and rename it, so it could be loaded during boot.
 
Now I noticed a difference: bhyve & VNC. The handbook says to set "tcp=0.0.0.0:5900", and you can then access 0.0.0.0:5900 via VNC. This no longer works with realtek-rge-kmod, but it did work with realtek-re-kmod (also my prior network chips without any special driver). I have no idea what special features the IP 0.0.0.0 has, but it seems to be treated differently. If I set a real IP of that computer, VNC access works again.
 
To update this the initial driver has been imported to -current and enabled in the amd64 GENERIC kernel as a start. Testing and feedback would be great.
 
I want to try it but there is currently no snapshot of the main tree since December 29th ...
I installed that snapshot and updated it; it looks like the new driver is available through pkg:
Code:
root@Alira:~ # uname -aKU
FreeBSD Alira 16.0-CURRENT FreeBSD 16.0-CURRENT main-n283021-01c0005dced1 GENERIC-NODEBUG amd64 1600007 1600007
root@Alira:~ # pkg search realtek-rge-kmod
realtek-rge-kmod-20251211.1600007 EXPERIMENTAL Kernel module for Realtek 8125/8126/8217 network cards
realtek-rge-kmod-20251211.1600007 EXPERIMENTAL Kernel module for Realtek 8125/8126/8217 network cards
 
To update this the initial driver has been imported to -current and enabled in the amd64 GENERIC kernel as a start. Testing and feedback would be great.
I have no idea what this means: search for if_rge.ko shows it is not present in -CURRENT, and this kernel module is what is contained in the ports tree.
EDIT: now I have!

The latest source code realtek-rge-kmod in the ports tree has not changed since 2025-12-13, net/realtek-rge-kmod: Use IGNORE_FreeBSD*

I want to try it but there is currently no snapshot of the main tree since December 29th ...
Therefore I suggest, after updating the source from the ports tree, built it locally; it builds on my 14.3-RELEASE (I don't have this nic though). It seems that, as Espionage724 mentioned, it happens to be already available as a package for -CURRENT. I expect the remotely available package will be appear for the 14 and the 15 branch soon.

___
*
Is this experimental version not capable or not intended to be run on a 13 branch?
The entire 13 major branch will be EoL in a few months (April 2026).
This commit, dated 2025-12-13, added the (most clear) blocking of the build on FreeBSD 13:
Code:
+IGNORE_FreeBSD_13=	Does not build on FreeBSD <=13
 
Code:
$ w3m -cols 200 -dump https://cgit.freebsd.org/src/log/sys/dev/rge
path: root/sys/dev/rge

                 Commit message (Expand)                     Author         Age     Files    Lines
* if_rge: sync with up to date OpenBSD code              Brad Smith      4 days     5     -7349/+3779
* if_rge: Add PNP info for module                        Olivier Cochard 2025-12-16 1     -0/+2
* if_rge: initial import of if_rge driver from OpenBSD.  Adrian Chadd    2025-12-15 12    -0/+19229
Code:
$ w3m -dump https://cgit.freebsd.org/src/tree/sys/modules/rge/Makefile
path: root/sys/modules/rge/Makefile
blob: 2f8c0b20bfa16f88928eb2a8a48129c9cedf9f8c (plain) (blame)

1 .PATH: ${SRCTOP}/sys/dev/rge
2
3 KMOD=   if_rge
4 SRCS=   if_rge.c if_rge_hw.c if_rge_stats.c if_rge_sysctl.c
5 SRCS+=  device_if.h bus_if.h pci_if.h
6
7 .include <bsd.kmod.mk>
 
I installed that snapshot and updated it; it looks like the new driver is available through pkg:

The up to date driver is in the -current src.


Code:
commit e28529ca4d34084452ca9acf63aa40279787239a
Author: Brad Smith <brad@comstyle.com>
Date:   Fri Jan 9 19:57:17 2026 -0800

    rge: Add to amd64 GENERIC and to sys/conf/NOTES

    Reviewed by:    adrian
    Differential Revision:  https://reviews.freebsd.org/D54609
 
Hi all,

Work is underway to add the OpenBSD driver for Realtek RTL8125/8126/8127 to FreeBSD base (in -HEAD).
See thread in https://lists.freebsd.org/archives/freebsd-current/2025-November/009481.html

This new driver works for me (both versions of realtek-re-kmod repeatedly crash my system) and some other people.
With sufficient testing in 15.0 (and perhaps 14.3) we may get the driver backported to these versions.

For testing, I created the net/realtek-rge-kmod port.

https://www.freshports.org/net/realtek-rge-kmod/

Feedback that it works is helpful, as is reporting issues with the if_rge driver.
The port should show up in the FreeBSD-ports-kmod pkg repo for 14 and 15 soon.

Cheers, Bernard.

Thanks for this.

Could you tell me what is the advantage of using this driver instead of the net/realtek-re-kmod198 driver I have been using? What benefit does it provide? I have had zero issues with this driver so that is why I am curious to know what this driver provides?
 
Thanks for this.

Could you tell me what is the advantage of using this driver instead of the net/realtek-re-kmod198 driver I have been using? What benefit does it provide? I have had zero issues with this driver so that is why I am curious to know what this driver provides?
  1. `net/realtek-rge-kmod` is a copy of the driver that has now been added to the main branch.
  2. Many people had issues with the official realtek-re driver. My system would crash repeatedly. This is why there's two versions of the official Realtek driver. Works for some but not for all.
More testing and feedback (positive as well as negative!) will increase the probability of this driver being merged back into 15-stable for the 15.1 release.
Unsure if this will ever be merged into 15.0.
 
Is this experimental version not capable or not intended to be run on a 13 branch?
Fails to build. Now marked `BROKEN` for 13.x so it will only be built for 14 and 15.
I haven't the time to even try backporting this to 13, if anyone provides patches they can be included if they don't affect the 14 and 15 packages.

The latest source code realtek-rge-kmod in the ports tree has not changed since 2025-12-13
Just updated the port to the latest snapshot 2026-01-12. The previous version was working fine for my 2.5GBE chip, there seem to be updates for 5GBE in there.
 
Hello,
It doesn't work for me if when I try to setup a vlan, I can't reach the gateway.
Are vlan implemented in this driver ? I installed the package from kmod Latest, on Freebsd 14.3

Edit : the card is a 8125 on an Asus Prime B760-Plus D4 Motherboard
Edit(2) : finally, it worked with
ifconfig rge0 -hwvlantag -hwvlancsum
 
Back
Top