Giter Club home page Giter Club logo

realtek-r8125-dkms's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

realtek-r8125-dkms's Issues

Official 23.05 build fails。

Official 23.05 build fails

make[3]: Entering directory '/home/sjkhsl/openwrt-23.05/package/chajianbao/r8125'
touch /home/sjkhsl/openwrt-23.05/build_dir/target-x86_64_musl/linux-x86_64/r8125-9.011.00/.prepared_d201d8b33594c1329ed6c677ebd4c023_6664517399ebbbc92a37c5bb081b5c53_check
true
[ ! -d ./src/ ] || cp -fpR ./src/. /home/sjkhsl/openwrt-23.05/build_dir/target-x86_64_musl/linux-x86_64/r8125-9.011.00

Applying ./patches/010-config.patch using plaintext:
patching file Makefile

Applying ./patches/020-fix-6.1-suppot.patch using plaintext:
patching file r8125.h

Applying ./patches/100-add-LED-configuration-from-OF.patch using plaintext:
patching file r8125_n.c

Applying ./patches/101-legacy-2500baseX.patch using plaintext:
patching file Makefile
patching file r8125_n.c
touch /home/sjkhsl/openwrt-23.05/build_dir/target-x86_64_musl/linux-x86_64/r8125-9.011.00/.prepared_d201d8b33594c1329ed6c677ebd4c023_6664517399ebbbc92a37c5bb081b5c53
rm -f /home/sjkhsl/openwrt-23.05/build_dir/target-x86_64_musl/linux-x86_64/r8125-9.011.00/.configured_*
rm -f /home/sjkhsl/openwrt-23.05/staging_dir/target-x86_64_musl/stamp/.r8125_installed
(cd /home/sjkhsl/openwrt-23.05/build_dir/target-x86_64_musl/linux-x86_64/r8125-9.011.00/./; if [ -x ./configure ]; then find /home/sjkhsl/openwrt-23.05/build_dir/target-x86_64_musl/linux-x86_64/r8125-9.011.00/ -name config.guess | xargs -r chmod u+w; find /home/sjkhsl/openwrt-23.05/build_dir/target-x86_64_musl/linux-x86_64/r8125-9.011.00/ -name config.guess | xargs -r -n1 cp --remove-destination /home/sjkhsl/openwrt-23.05/scripts/config.guess; find /home/sjkhsl/openwrt-23.05/build_dir/target-x86_64_musl/linux-x86_64/r8125-9.011.00/ -name config.sub | xargs -r chmod u+w; find /home/sjkhsl/openwrt-23.05/build_dir/target-x86_64_musl/linux-x86_64/r8125-9.011.00/ -name config.sub | xargs -r -n1 cp --remove-destination /home/sjkhsl/openwrt-23.05/scripts/config.sub; AR="x86_64-openwrt-linux-musl-gcc-ar" AS="x86_64-openwrt-linux-musl-gcc -c -Os -pipe -fno-caller-saves -fno-plt -fhonour-copts -fmacro-prefix-map=/home/sjkhsl/openwrt-23.05/build_dir/target-x86_64_musl/linux-x86_64/r8125-9.011.00=r8125-9.011.00 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro" LD=x86_64-openwrt-linux-musl-ld NM="x86_64-openwrt-linux-musl-gcc-nm" CC="x86_64-openwrt-linux-musl-gcc" GCC="x86_64-openwrt-linux-musl-gcc" CXX="x86_64-openwrt-linux-musl-g++" RANLIB="x86_64-openwrt-linux-musl-gcc-ranlib" STRIP=x86_64-openwrt-linux-musl-strip OBJCOPY=x86_64-openwrt-linux-musl-objcopy OBJDUMP=x86_64-openwrt-linux-musl-objdump SIZE=x86_64-openwrt-linux-musl-size CFLAGS="-Os -pipe -fno-caller-saves -fno-plt -fhonour-copts -fmacro-prefix-map=/home/sjkhsl/openwrt-23.05/build_dir/target-x86_64_musl/linux-x86_64/r8125-9.011.00=r8125-9.011.00 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro " CXXFLAGS="-Os -pipe -fno-caller-saves -fno-plt -fhonour-copts -fmacro-prefix-map=/home/sjkhsl/openwrt-23.05/build_dir/target-x86_64_musl/linux-x86_64/r8125-9.011.00=r8125-9.011.00 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro " CPPFLAGS="-I/home/sjkhsl/openwrt-23.05/staging_dir/toolchain-x86_64_gcc-12.3.0_musl/usr/include -I/home/sjkhsl/openwrt-23.05/staging_dir/toolchain-x86_64_gcc-12.3.0_musl/include/fortify -I/home/sjkhsl/openwrt-23.05/staging_dir/toolchain-x86_64_gcc-12.3.0_musl/include " LDFLAGS="-L/home/sjkhsl/openwrt-23.05/staging_dir/toolchain-x86_64_gcc-12.3.0_musl/usr/lib -L/home/sjkhsl/openwrt-23.05/staging_dir/toolchain-x86_64_gcc-12.3.0_musl/lib -znow -zrelro "   ./configure --target=x86_64-openwrt-linux --host=x86_64-openwrt-linux --build=x86_64-pc-linux-gnu --disable-dependency-tracking --program-prefix="" --program-suffix="" --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --libexecdir=/usr/lib --sysconfdir=/etc --datadir=/usr/share --localstatedir=/var --mandir=/usr/man --infodir=/usr/info --disable-nls  ; fi; )
touch /home/sjkhsl/openwrt-23.05/build_dir/target-x86_64_musl/linux-x86_64/r8125-9.011.00/.configured_68b329da9893e34099c7d8ad5cb9c940
rm -f /home/sjkhsl/openwrt-23.05/build_dir/target-x86_64_musl/linux-x86_64/r8125-9.011.00/.built
touch /home/sjkhsl/openwrt-23.05/build_dir/target-x86_64_musl/linux-x86_64/r8125-9.011.00/.built_check
make -C /home/sjkhsl/openwrt-23.05/build_dir/target-x86_64_musl/linux-x86_64/linux-5.15.112 KCFLAGS="-fmacro-prefix-map=/home/sjkhsl/openwrt-23.05/build_dir/target-x86_64_musl=target-x86_64_musl -fno-caller-saves " HOSTCFLAGS="-O2 -I/home/sjkhsl/openwrt-23.05/staging_dir/host/include -I/home/sjkhsl/openwrt-23.05/staging_dir/hostpkg/include -I/home/sjkhsl/openwrt-23.05/staging_dir/target-x86_64_musl/host/include -Wall -Wmissing-prototypes -Wstrict-prototypes" CROSS_COMPILE="x86_64-openwrt-linux-musl-" ARCH="x86" KBUILD_HAVE_NLS=no KBUILD_BUILD_USER="" KBUILD_BUILD_HOST="" KBUILD_BUILD_TIMESTAMP="Sun May 21 17:57:06 2023" KBUILD_BUILD_VERSION="0" KBUILD_HOSTLDFLAGS="-L/home/sjkhsl/openwrt-23.05/staging_dir/host/lib" CONFIG_SHELL="bash" V=''  cmd_syscalls= KBUILD_EXTRA_SYMBOLS="/home/sjkhsl/openwrt-23.05/build_dir/target-x86_64_musl/linux-x86_64/symvers/button-hotplug.symvers" KERNELRELEASE=5.15.112 M=/home/sjkhsl/openwrt-23.05/build_dir/target-x86_64_musl/linux-x86_64/r8125-9.011.00 modules
make[4]: Entering directory '/home/sjkhsl/openwrt-23.05/build_dir/target-x86_64_musl/linux-x86_64/linux-5.15.112'
  CC [M]  /home/sjkhsl/openwrt-23.05/build_dir/target-x86_64_musl/linux-x86_64/r8125-9.011.00/r8125_n.o
  CC [M]  /home/sjkhsl/openwrt-23.05/build_dir/target-x86_64_musl/linux-x86_64/r8125-9.011.00/rtl_eeprom.o
  CC [M]  /home/sjkhsl/openwrt-23.05/build_dir/target-x86_64_musl/linux-x86_64/r8125-9.011.00/rtltool.o
  CC [M]  /home/sjkhsl/openwrt-23.05/build_dir/target-x86_64_musl/linux-x86_64/r8125-9.011.00/r8125_rss.o
/home/sjkhsl/openwrt-23.05/build_dir/target-x86_64_musl/linux-x86_64/r8125-9.011.00/r8125_rss.c: In function 'rtl8125_get_rss_hash_opts':
/home/sjkhsl/openwrt-23.05/build_dir/target-x86_64_musl/linux-x86_64/r8125-9.011.00/r8125_rss.c:59:27: error: this statement may fall through [-Werror=implicit-fallthrough=]
   59 |                 cmd->data |= RXH_L4_B_0_1 | RXH_L4_B_2_3;
/home/sjkhsl/openwrt-23.05/build_dir/target-x86_64_musl/linux-x86_64/r8125-9.011.00/r8125_rss.c:61:9: note: here
   61 |         case UDP_V4_FLOW:
      |         ^~~~
/home/sjkhsl/openwrt-23.05/build_dir/target-x86_64_musl/linux-x86_64/r8125-9.011.00/r8125_rss.c:62:20: error: this statement may fall through [-Werror=implicit-fallthrough=]
   62 |                 if (tp->rss_flags & RTL_8125_RSS_FLAG_HASH_UDP_IPV4)
      |                    ^
/home/sjkhsl/openwrt-23.05/build_dir/target-x86_64_musl/linux-x86_64/r8125-9.011.00/r8125_rss.c:65:9: note: here
   65 |         case IPV4_FLOW:
      |         ^~~~
/home/sjkhsl/openwrt-23.05/build_dir/target-x86_64_musl/linux-x86_64/r8125-9.011.00/r8125_rss.c:69:27: error: this statement may fall through [-Werror=implicit-fallthrough=]
   69 |                 cmd->data |= RXH_L4_B_0_1 | RXH_L4_B_2_3;
/home/sjkhsl/openwrt-23.05/build_dir/target-x86_64_musl/linux-x86_64/r8125-9.011.00/r8125_rss.c:71:9: note: here
   71 |         case UDP_V6_FLOW:
      |         ^~~~
/home/sjkhsl/openwrt-23.05/build_dir/target-x86_64_musl/linux-x86_64/r8125-9.011.00/r8125_rss.c:72:20: error: this statement may fall through [-Werror=implicit-fallthrough=]
   72 |                 if (tp->rss_flags & RTL_8125_RSS_FLAG_HASH_UDP_IPV6)
      |                    ^
/home/sjkhsl/openwrt-23.05/build_dir/target-x86_64_musl/linux-x86_64/r8125-9.011.00/r8125_rss.c:75:9: note: here
   75 |         case IPV6_FLOW:
      |         ^~~~
cc1: all warnings being treated as errors
make[5]: *** [scripts/Makefile.build:289: /home/sjkhsl/openwrt-23.05/build_dir/target-x86_64_musl/linux-x86_64/r8125-9.011.00/r8125_rss.o] Error 1
make[4]: *** [Makefile:1906: /home/sjkhsl/openwrt-23.05/build_dir/target-x86_64_musl/linux-x86_64/r8125-9.011.00] Error 2
make[4]: Leaving directory '/home/sjkhsl/openwrt-23.05/build_dir/target-x86_64_musl/linux-x86_64/linux-5.15.112'
make[3]: *** [Makefile:37: /home/sjkhsl/openwrt-23.05/build_dir/target-x86_64_musl/linux-x86_64/r8125-9.011.00/.built] Error 2
make[3]: Leaving directory '/home/sjkhsl/openwrt-23.05/package/chajianbao/r8125'
time: package/chajianbao/r8125/compile#5.30#0.35#5.64
    ERROR: package/chajianbao/r8125 failed to build.
make[2]: *** [package/Makefile:120: package/chajianbao/r8125/compile] Error 1
make[2]: Leaving directory '/home/sjkhsl/openwrt-23.05'
make[1]: *** [package/Makefile:114: /home/sjkhsl/openwrt-23.05/staging_dir/target-x86_64_musl/stamp/.package_compile] Error 2
make[1]: Leaving directory '/home/sjkhsl/openwrt-23.05'
make: *** [/home/sjkhsl/openwrt-23.05/include/toplevel.mk:231: world] Error 2

[Info] Building current version works with 20.04.1 and hwe kernel 5.8.0-55

Just saw the note in your current release:

I stopped Launchpad daily building for now because this version cannot build on the latest system, at least Ubuntu 21.04 + 5.11 kernel that I tested with. I will investigate this one to work with the current system. For now, to use this version of r8125 driver you should download/install it by yourself. In the case of Ubuntu 20.04 + 5.4 kernel, which is my other system, it can be updated flawlessly.

And wanted to confirm that it builds well using your private launchpad repo and the 5.8 kernel on 20.04.01 (using the hardware enablement stack, linux-generic-hwe-20.04).

proxmox 7.4 high cpu usage with rtl8125 nic

When doing iperf3 line speed tests, im seeing very high cpu in proxmox host top with the above nic and stock (kernel?) rtl8125 driver.

According to lspci it's using the r8169 driver.

Will installing the driver offered in this github improve with excessive cpu usage?

Thank you

Error: r8125: module verification failed: signature and/or required key missing - tainting kernel

Building this on ProxMox 8.1.3 (Debian 12) leads to the following message:

r8125                 307200  0
[    0.364872] pci 0000:03:00.0: [10ec:8125] type 00 class 0x020000
[    0.942986] r8169 0000:03:00.0 eth0: RTL8125B, a8:a1:59:52:38:c5, XID 641, IRQ 129
[43228.024646] r8125: module verification failed: signature and/or required key missing - tainting kernel

Any idea what this means?

Thank you

Peter


Installing using this:

version=9.012.04-1
curl -L https://github.com/awesometic/realtek-r8125-dkms/archive/refs/tags/${version}.tar.gz -o ${version}.tar.gz
tar xvzf ${version}.tar.gz
cp -pr realtek-r8125-dkms-${version}* /usr/src/r8125-${version}

dkms add -m r8125 -v $version
dkms build -m r8125 -v $version
dkms install -m r8125 -v $version
depmod -a
update-initramfs -u
modprobe -v r8125 

lsmod | grep 8125
dmesg | grep -i 8125

Odroid H2+ r8125 interface loses network connectivity after kernel watchdog timer deadlock

Running Ubuntu 20.04 and installed r8125 drivers via wiki

Linux node 5.4.0-53-generic #59-Ubuntu SMP Wed Oct 21 09:38:44 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

Dmesg log

[ 2549.107593] ------------[ cut here ]------------
[ 2549.107645] NETDEV WATCHDOG: enp3s0 (r8125): transmit queue 0 timed out
[ 2549.107730] WARNING: CPU: 2 PID: 0 at net/sched/sch_generic.c:447 dev_watchdog+0x258/0x260
[ 2549.107733] Modules linked in: xt_nat xt_tcpudp veth xt_conntrack xt_MASQUERADE nf_conntrack_netlink nfnetlink xfrm_user xfrm_algo xt_addrtype iptable_filter ipta
ble_nat nf_nat nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 bpfilter br_netfilter bridge stp llc aufs overlay nls_iso8859_1 xfs dm_multipath scsi_dh_rdac scsi_dh_emc s
csi_dh_alua intel_rapl_msr intel_rapl_common snd_sof_pci snd_sof_intel_hda_common snd_soc_hdac_hda snd_sof_intel_hda snd_sof_intel_byt snd_sof_intel_ipc snd_sof inte
l_telemetry_pltdrv intel_punit_ipc intel_telemetry_core snd_sof_xtensa_dsp intel_pmc_ipc snd_hda_ext_core snd_soc_acpi_intel_match x86_pkg_temp_thermal intel_powercl
amp snd_soc_acpi snd_hda_codec_hdmi coretemp snd_soc_core snd_hda_codec_realtek snd_compress kvm_intel snd_hda_codec_generic ac97_bus mei_hdcp ledtrig_audio kvm snd_
pcm_dmaengine rapl intel_cstate input_leds snd_hda_intel ucsi_acpi snd_intel_dspcfg snd_hda_codec snd_hda_core typec_ucsi r8125(OE) snd_hwdep typec snd_pcm snd_timer
 mei_me snd
[ 2549.107882]  mac_hid mei soundcore sch_fq_codel ip_tables x_tables autofs4 btrfs zstd_compress raid10 raid456 async_raid6_recov async_memcpy async_pq async_xor as
ync_tx xor raid6_pq libcrc32c raid1 raid0 multipath linear mmc_block crct10dif_pclmul crc32_pclmul ghash_clmulni_intel i915 aesni_intel sdhci_pci crypto_simd i2c_alg
o_bit cqhci hid_apple drm_kms_helper hid_generic cryptd syscopyarea glue_helper sdhci i2c_i801 sysfillrect nvme sysimgblt fb_sys_fops intel_lpss_pci intel_lpss idma6
4 usbhid hid virt_dma nvme_core drm r8169 ahci libahci realtek video pinctrl_geminilake pinctrl_intel
[ 2549.107953] CPU: 2 PID: 0 Comm: swapper/2 Tainted: G           OE     5.4.0-53-generic #59-Ubuntu
[ 2549.107955] Hardware name: HARDKERNEL ODROID-H2/ODROID-H2, BIOS 5.13 04/27/2020
[ 2549.107961] RIP: 0010:dev_watchdog+0x258/0x260
[ 2549.107966] Code: 85 c0 75 e5 eb 9f 4c 89 ff c6 05 bf be e7 00 01 e8 cd b4 fa ff 44 89 e9 4c 89 fe 48 c7 c7 d0 8f 23 bb 48 89 c2 e8 43 f7 70 ff <0f> 0b eb 80 0f 1
f 40 00 0f 1f 44 00 00 55 48 89 e5 41 57 49 89 d7
[ 2549.107969] RSP: 0018:ffffb75ec0118e30 EFLAGS: 00010286
[ 2549.107973] RAX: 0000000000000000 RBX: ffff99b80fe2fbc0 RCX: 000000000000083f
[ 2549.107976] RDX: 0000000000000000 RSI: 00000000000000f6 RDI: 000000000000083f
[ 2549.107978] RBP: ffffb75ec0118e60 R08: ffff99b81fb178c8 R09: 0000000000000004
[ 2549.107980] R10: 0000000000000000 R11: 0000000000000001 R12: 0000000000000004
[ 2549.107983] R13: 0000000000000000 R14: ffff99b80fd40480 R15: ffff99b80fd40000
[ 2549.107987] FS:  0000000000000000(0000) GS:ffff99b81fb00000(0000) knlGS:0000000000000000
[ 2549.107990] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 2549.107993] CR2: 00005638c32c0750 CR3: 000000018dc0a000 CR4: 0000000000340ee0
[ 2549.107995] Call Trace:
[ 2549.108000]  <IRQ>
[ 2549.108009]  ? pfifo_fast_enqueue+0x150/0x150
[ 2549.108018]  call_timer_fn+0x32/0x130
[ 2549.108025]  __run_timers.part.0+0x180/0x280
[ 2549.108032]  ? tick_sched_timer+0x3d/0x80
[ 2549.108038]  ? ktime_get+0x3e/0xa0
[ 2549.108044]  run_timer_softirq+0x2a/0x50
[ 2549.108050]  __do_softirq+0xe1/0x2d6
[ 2549.108055]  ? hrtimer_interrupt+0x13b/0x220
[ 2549.108063]  irq_exit+0xae/0xb0
[ 2549.108067]  smp_apic_timer_interrupt+0x7b/0x140
[ 2549.108072]  apic_timer_interrupt+0xf/0x20
[ 2549.108074]  </IRQ>
[ 2549.108080] RIP: 0010:cpuidle_enter_state+0xc5/0x450
[ 2549.108085] Code: ff e8 bf cc 80 ff 80 7d c7 00 74 17 9c 58 0f 1f 44 00 00 f6 c4 02 0f 85 65 03 00 00 31 ff e8 82 36 87 ff fb 66 0f 1f 44 00 00 <45> 85 ed 0f 88 8
f 02 00 00 49 63 cd 4c 8b 7d d0 4c 2b 7d c8 48 8d
[ 2549.108087] RSP: 0018:ffffb75ec009fe38 EFLAGS: 00000246 ORIG_RAX: ffffffffffffff13
[ 2549.108091] RAX: ffff99b81fb2ad00 RBX: ffffffffbb559c20 RCX: 000000000000001f
[ 2549.108094] RDX: 0000000000000000 RSI: 0000000047af4125 RDI: 0000000000000000
[ 2549.108096] RBP: ffffb75ec009fe78 R08: 0000025182a53020 R09: 0000000000000ee8
[ 2549.108099] R10: ffff99b81fb29a00 R11: ffff99b81fb299e0 R12: ffff99b81fb34d00
[ 2549.108101] R13: 0000000000000007 R14: 0000000000000007 R15: ffff99b81fb34d00
[ 2549.108109]  ? cpuidle_enter_state+0xa1/0x450
[ 2549.108115]  cpuidle_enter+0x2e/0x40
[ 2549.108121]  call_cpuidle+0x23/0x40
[ 2549.108125]  do_idle+0x1dd/0x270
[ 2549.108130]  cpu_startup_entry+0x20/0x30
[ 2549.108137]  start_secondary+0x167/0x1c0
[ 2549.108143]  secondary_startup_64+0xa4/0xb0
[ 2549.108149] ---[ end trace 510c50278de750db ]---
> ethtool -S enp3s0
NIC statistics:
     tx_packets: 4993633
     rx_packets: 5825003
     tx_errors: 743
     rx_errors: 0
     rx_missed: 4081
     align_errors: 0
     tx_single_collisions: 0
     tx_multi_collisions: 0
     unicast: 5823789
     broadcast: 924
     multicast: 290
     tx_aborted: 0
     tx_underrun: 0

Cannot use on Proxmox 7.2

hi @awesometic,

i'm trying to use your DKMS driver for a 2.5GbE ethernet on my Proxmox build.

But adding the dpkg manually (after fixing the depedencies) give me this error:

root@pve:~# dpkg -i realtek-r8125-dkms_9.009.01-1_amd64.deb
(Reading database ... 87108 files and directories currently installed.)
Preparing to unpack realtek-r8125-dkms_9.009.01-1_amd64.deb ...

------------------------------
Deleting module version: 9.009.01
completely from the DKMS tree.
------------------------------
Done.
Unpacking realtek-r8125-dkms (9.009.01-1) over (9.009.01-1) ...
Setting up realtek-r8125-dkms (9.009.01-1) ...
Loading new realtek-r8125-9.009.01 DKMS files...
Building for 5.15.35-1-pve
Building for architecture amd64
Module build for kernel 5.15.35-1-pve was skipped since the
kernel headers for this kernel does not seem to be installed.

Any suggestion?

Thanks

Kernel update breaks network

Hey and thank you for this awesome repo. I am running Debian 12 (Openmediavault 7 with a Gigabyte B760m MB with a RTL8125 network chip) and just upgrade the kernel from 6.1.0-18 to 20 (https://mirrors.edge.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.1.83)). After reboot my network connection is completely gone and the network interface is not found.
On the older kernel your driver install worked flawlessly and I dont know what went wrong here.
I think something went wrong with DKMS here:

Signing key: /var/lib/dkms/mok.key
Public certificate (MOK): /var/lib/dkms/mok.pub
Deprecated feature: REMAKE_INITRD (/var/lib/dkms/realtek-r8125/9.012.04/source/dkms.conf)

Building module:
Cleaning build area...
'make' -j8 KVER=6.1.0-20-amd64 BASEDIR=/lib/modules/6.1.0-20-amd64 modules.....
Signing module /var/lib/dkms/realtek-r8125/9.012.04/build/src/r8125.ko
Cleaning build area...

r8125.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/6.1.0-20-amd64/updates/dkms/
depmod...
dkms: autoinstall for kernel: 6.1.0-20-amd64.
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-6.1.0-20-amd64
/etc/kernel/postinst.d/zz-update-grub:
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-6.1.0-20-amd64
Found initrd image: /boot/initrd.img-6.1.0-20-amd64
Found linux image: /boot/vmlinuz-6.1.0-18-amd64
Found initrd image: /boot/initrd.img-6.1.0-18-amd64
Found memtest86+ 64bit EFI image: /boot/memtest86+x64.efi
Warning: os-prober will not be executed to detect other bootable partitions.
Systems on them will not be added to the GRUB boot configuration.
Check GRUB_DISABLE_OS_PROBER documentation entry.
Adding boot menu entry for UEFI Firmware Settings ...
done
Setting up linux-headers-6.1.0-20-common (6.1.85-1) ...
Setting up linux-image-amd64 (6.1.85-1) ...
Setting up linux-headers-6.1.0-20-amd64 (6.1.85-1) ...
/etc/kernel/header_postinst.d/dkms:
dkms: running auto installation service for kernel 6.1.0-20-amd64.
Deprecated feature: REMAKE_INITRD (/var/lib/dkms/realtek-r8125/9.012.04/source/dkms.conf)
Deprecated feature: REMAKE_INITRD (/var/lib/dkms/realtek-r8125/9.012.04/source/dkms.conf)
dkms: autoinstall for kernel: 6.1.0-20-amd64.
Setting up linux-headers-amd64 (6.1.85-1) ...```

What's the advantage of using realtek driver instead of mainline r8169?

Hello, I am a developer from armbian and I'm handling arm SBCs with RTL8125 ethernet.
You started this project from 2020 and I guess mainline r8169 should have some bugs or features not implemented. Would you please tell me why you choose realtek driver instead of mainline r8169 since most distros just ship the mainline driver.

I am thinking of whether using realtek driver in kernel 6.1 for rockchip SBCs. If the reason you choose realtek driver is fixed in kernel 6.1, I may just use mainline r8169 for RTL8125.

Many thanks!

Wrong driver loaded (r8169 instead of r8125)

Hey,

I've read that you've removed the explicit removal of the r8169 driver from the original autorun.sh.

This seems to conflict on my system (20.04.1 LTS, HWE kernel); when both modules are present, my Trendnet R8125 is loaded with the r8169 driver instead of the correct one.

I've now removed it manually, is this intentional behaviour?

Bandwidth Limited to 100Mbps

I am using the r8125 driver for my Realtek 2.5Gigabit onboard LAN. Unfortunately it is not able to get speeds beyond 100Mbps on a 1Gbps connection with CAT7.

04:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8125 2.5GbE Controller (rev 05)
	Subsystem: Gigabyte Technology Co., Ltd Device e000
	Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx+
	Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
	Latency: 0, Cache Line Size: 64 bytes
	Interrupt: pin A routed to IRQ 18
	Region 0: I/O ports at 4000 [size=256]
	Region 2: Memory at 75300000 (64-bit, non-prefetchable) [size=64K]
	Region 4: Memory at 75310000 (64-bit, non-prefetchable) [size=16K]
	Capabilities: <access denied>
	Kernel driver in use: r8125
	Kernel modules: r8169, r8125

When setting using ethtool, the NIC is unable to get an ip address and fails to connect to the internet.

sudo ethtool -s enp4s0 speed 1000 duplex full autoneg off

I can see in modinfo that it does provide these speeds

$ modinfo r8125
filename:       /lib/modules/6.2.8-arch1-1/updates/dkms/r8125.ko.zst
version:        9.011.00-NAPI
license:        GPL
description:    Realtek RTL8125 2.5Gigabit Ethernet driver
author:         Realtek and the Linux r8125 crew <[email protected]>
srcversion:     CBDA9F0B8BED66BA59DD3EB
alias:          pci:v000010ECd00005000sv*sd*bc*sc*i*
alias:          pci:v000010ECd00008126sv*sd*bc*sc*i*
alias:          pci:v000010ECd00003000sv*sd*bc*sc*i*
alias:          pci:v000010ECd00008162sv*sd*bc*sc*i*
alias:          pci:v000010ECd00008125sv*sd*bc*sc*i*
depends:        
retpoline:      Y
name:           r8125
vermagic:       6.2.8-arch1-1 SMP preempt mod_unload 
sig_id:         PKCS#7
signer:         DKMS module signing key
sig_key:        2F:76:71:B7:24:87:18:44:59:FD:22:6D:FA:DE:46:FA:66:72:6F:23
sig_hashalgo:   sha512
signature:      76:7C:99:EF:18:7F:ED:14:94:86:14:B0:A3:BC:FA:8A:8E:96:01:4B:
		30:2D:DC:A0:E0:39:8C:CE:BF:2F:4C:F4:A7:97:73:C7:E4:4B:F8:D4:
		45:9D:23:D0:89:C2:AD:73:52:7F:FE:C0:68:B7:87:D8:3D:E3:5E:31:
		F4:07:CC:0F:E6:0A:F2:B3:A1:F3:72:00:15:8B:8F:39:F9:00:05:9A:
		9C:DD:0C:D4:6F:00:5F:7B:B6:ED:3D:29:17:6E:BC:25:BE:16:9A:B1:
		09:6A:E0:69:58:34:11:7F:AA:77:E8:00:8A:C6:82:D1:82:1A:EB:4E:
		7E:FB:2F:9A:72:AE:1C:86:50:1A:06:40:81:62:3A:40:78:4A:55:CD:
		D9:57:2B:76:AC:76:A8:8F:BE:13:F8:DF:E5:A2:05:D3:3E:10:9A:1F:
		7E:FF:D0:F1:D4:64:BC:F4:4B:4E:68:80:DB:16:4F:9F:99:12:A9:51:
		C9:8F:7A:76:86:F3:19:DE:DF:16:1D:91:4C:3B:51:7E:02:A7:88:8D:
		13:18:C2:83:64:7B:FF:B5:7B:1A:0C:DB:3D:C1:0B:5D:8E:27:B2:26:
		8C:08:32:26:6B:6A:E8:7C:08:27:44:81:67:EB:B5:81:6D:C6:DE:59:
		F5:6A:BD:E4:D0:E4:E5:51:D2:5C:FD:F7:EC:17:72:83
parm:           speed_mode:force phy operation. Deprecated by ethtool (8). (uint)
parm:           duplex_mode:force phy operation. Deprecated by ethtool (8). (uint)
parm:           autoneg_mode:force phy operation. Deprecated by ethtool (8). (uint)
parm:           advertising_mode:force phy operation. Deprecated by ethtool (8). (uint)
parm:           aspm:Enable ASPM. (int)
parm:           s5wol:Enable Shutdown Wake On Lan. (int)
parm:           s5_keep_curr_mac:Enable Shutdown Keep Current MAC Address. (int)
parm:           use_dac:Enable PCI DAC. Unsafe on 32 bit PCI slot. (int)
parm:           timer_count:Timer Interrupt Interval. (int)
parm:           eee_enable:Enable Energy Efficient Ethernet. (int)
parm:           hwoptimize:Enable HW optimization function. (ulong)
parm:           s0_magic_packet:Enable S0 Magic Packet. (int)
parm:           tx_no_close_enable:Enable TX No Close. (int)
parm:           enable_ptp_master_mode:Enable PTP Master Mode. (int)
parm:           disable_pm_support:Disable PM support. (int)
parm:           enable_double_vlan:Enable Double VLAN. (int)
parm:           debug:Debug verbosity level (0=none, ..., 16=all) (int)

I am using the following kernel

Linux earth 6.2.8-arch1-1 #1 SMP PREEMPT_DYNAMIC Wed, 22 Mar 2023 22:52:35 +0000 x86_64 GNU/Linux
Online

Thoughts?

Another Thank You!

Feel free to just close this, but I wanted to also thank you for doing this. RealTek should be offering a similar thing.

I added a 2.5Gb dual-port card to my existing Ubuntu 20.04.5 Xen (community) server. I downloaded the driver from RealTek's site, but while it did make, it was just a "bag of tools" with no real way to install it and keep it going. DKMS was the obvious choice, and you solved it.

Installed the deb package (after first installing dkms), and after a reboot, it came right up no problem.

Please keep up the good work!

DKMS doesn't compile on PVE-Kernel-6.1

Hi,

i want to try opt-in 6.1 kernel on PVE 7.3, but the DKMS driver doesn't compile, here is the error:

DKMS make.log for realtek-r8125-9.010.01 for kernel 6.1.0-1-pve (x86_64)
Sun 18 Dec 2022 06:20:13 PM CET
/bin/sh: 1: VER: not found
make -C src/ KVER=6.1.0-1-pve BASEDIR=/lib/modules/6.1.0-1-pve modules
make[1]: Entering directory '/var/lib/dkms/realtek-r8125/9.010.01/build/src'
make -C /lib/modules/6.1.0-1-pve/build M=/var/lib/dkms/realtek-r8125/9.010.01/build/src modules
make[2]: Entering directory '/usr/src/linux-headers-6.1.0-1-pve'
  CC [M]  /var/lib/dkms/realtek-r8125/9.010.01/build/src/r8125_n.o
  CC [M]  /var/lib/dkms/realtek-r8125/9.010.01/build/src/rtl_eeprom.o
  CC [M]  /var/lib/dkms/realtek-r8125/9.010.01/build/src/rtltool.o
In file included from /var/lib/dkms/realtek-r8125/9.010.01/build/src/r8125_n.c:83:
/var/lib/dkms/realtek-r8125/9.010.01/build/src/r8125_n.c: In function ‘rtl8125_init_napi’:
/var/lib/dkms/realtek-r8125/9.010.01/build/src/r8125.h:636:57: error: too many arguments to function ‘netif_napi_add’
  636 | #define RTL_NAPI_CONFIG(ndev, priv, function, weight)   netif_napi_add(ndev, &priv->napi, function, weight)
      |                                                         ^~~~~~~~~~~~~~
/var/lib/dkms/realtek-r8125/9.010.01/build/src/r8125_n.c:12614:17: note: in expansion of macro ‘RTL_NAPI_CONFIG’
12614 |                 RTL_NAPI_CONFIG(tp->dev, r8125napi, poll, R8125_NAPI_WEIGHT);
      |                 ^~~~~~~~~~~~~~~
In file included from /var/lib/dkms/realtek-r8125/9.010.01/build/src/r8125_n.c:42:
./include/linux/netdevice.h:2562:1: note: declared here
 2562 | netif_napi_add(struct net_device *dev, struct napi_struct *napi,
      | ^~~~~~~~~~~~~~
make[3]: *** [scripts/Makefile.build:258: /var/lib/dkms/realtek-r8125/9.010.01/build/src/r8125_n.o] Error 1
make[2]: *** [Makefile:1996: /var/lib/dkms/realtek-r8125/9.010.01/build/src] Error 2
make[2]: Leaving directory '/usr/src/linux-headers-6.1.0-1-pve'
make[1]: *** [Makefile:176: modules] Error 2
make[1]: Leaving directory '/var/lib/dkms/realtek-r8125/9.010.01/build/src'
make: *** [Makefile:42: modules] Error 2

Are you able to fix it or we need to wait Realtek to update the driver for 6.1?

Thx

9.012.03

Dear awesometic, 9.012.03 has been released, if you're interested :) cheers!

Thank you

I'd like to take a moment to thank the maintainer for doing a wonderful job in packaging this properly.

The package installation in Proxmox

I am getting the following message:

Module build for kernel 5.13.19-1-pve was skipped since the kernel headers for this kernel does not seem to be installed.

I have checked with the following command:

apt search pve-headers-$(uname -r)

It says that headers are installed.

ls -l /usr/src
linux-headers-5.13.19-1-pve

9.013.02 does not work with kernel 6.9

Fresh Ubuntu 24.04 install. DKMS and running the autorun script fail.

/home/marc/Downloads/r8125-9.013.02/src/r8125_n.c:7682:20: error: initialization of ‘int (*)(struct net_device *, struct ethtool_keee *)’ from incompatible pointer type ‘int (*)(struct net_device *, struct ethtool_eee *)’ [-Werror=incompatible-pointer-types]
 7682 |         .get_eee = rtl_ethtool_get_eee,
      |                    ^~~~~~~~~~~~~~~~~~~

Module not loading on latest Linux Mint/Ubuntu kernel 6.5

$ dmesg | grep r8125
[    6.348755] module r8125: .gnu.linkonce.this_module section size must match the kernel's built struct module size at run time
$ uname -a
Linux kraken 6.5.0-14-generic #14~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Mon Nov 20 18:15:30 UTC 2 x86_64 x86_64 x86_64 GNU/Linux

9.013.02 not work on pve 8.2 with kernel 6.8

PVE 8.2 changes their default kernel to 6.8, which makes my network down. After
upgrading r8125-dkms to 9.013.02, there is still lots of errors show on my console, like:

[353.459395] r8125 0000:06:00.0 enp6s0: NETDEV WATCHDOG: CPU: 0: transmit queue 0 timed out 12412 ms

and the network is still unavailable.

I'm not familiar with dkms so i don't know how to get more logs about this error. If you need more info, just tell me.

By the way, the newest one still works on pve 8.2 with kernel 6.5.

Cannot auto-negotiate the speed to 2.5G in openwrt!

Cannot auto-negotiate the speed to 2.5G in openwrt!
must be enteredethtool -s eth(*) autoneg on advertise 0x80000000002fcommand to auto advertise to 2.5G,It will be restored after restarting the device or restarting the network!
How should it be solved?

Supported ports: [ TP ]
        Supported link modes:   10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Full
                                2500baseT/Full
        Supported pause frame use: Symmetric Receive-only
        Supports auto-negotiation: Yes
        Supported FEC modes: Not reported
        Advertised link modes:  10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Full
        Advertised pause frame use: No
        Advertised auto-negotiation: Yes
        Advertised FEC modes: Not reported
        Link partner advertised link modes:  10baseT/Half 10baseT/Full
                                             100baseT/Half 100baseT/Full
                                             1000baseT/Full
                                             2500baseT/Full
        Link partner advertised pause frame use: No
        Link partner advertised auto-negotiation: Yes
        Link partner advertised FEC modes: Not reported
        Speed: 1000Mb/s
        Duplex: Full
        Auto-negotiation: on
        Port: Twisted Pair
        PHYAD: 0
        Transceiver: internal
        MDI-X: Unknown
        Supports Wake-on: pumbg
        Wake-on: g
        Current message level: 0x00000033 (51)
                               drv probe ifdown ifup
        Link detected: yes

`error: 'struct rtl8125_private' has no member named 'lock'` when using `ENABLE_PTP_SUPPORT = y`

I need PTP for RTL8125 and tried to compile with ENABLE_PTP_SUPPORT = y, but get the following output and errors from make:

CC:  cc
CCVERSION:  9
KERNEL_GCC_VERSION: 
KVER:  5.11.0-36-generic
KMAJ:  5
KMIN:  11
KREV:  0
BASEDIR:  /lib/modules/5.11.0-36-generic
DRIVERDIR:  /lib/modules/5.11.0-36-generic/kernel/drivers/net/ethernet/realtek
PWD:  /home/[username]/realtek-r8125-dkms/src
RTKDIR:  kernel/drivers/net/ethernet/realtek

make -C /lib/modules/5.11.0-36-generic/build M=/home/[username]/realtek-r8125-dkms/src clean
make[1]: Entering directory '/usr/src/linux-headers-5.11.0-36-generic'
  CLEAN   /home/[username]/realtek-r8125-dkms/src/Module.symvers
make[1]: Leaving directory '/usr/src/linux-headers-5.11.0-36-generic'
make -C /lib/modules/5.11.0-36-generic/build M=/home/[username]/realtek-r8125-dkms/src modules
make[1]: Entering directory '/usr/src/linux-headers-5.11.0-36-generic'
  CC [M]  /home/[username]/realtek-r8125-dkms/src/r8125_n.o
  CC [M]  /home/[username]/realtek-r8125-dkms/src/rtl_eeprom.o
  CC [M]  /home/[username]/realtek-r8125-dkms/src/rtltool.o
  CC [M]  /home/[username]/realtek-r8125-dkms/src/r8125_ptp.o
In file included from ./include/linux/mmzone.h:8,
                 from ./include/linux/gfp.h:6,
                 from ./include/linux/umh.h:4,
                 from ./include/linux/kmod.h:9,
                 from ./include/linux/module.h:16,
                 from /home/[username]/realtek-r8125-dkms/src/r8125_ptp.c:35:
/home/[username]/realtek-r8125-dkms/src/r8125_ptp.c: In function ‘rtl8125_phc_adjtime’:
/home/[username]/realtek-r8125-dkms/src/r8125_ptp.c:133:30: error: ‘struct rtl8125_private’ has no member named ‘lock’
  133 |         spin_lock_irqsave(&tp->lock, flags);
      |                              ^~
./include/linux/spinlock.h:252:34: note: in definition of macro ‘raw_spin_lock_irqsave’
  252 |   flags = _raw_spin_lock_irqsave(lock); \
      |                                  ^~~~
/home/[username]/realtek-r8125-dkms/src/r8125_ptp.c:133:9: note: in expansion of macro ‘spin_lock_irqsave’
  133 |         spin_lock_irqsave(&tp->lock, flags);
      |         ^~~~~~~~~~~~~~~~~
/home/[username]/realtek-r8125-dkms/src/r8125_ptp.c:136:35: error: ‘struct rtl8125_private’ has no member named ‘lock’
  136 |         spin_unlock_irqrestore(&tp->lock, flags);
      |                                   ^~
In file included from ./include/linux/mmzone.h:8,
                 from ./include/linux/gfp.h:6,
                 from ./include/linux/umh.h:4,
                 from ./include/linux/kmod.h:9,
                 from ./include/linux/module.h:16,
                 from /home/[username]/realtek-r8125-dkms/src/r8125_ptp.c:35:
/home/[username]/realtek-r8125-dkms/src/r8125_ptp.c: In function ‘rtl8125_phc_gettime’:
/home/[username]/realtek-r8125-dkms/src/r8125_ptp.c:206:30: error: ‘struct rtl8125_private’ has no member named ‘lock’
  206 |         spin_lock_irqsave(&tp->lock, flags);
      |                              ^~
./include/linux/spinlock.h:252:34: note: in definition of macro ‘raw_spin_lock_irqsave’
  252 |   flags = _raw_spin_lock_irqsave(lock); \
      |                                  ^~~~
/home/[username]/realtek-r8125-dkms/src/r8125_ptp.c:206:9: note: in expansion of macro ‘spin_lock_irqsave’
  206 |         spin_lock_irqsave(&tp->lock, flags);
      |         ^~~~~~~~~~~~~~~~~
/home/[username]/realtek-r8125-dkms/src/r8125_ptp.c:208:35: error: ‘struct rtl8125_private’ has no member named ‘lock’
  208 |         spin_unlock_irqrestore(&tp->lock, flags);
      |                                   ^~
In file included from ./include/linux/mmzone.h:8,
                 from ./include/linux/gfp.h:6,
                 from ./include/linux/umh.h:4,
                 from ./include/linux/kmod.h:9,
                 from ./include/linux/module.h:16,
                 from /home/[username]/realtek-r8125-dkms/src/r8125_ptp.c:35:
/home/[username]/realtek-r8125-dkms/src/r8125_ptp.c: In function ‘rtl8125_phc_settime’:
/home/[username]/realtek-r8125-dkms/src/r8125_ptp.c:222:30: error: ‘struct rtl8125_private’ has no member named ‘lock’
  222 |         spin_lock_irqsave(&tp->lock, flags);
      |                              ^~
./include/linux/spinlock.h:252:34: note: in definition of macro ‘raw_spin_lock_irqsave’
  252 |   flags = _raw_spin_lock_irqsave(lock); \
      |                                  ^~~~
/home/[username]/realtek-r8125-dkms/src/r8125_ptp.c:222:9: note: in expansion of macro ‘spin_lock_irqsave’
  222 |         spin_lock_irqsave(&tp->lock, flags);
      |         ^~~~~~~~~~~~~~~~~
/home/[username]/realtek-r8125-dkms/src/r8125_ptp.c:225:35: error: ‘struct rtl8125_private’ has no member named ‘lock’
  225 |         spin_unlock_irqrestore(&tp->lock, flags);
      |                                   ^~
In file included from ./include/linux/mmzone.h:8,
                 from ./include/linux/gfp.h:6,
                 from ./include/linux/umh.h:4,
                 from ./include/linux/kmod.h:9,
                 from ./include/linux/module.h:16,
                 from /home/[username]/realtek-r8125-dkms/src/r8125_ptp.c:35:
/home/[username]/realtek-r8125-dkms/src/r8125_ptp.c: In function ‘rtl8125_phc_enable’:
/home/[username]/realtek-r8125-dkms/src/r8125_ptp.c:241:38: error: ‘struct rtl8125_private’ has no member named ‘lock’
  241 |                 spin_lock_irqsave(&tp->lock, flags);
      |                                      ^~
./include/linux/spinlock.h:252:34: note: in definition of macro ‘raw_spin_lock_irqsave’
  252 |   flags = _raw_spin_lock_irqsave(lock); \
      |                                  ^~~~
/home/[username]/realtek-r8125-dkms/src/r8125_ptp.c:241:17: note: in expansion of macro ‘spin_lock_irqsave’
  241 |                 spin_lock_irqsave(&tp->lock, flags);
      |                 ^~~~~~~~~~~~~~~~~
/home/[username]/realtek-r8125-dkms/src/r8125_ptp.c:249:43: error: ‘struct rtl8125_private’ has no member named ‘lock’
  249 |                 spin_unlock_irqrestore(&tp->lock, flags);
      |                                           ^~
In file included from ./include/linux/mmzone.h:8,
                 from ./include/linux/gfp.h:6,
                 from ./include/linux/umh.h:4,
                 from ./include/linux/kmod.h:9,
                 from ./include/linux/module.h:16,
                 from /home/[username]/realtek-r8125-dkms/src/r8125_ptp.c:35:
/home/[username]/realtek-r8125-dkms/src/r8125_ptp.c: In function ‘rtl8125_ptp_tx_work’:
/home/[username]/realtek-r8125-dkms/src/r8125_ptp.c:344:30: error: ‘struct rtl8125_private’ has no member named ‘lock’
  344 |         spin_lock_irqsave(&tp->lock, flags);
      |                              ^~
./include/linux/spinlock.h:252:34: note: in definition of macro ‘raw_spin_lock_irqsave’
  252 |   flags = _raw_spin_lock_irqsave(lock); \
      |                                  ^~~~
/home/[username]/realtek-r8125-dkms/src/r8125_ptp.c:344:9: note: in expansion of macro ‘spin_lock_irqsave’
  344 |         spin_lock_irqsave(&tp->lock, flags);
      |         ^~~~~~~~~~~~~~~~~
/home/[username]/realtek-r8125-dkms/src/r8125_ptp.c:368:35: error: ‘struct rtl8125_private’ has no member named ‘lock’
  368 |         spin_unlock_irqrestore(&tp->lock, flags);
      |                                   ^~
In file included from ./include/linux/mmzone.h:8,
                 from ./include/linux/gfp.h:6,
                 from ./include/linux/umh.h:4,
                 from ./include/linux/kmod.h:9,
                 from ./include/linux/module.h:16,
                 from /home/[username]/realtek-r8125-dkms/src/r8125_ptp.c:35:
/home/[username]/realtek-r8125-dkms/src/r8125_ptp.c: In function ‘rtl8125_ptp_ioctl’:
/home/[username]/realtek-r8125-dkms/src/r8125_ptp.c:565:38: error: ‘struct rtl8125_private’ has no member named ‘lock’
  565 |                 spin_lock_irqsave(&tp->lock, flags);
      |                                      ^~
./include/linux/spinlock.h:252:34: note: in definition of macro ‘raw_spin_lock_irqsave’
  252 |   flags = _raw_spin_lock_irqsave(lock); \
      |                                  ^~~~
/home/[username]/realtek-r8125-dkms/src/r8125_ptp.c:565:17: note: in expansion of macro ‘spin_lock_irqsave’
  565 |                 spin_lock_irqsave(&tp->lock, flags);
      |                 ^~~~~~~~~~~~~~~~~
/home/[username]/realtek-r8125-dkms/src/r8125_ptp.c:567:43: error: ‘struct rtl8125_private’ has no member named ‘lock’
  567 |                 spin_unlock_irqrestore(&tp->lock, flags);
      |                                           ^~
In file included from ./include/linux/mmzone.h:8,
                 from ./include/linux/gfp.h:6,
                 from ./include/linux/umh.h:4,
                 from ./include/linux/kmod.h:9,
                 from ./include/linux/module.h:16,
                 from /home/[username]/realtek-r8125-dkms/src/r8125_ptp.c:35:
/home/[username]/realtek-r8125-dkms/src/r8125_ptp.c:570:38: error: ‘struct rtl8125_private’ has no member named ‘lock’
  570 |                 spin_lock_irqsave(&tp->lock, flags);
      |                                      ^~
./include/linux/spinlock.h:252:34: note: in definition of macro ‘raw_spin_lock_irqsave’
  252 |   flags = _raw_spin_lock_irqsave(lock); \
      |                                  ^~~~
/home/[username]/realtek-r8125-dkms/src/r8125_ptp.c:570:17: note: in expansion of macro ‘spin_lock_irqsave’
  570 |                 spin_lock_irqsave(&tp->lock, flags);
      |                 ^~~~~~~~~~~~~~~~~
/home/[username]/realtek-r8125-dkms/src/r8125_ptp.c:572:43: error: ‘struct rtl8125_private’ has no member named ‘lock’
  572 |                 spin_unlock_irqrestore(&tp->lock, flags);
      |                                           ^~
make[2]: *** [scripts/Makefile.build:288: /home/[username]/realtek-r8125-dkms/src/r8125_ptp.o] Error 1
make[1]: *** [Makefile:1848: /home/[username]/realtek-r8125-dkms/src] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-5.11.0-36-generic'
make: *** [Makefile:176: modules] Error 2

Is there something I'm missing, or is PTP not supported yet by the driver?

Thanks!

RX Speed drops to 200mbits when PHY is at 2.5GBit/s

Hi got issues with latest dkms version on ODROID H2+ running Debian 10.4:

Tested on both installed NICs to 10G switch. When I negotiate 1Gbit/s PHY, RX/TX is maxing out 1 Gbit/s, but when PHY is at 2,5 Gbit/s RX is only doing 200Mbit/s.

Cable is short CAT7 and was also tested with 6a no difference.

I observed similar behaviour for other 10G network cards before, when running lower speeds than 10G (5G/2.5G), so I assume it is a driver issue. But here 2.5Gbit/s PHY is the max default speed and I can't switch between other modes than 1G.

Kernel Module:
filename:       /lib/modules/4.19.0-9-amd64/updates/dkms/r8125.ko
version:        9.003.05-NAPI
license:        GPL
description:    Realtek RTL8125 2.5Gigabit Ethernet driver
IPerf3 Test  RX  Direction for onboard PHY.
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-1.00   sec  23.9 MBytes   200 Mbits/sec  446   31.1 KBytes
[  5]   1.00-2.00   sec  22.2 MBytes   186 Mbits/sec  415   32.5 KBytes
Reverse mode, TX Direction for onboard PHY.
[ ID] Interval           Transfer     Bitrate
[  5]   0.00-1.00   sec   274 MBytes  2.30 Gbits/sec
[  5]   1.00-2.00   sec   281 MBytes  2.35 Gbits/sec
ethtool -S enp3s0
NIC statistics:
     tx_packets: 6273329
     rx_packets: 1973763
     tx_errors: 1
     rx_errors: 2012
     rx_missed: 37402
     align_errors: 0
     tx_single_collisions: 0
     tx_multi_collisions: 0
     unicast: 1882159
     broadcast: 90696
     multicast: 908
     tx_aborted: 0
     tx_underrun: 0
Settings for enp3s0:
        Supported ports: [ TP ]
        Supported link modes:   10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Full
                                2500baseX/Full
        Supported pause frame use: Symmetric Receive-only
        Supports auto-negotiation: Yes
        Supported FEC modes: Not reported
        Advertised link modes:  10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Full
                                2500baseX/Full
        Advertised pause frame use: No
        Advertised auto-negotiation: Yes
        Advertised FEC modes: Not reported
        Speed: 2500Mb/s
        Duplex: Full
        Port: Twisted Pair
        PHYAD: 0
        Transceiver: internal
        Auto-negotiation: on
        MDI-X: Unknown
        Supports Wake-on: pumbg
        Wake-on: g
        Current message level: 0x00000033 (51)
                               drv probe ifdown ifup
        Link detected: yes

thx a lot!

Proxmox v7.2 installation errors

I'm attempting to install these drivers on Proxmox v7.2-1 on Debian kernel 5.15.30-2. I've also tried it on kernel 5.15-64, which results in different errors about kernel headers not being present despite them obviously being in /usr/src/.
My first attempt at installing was to follow the recommended path of adding the awesometic repository, but I cannot get this to work because there is no valid OpenPGP data found:

root@proxmox:~# add-apt-repository ppa:awesometic/ppa
 Glad to see you.

With this PPA you can install the following packages.
- realtek-r8125-dkms
- realtek-r8152-dkms

If there's an issue during using my packages, please let me know using the Github repository.
- https://github.com/awesometic
You can see the repositories for each package.

Thank you :)
 More info: https://launchpad.net/~awesometic/+archive/ubuntu/ppa
Press [ENTER] to continue or ctrl-c to cancel adding it

gpg: keybox '/tmp/tmpcqodkpqd/pubring.gpg' created
gpg: /tmp/tmpcqodkpqd/trustdb.gpg: trustdb created
gpg: key B44E6C80FF7107B6: public key "Launchpad PPA for Yang Deokgyu" imported
gpg: Total number processed: 1
gpg:               imported: 1
Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).
gpg: no valid OpenPGP data found.
root@proxmox:~# apt install realtek-r8125-dkms
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package realtek-r8125-dkms
root@proxmox:~#

Current DKMS installation attempt using ./dkms-install.sh results in this error:

Error!  Build of r8125.ko failed for: 5.15.30-2-pve (x86_64)
Make sure the name of the generated module is correct and at the root of the
build directory, or consult make.log in the build directory
/var/lib/dkms/r8125/9.010.01/build/ for more information.

In order to remove the error, I've tried installation manually by tar extraction, dkms.conf creation, and dkms add/build/install commands, but receive the same error.
I checked the make.log file in the indicated directory, but it was unhelpful:

DKMS make.log for r8125-9.010.01 for kernel 5.15.30-2-pve (x86_64)
Fri Nov 18 19:35:29 UTC 2022
make: Entering directory '/usr/src/linux-headers-5.15.30-2-pve'
  MODPOST /var/lib/dkms/r8125/9.010.01/build/Module.symvers
make: Leaving directory '/usr/src/linux-headers-5.15.30-2-pve'

I was able to successfully force the installation of the driver using the included ./install.sh script from Realtek, but I understand that will not keep the driver working after kernel upgrades, and I would like to have the ability to upgrade my Proxmox host and maintain the connectivity of the OPNsense VM.
Do you have any suggestions for a solution?

NIC keeps turning off

System:
Linux 5.10.0-13-amd64 SMP Debian 5.10.106-1 (2022-03-17) x86_64 GNU/Linux
Realtek Semiconductor Co., Ltd. RTL8125 2.5GbE Controller
Subsystem: ASRock Incorporation RTL8125 2.5GbE Controller

Behavior:
The NIC runs at 1000mb/s (limited by the connected device) and turns off after some time

Expected behavior:
The NIC runs at 1000mb/s (limited by the connected device) and stays connected.

With the default system driver the nic runs at 100mb/s

Driver seems to conflict with RPI cm4 onboard wifi

running on raspberry pi buster with RPI Compute module 4 and CM4 I/o board.

card seems to work but causes issues with the onboard cm4 wifi.

I'm using command line only buster with networkManager nmcli for setting up wifi. Works very well without the
8125 card in the PCIE slot. When the 8125 card is in the slot It stops me connecting to my wifi as a client or putting my cm4
wireless in access point mode. Again my wifi works perfectly without the 8125 card. but .... the 8125 seems to work ok
on its own if I forget about wifi and use it as a wired connection.

Very very odd.... Any clues what to look for?
thanks.

Incorrect make command does extra install

I believe this line is not quite right:
https://github.com/awesometic/realtek-r8125-dkms/blob/master/dkms.conf#L5
By having the make target all there, the install target will be built as well resulting in the .ko file being copied a second time, to something like /usr/lib/modules/5.XX.X-XX-generic/kernel/drivers/net/ethernet/realtek/r8125.ko. For me this lead to a duplicate detection, resulting in the actual module not being installed, and some secure boot signature issues. I think the correct make target is modules, see here for instance:
https://aur.archlinux.org/cgit/aur.git/tree/dkms.conf?h=r8125-dkms#n3
Changing that fixed it for me.

Driver compiled with PTP support not working

Hi,
I'm trying to get hardware timestamp support for nanoPI R5C.
i have edited Makefile changing:
ENABLE_PTP_SUPPORT = n ENABLE_PTP_MASTER_MODE = n
to
ENABLE_PTP_SUPPORT = y ENABLE_PTP_MASTER_MODE = y

Ethtool now indicates that it supports hardware timestamps. However, after less than five minutes of connecting the Ethernet cable, it suddenly stops working. I have to remove and reconnect the cable. 'ip a' reports that the interface is up, and the LED on the NIC is blinking. In 'dmesg,' there are no reports about what happened. (The last log entry is the link-up of the NIC).

Do you have any ideas about where I can find some useful logs, or is the Realtek PTP implementation broken?

Support for kernel 6.3 ?

It seems the drivers doesn't compile with kernel 6.3.

Any idea when it will be compatible ?

Many thanks for this work !!

Driver not loaded on PVE 8.1.4

I followed the Installation and successfully installed driver with Launchpad PPA and blacklisted r8169, but after I rebooted and use lspci, It turns out no kernel driver in use, any idea to resolve this?
root@Main:~# lspci -s 02:00.0 -k
02:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8125 2.5GbE Controller (rev 05)
Subsystem: Realtek Semiconductor Co., Ltd. RTL8125 2.5GbE Controller
Kernel modules: r8169, r8125

Very good Makefile. Make my kernel upgrade failed

dkms use 'make' -j16 KVER=x.x.x-xxxxxx BSRC=/lib/modules/x.x.x-xxxxxx to run Makefile. please use KVER instead of uname -r

here is my diff file

diff --git a/Makefile b/Makefile
index 3aa0954..161fde3 100755
--- a/Makefile
+++ b/Makefile
@@ -30,26 +30,27 @@
 #  US6,570,884, US6,115,776, and US6,327,625.
 ################################################################################
 
-KFLAG := 2$(shell uname -r | sed -ne 's/^2\.[4]\..*/4/p')x
+KVER ?= 2$(shell uname -r | sed -ne 's/^2\.[4]\..*/4/p')x
+export KVER = ${KFLAG}
 
 all: clean modules install
 
 modules:
-ifeq ($(KFLAG),24x)
+ifeq ($(KVER),24x)
        $(MAKE) -C src/ -f Makefile_linux24x modules
 else
        $(MAKE) -C src/ modules
 endif
 
 clean:
-ifeq ($(KFLAG),24x)
+ifeq ($(KVER),24x)
        $(MAKE) -C src/ -f Makefile_linux24x clean
 else
        $(MAKE) -C src/ clean
 endif
 
 install:
-ifeq ($(KFLAG),24x)
+ifeq ($(KVER),24x)
        $(MAKE) -C src/ -f Makefile_linux24x install
 else
        $(MAKE) -C src/ install
diff --git a/src/Makefile b/src/Makefile
index 5175cf2..483360b 100755
--- a/src/Makefile
+++ b/src/Makefile
@@ -132,7 +132,8 @@ ifneq ($(KERNELRELEASE),)
                EXTRA_CFLAGS += -DENABLE_RX_PACKET_FRAGMENT
        endif
 else
-       BASEDIR := /lib/modules/$(shell uname -r)
+       KVER ?= $(shell uname -r)
+       BASEDIR ?= /lib/modules/${KVER}
        KERNELDIR ?= $(BASEDIR)/build
        PWD :=$(shell pwd)
        DRIVERDIR := $(shell find $(BASEDIR)/kernel/drivers/net/ethernet -name realtek -type d)
@@ -147,7 +148,6 @@ else
        KERNEL_GCC_VERSION := $(shell cat /proc/version | sed -n 's/.*gcc version \([[:digit:]]\.[[:digit:]]\.[[:digit:]]\).*/\1/p')
        CCVERSION = $(shell $(CC) -dumpversion)
 
-       KVER = $(shell uname -r)
        KMAJ = $(shell echo $(KVER) | \
        sed -e 's/^\([0-9][0-9]*\)\.[0-9][0-9]*\.[0-9][0-9]*.*/\1/')
        KMIN = $(shell echo $(KVER) | \

test on archlinux. upgraded linux (6.5.9.arch2-1 -> 6.6.2.arch1-1)

Throughput monitoring issue

Hello,

I am running the latest version 9.011.00-NAPI with kernel 6.1 and it shows wrong values for the throughput. The nic is connected to a 1GBit switch.
With the kernels default driver r8169 the throughput monitoring tools show typically around 115MB/s. With the r8125 driver, it shows multiple hundred Gigabyte/s. It changes between 300-700 GB/s.

Driver

root@nightowl ~# ethtool -i ens4
driver: r8125
version: 9.011.00-NAPI
firmware-version:
expansion-rom-version:
bus-info: 0000:01:00.0
supports-statistics: yes
supports-test: no
supports-eeprom-access: no
supports-register-dump: yes
supports-priv-flags: no

pci device

root@nightowl ~# lspci -s 01:00.0 -k
01:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8125 2.5GbE Controller (rev 05)
	Subsystem: Realtek Semiconductor Co., Ltd. RTL8125 2.5GbE Controller
	Kernel driver in use: r8125
	Kernel modules: r8169, r8125

Example wrong value.

  bwm-ng v0.6.3 (probing every 0.500s), press 'h' for help
  input: /proc/net/dev type: rate
  -         iface                   Rx                   Tx                Total
  ==============================================================================
               lo:           0.00  B/s            0.00  B/s            0.00  B/s
             ens4:         635.39 GB/s          546.15 KB/s          635.39 GB/s
             ens5:           0.00  B/s            0.00  B/s            0.00  B/s
  ------------------------------------------------------------------------------
            total:         635.39 GB/s          546.15 KB/s          635.39 GB/s

Any idea if I am doing something wrong, or is this a known issue?

Unable to locate package realtek-r1825-dkms

I'm trying to install via the Launchpad PPA and I'm getting the subject error.

root@:-# add-apt-repository ppa:awesometic/ppa
 Glad to see you.

With this PPA you can install the following packages.
- realtek-r8125-dkms
- realtek-r8152-dkms

If there's an issue during using my packages, please let me know using the Github repository.
- https://github.com/awesometic
You can see the repositories for each package.

Thank you :)
 More info: https://launchpad.net/~awesometic/+archive/ubuntu/ppa
Press [ENTER] to continue or ctrl-c to cancel adding it

gpg: keybox '/tmp/tmp_uuag26b/pubring.gpg' created
gpg: /tmp/tmp_uuag26b/trustdb.gpg: trustdb created
gpg: key B44E6C80FF7107B6: public key "Launchpad PPA for Yang Deokgyu" imported
gpg: Total number processed: 1
gpg:               imported: 1
Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).
gpg: no valid OpenPGP data found.

root@:~# apt install realtek-r8125-dkms
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package realtek-r8125-dkms

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.