Page 1 of 1

Realtek RTL8125B 2.5G LAN on Centos 7.8

Posted: 2020/10/05 02:02:33
by JigMcGalliger
I'm trying to get the ethernet port working on a B550M Mortar motherboard. I'm on CentOS 7.8.2003 with kernel 3.10.0-1127.19

The device is correctly showing with lspci as:

Code: Select all

2a:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8125 2.5GbE Controller (rev 04)
It looks like the driver module is not native to this kernel, so I was trying to compile it.

I have the development tools group of packages installed and I downloaded driver r8125-9.003.05 from ... s-software (labelled 2.5G Ethernet LINUX driver r8125 for kernel up to 5.6)

This errors upon compilation:

Code: Select all

[root@coreforge r8125-9.003.05]# ./

Check old driver and unload it.
Build the module and install
In file included from /root/r8125-9.003.05/src/r8125_n.c:82:0:
/root/r8125-9.003.05/src/r8125.h:47:20: error: redefinition of ‘ether_addr_copy’
 static inline void ether_addr_copy(u8 *dst, const u8 *src)
In file included from /root/r8125-9.003.05/src/r8125_n.c:42:0:
include/linux/etherdevice.h:246:20: note: previous definition of ‘ether_addr_copy’ was here
 static inline void ether_addr_copy(u8 *dst, const u8 *src)
/root/r8125-9.003.05/src/r8125_n.c:10359:9: error: unknown field ‘ndo_change_mtu’ specified in initializer
         .ndo_change_mtu     = rtl8125_change_mtu,
/root/r8125-9.003.05/src/r8125_n.c:10359:9: warning: missing braces around initializer [-Wmissing-braces]
/root/r8125-9.003.05/src/r8125_n.c:10359:9: warning: (near initialization for ‘rtl8125_netdev_ops.<anonymous>’) [-Wmissing-braces]
/root/r8125-9.003.05/src/r8125_n.c:10359:9: warning: initialization from incompatible pointer type [enabled by default]
/root/r8125-9.003.05/src/r8125_n.c:10359:9: warning: (near initialization for ‘rtl8125_netdev_ops.<anonymous>.ndo_get_stats64’) [enabled by default]
/root/r8125-9.003.05/src/r8125_n.c: In function ‘rtl8125_rx_interrupt’:
/root/r8125-9.003.05/src/r8125_n.c:12320:28: error: ‘struct net_device’ has no member named ‘last_rx’
                         dev->last_rx = jiffies;
make[3]: *** [/root/r8125-9.003.05/src/r8125_n.o] Error 1
make[2]: *** [_module_/root/r8125-9.003.05/src] Error 2
make[1]: *** [modules] Error 2
make: *** [modules] Error 2
I'm no kernel developer, so I don't understand why it states the error "redefinition of ‘ether_addr_copy’" but states the previous definition as the same as the errored one. I'm hoping clearing that error will allow the ndo_change_mtu to no longer error.

Any ideas?

Re: Realtek RTL8125B 2.5G LAN on Centos 7.8

Posted: 2020/10/05 06:39:15
by TrevorH
Yes, wrong method. Google "ELRepo" and install their elrepo-release rpm and download their kmod-r8125-9.003.05-1.el7_8.elrepo.x86_64 locally and use yum --disablerepo=\* install /path/to/kmod-r8125-9.003.05-1.el7_8.elrepo.x86_64. Make sure you also install the elrepo-release package so that you stay up to date when a newer version is required for the next point release kernel.

Re: Realtek RTL8125B 2.5G LAN on Centos 7.8

Posted: 2020/10/06 01:29:53
by JigMcGalliger
Awesome, I downloaded the rpm from the mirrors at ... 4.rpm.html

With your command and their howto, I have now elrepo added to yum and the device is now showing as enp42s0 in the network interfaces. Thank you.