Good driver for Realtek r8169 on x86_64

This is not a bug with DietPi but a request for some help on getting the right driver in place.

Setup:

  • DietPi version | 8.13.2 beta
  • Distro version | bullseye
  • Kernel version | Linux HomeAssistant 5.10.0-21-amd64 #1 SMP Debian 5.10.162-1 (2023-01-21) x86_64 GNU/Linux
  • System: Giada i56V (mini PC based on Intel i3-4010u)
  • Hard Drive: Kingston SSD

Additional Information

  • System is based on a Giada i56v mini pc, with an Intel i3-4010u CPU, a Realtek r8169-type network card, a Kingston SSD, a Conbee II stick
  • Software is based on a virgin DietPi install with Home Assistant & Supervisor on top

The issue lies in the fact that the system doesn’t go towards the maximum C-state when possible

This appears to be linked to a driver issue for the r8169 and on PCIe port 4:

root@HomeAssistant:~# lspci -vv | awk '/ASPM/{print $0}' RS= | grep --color -P '(^[a-z0-9:.]+|ASPM )'
00:1c.0 PCI bridge: Intel Corporation 8 Series PCI Express Root Port 1 (rev e4) (prog-if 00 [Normal decode])
                LnkCap: Port #1, Speed 5GT/s, Width x1, ASPM L0s L1, Exit Latency L0s <1us, L1 <4us
                LnkCtl: ASPM L0s L1 Enabled; RCB 64 bytes, Disabled- CommClk-
00:1c.2 PCI bridge: Intel Corporation 8 Series PCI Express Root Port 3 (rev e4) (prog-if 00 [Normal decode])
                LnkCap: Port #3, Speed 5GT/s, Width x1, ASPM L0s L1, Exit Latency L0s <512ns, L1 <16us
                LnkCtl: ASPM L0s L1 Enabled; RCB 64 bytes, Disabled- CommClk+
00:1c.3 PCI bridge: Intel Corporation 8 Series PCI Express Root Port 4 (rev e4) (prog-if 00 [Normal decode])
                LnkCap: Port #4, Speed 5GT/s, Width x1, ASPM L0s L1, Exit Latency L0s <512ns, L1 <16us
                LnkCtl: **ASPM Disabled;** RCB 64 bytes, Disabled- CommClk+
02:00.0 Network controller: Qualcomm Atheros AR9485 Wireless Network Adapter (rev 01)
                LnkCap: Port #0, Speed 2.5GT/s, Width x1, ASPM L0s L1, Exit Latency L0s <4us, L1 <64us
                LnkCtl: ASPM L0s L1 Enabled; RCB 64 bytes, Disabled- CommClk+
pcilib: sysfs_read_vpd: read failed: Input/output error
03:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 07)
                LnkCap: Port #0, Speed 2.5GT/s, Width x1, ASPM L0s L1, Exit Latency L0s unlimited, L1 <64us
                LnkCtl: **ASPM Disabled;** RCB 64 bytes, Disabled- CommClk+

Does anyone have some guidance as to how to address this?
THere appears to be an ‘ElRepo’ modded driver but I am not sure that’ll work on DietPi…

Thanks in advance!

Usually all Debian driver for amd64/x86 should work same way on DietPi.

You can install and build the drivers in debian pretty readily

Debian – Details of package r8168-dkms in stretch

This package provides the dkms source code for the r8168 kernel modules. Kernel source or headers are required to compile these modules.

If update updates the kernel, dkms should automatically rebuild the kernel module for the new kernel before reboot keeping it updated and in working order

might need to add non-free to the apt lists to get it to update the dkms driver update

I think they have a binary already built, might try that as well
Debian – Details of package firmware-realtek in stretch

Small update for those who’d be interested: in the ned I upgraded to another system, but with the same situation: the system provided the generic r8169 driver whereas the r8168 was more suitable.

In the end I got the latest official r8168 driver (which includes a very easy to use bash script to install) and had to disable safe boot mode and all was well. (I also tried the dkms which didn’t work out, but I seem to remember I might not have figured out that I needed to disable safe boot yet, so dkms might also work…)

Thanks for the good input!

1 Like

Jep, usually it is not that hard. Without DKMS one just needs to repeat it after every kernel upgrade or put an own script into /etc/kernel/postinst.d.

One point that is rather relevant: seems all drivers I’ve found don’t work for kerel 6.x.
I had to look for a solution and change the files before building it. That’s presumably why DKMS didn’t work…

Second point: can’t get the Pkg C state of the system beyond C3 with this NIC. Once disabled in the BIOS, the system sails to C9 (and maybe would do C10, I never waited long enough). All of this despite the card reporting ASPM capability. No solution found so far. FWIW