Issues with Realtek 8168

Tim89

New Member
Aug 31, 2024
4
0
1
Hi!
I know there are lots of topics and tutorials which I have reviewed and I have an issue with installing the driver.
I am on 6.8.12-2-pve currently, and ran
Code:
apt install r8168-dkms
after adding the appropriate repos.
Afterwards, I ran
Code:
apt install pve-headers
Here is the output:

Code:
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
pve-headers is already the newest version (8.2.0).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up r8168-dkms (8.051.02-2) ...
Removing old r8168-8.051.02 DKMS files...
Deleting module r8168-8.051.02 completely from the DKMS tree.
Loading new r8168-8.051.02 DKMS files...
Building for 6.8.12-2-pve
Building initial module for 6.8.12-2-pve
Error! Bad return status for module build on kernel: 6.8.12-2-pve (x86_64)
Consult /var/lib/dkms/r8168/8.051.02/build/make.log for more information.
dpkg: error processing package r8168-dkms (--configure):
 installed r8168-dkms package post-installation script subprocess returned error exit status 10
Processing triggers for initramfs-tools (0.142+deb12u1) ...
update-initramfs: Generating /boot/initrd.img-6.8.12-2-pve
Running hook script 'zz-proxmox-boot'..
Re-executing '/etc/kernel/postinst.d/zz-proxmox-boot' in new private mount namespace..
No /etc/kernel/proxmox-boot-uuids found, skipping ESP sync.
Errors were encountered while processing:
 r8168-dkms
E: Sub-process /usr/bin/dpkg returned an error code (1)

The referenced make.log content is:
Code:
DKMS make.log for r8168-8.051.02 for kernel 6.8.12-2-pve (x86_64)
Mon Sep 23 08:55:01 PM CEST 2024
make: Entering directory '/usr/src/linux-headers-6.8.12-2-pve'
  CC [M]  /var/lib/dkms/r8168/8.051.02/build/r8168_n.o
  CC [M]  /var/lib/dkms/r8168/8.051.02/build/r8168_asf.o
  CC [M]  /var/lib/dkms/r8168/8.051.02/build/rtl_eeprom.o
  CC [M]  /var/lib/dkms/r8168/8.051.02/build/rtltool.o
/var/lib/dkms/r8168/8.051.02/build/rtl_eeprom.c:96:5: warning: no previous prototype for ‘rtl8168_eeprom_cmd_done’ [-Wmissing-prototypes]
   96 | int rtl8168_eeprom_cmd_done(struct rtl8168_private *tp)
      |     ^~~~~~~~~~~~~~~~~~~~~~~
/var/lib/dkms/r8168/8.051.02/build/r8168_n.c:2110:5: warning: no previous prototype for ‘mdio_real_read’ [-Wmissing-prototypes]
 2110 | u32 mdio_real_read(struct rtl8168_private *tp,
      |     ^~~~~~~~~~~~~~
/var/lib/dkms/r8168/8.051.02/build/r8168_n.c: In function ‘rtl8168_get_drvinfo’:
/var/lib/dkms/r8168/8.051.02/build/r8168_n.c:5229:17: error: implicit declaration of function ‘strlcpy’; did you mean ‘strscpy’? [-Werror=implicit-function-declaratio>
 5229 |                 strlcpy(info->fw_version, rtl_fw->version,
      |                 ^~~~~~~
      |                 strscpy
/var/lib/dkms/r8168/8.051.02/build/r8168_n.c: In function ‘r8168_csum_workaround’:
/var/lib/dkms/r8168/8.051.02/build/r8168_n.c:29208:24: error: implicit declaration of function ‘skb_gso_segment’; did you mean ‘skb_gso_reset’? [-Werror=implicit-func>
29208 |                 segs = skb_gso_segment(skb, features);
      |                        ^~~~~~~~~~~~~~~
      |                        skb_gso_reset
/var/lib/dkms/r8168/8.051.02/build/r8168_n.c:29208:22: warning: assignment to ‘struct sk_buff *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversio>
29208 |                 segs = skb_gso_segment(skb, features);
      |                      ^
cc1: some warnings being treated as errors
make[2]: *** [scripts/Makefile.build:243: /var/lib/dkms/r8168/8.051.02/build/r8168_n.o] Error 1
make[1]: *** [/usr/src/linux-headers-6.8.12-2-pve/Makefile:1925: /var/lib/dkms/r8168/8.051.02/build] Error 2
make: *** [Makefile:240: __sub-make] Error 2
make: Leaving directory '/usr/src/linux-headers-6.8.12-2-pve'

Code:
lspci -nnk
shows me this:
Code:
03:00.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller [10ec:8168] (rev 2b)
        Subsystem: Realtek Semiconductor Co., Ltd. RTL8111/8168/8211/8411 PCI Express Gigabit Ethernet Controller [10ec:0123]
        Kernel modules: r8168

Well, at least it's not trying to use 8169 as earlier. What can I do here, how to proceed?
Thank you.
 
The only workaround I found is using the old 6.2 kernel. Then you can build and install the dkms module manually.

Bash:
apt install -y pve-headers-6.2 proxmox-kernel-6.2

dkms build -m r8168 -v 8.051.02 -k 6.2.16-20-pve
dkms install -m r8168 -v 8.051.02 -k 6.2.16-20-pve

update-initramfs -uk "6.2.16-20-pve"

# Modify grub to boot from 6.2 by default
edit /boot/grub.cfg

# Not sure which (kernel-)packages to hold
apt-mark hold proxmox-default-kernel
apt-mark hold proxmox-kernel-6.8
 
I got it working using the method at the following link.
I did have to make a small modification and have not tested actual performance... Just ping and webgui.
https://gist.github.com/tushroy/69f84ee5955e76396f3b0f41ad9b731a
  • The r8168_8.053.00-1 links all fail. Instead replace it with "-2" everywhere you see "-1" in his script.
  • I had to use the compile method. There were too many errors just trying to install.
  • There were two dependencies missing. I just did an apt install for both of them.
  • The GRUB kernel parameters were required to make it work.
 
I got it working using the method at the following link.
I did have to make a small modification and have not tested actual performance... Just ping and webgui.
https://gist.github.com/tushroy/69f84ee5955e76396f3b0f41ad9b731a
  • The r8168_8.053.00-1 links all fail. Instead replace it with "-2" everywhere you see "-1" in his script.
  • I had to use the compile method. There were too many errors just trying to install.
  • There were two dependencies missing. I just did an apt install for both of them.
  • The GRUB kernel parameters were required to make it work.
Thank you. 8.054 is out since, but can't make it according to the instructions - signature issues. Installed the deb - no go, dependency on PVE not up do date yet. Installed 8.053 deb regularly - not encountering the errors pre 6.11 kernel.
 
I still don't understand what I need to do. Installed the drivers, here is the "lspci -v" output relevant to the card:

03:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 2b)
Subsystem: Realtek Semiconductor Co., Ltd. RTL8111/8168/8211/8411 PCI Express Gigabit Ethernet Controller
Flags: bus master, fast devsel, latency 0, IRQ 255, IOMMU group 14
I/O ports at 3000 [size=256]
Memory at 80b04000 (64-bit, non-prefetchable) [size=4K]
Memory at 80b00000 (64-bit, non-prefetchable) [size=16K]
Capabilities: [40] Power Management version 3
Capabilities: [50] MSI: Enable- Count=1/1 Maskable- 64bit+
Capabilities: [70] Express Endpoint, MSI 01
Capabilities: [b0] MSI-X: Enable- Count=4 Masked-
Capabilities: [100] Advanced Error Reporting
Capabilities: [140] Virtual Channel
Capabilities: [160] Device Serial Number 01-00-00-00-68-4c-e0-00
Capabilities: [170] Latency Tolerance Reporting
Capabilities: [178] L1 PM Substates
Kernel modules: r8168

Now, what I can gather is that it is missing the line: "Kernel driver in use:" - all my other hardware has it.
What do I need to do at this point?