[SOLVED] Proxmox 8 beta & Realtek RTL8156 / RTL8156B(S)(G) unter Kernel 6.2.x

darkiop

Member
Apr 3, 2020
12
2
8
43
Hallo und einen guten Morgen,
ich habe auf einer meiner Testgeräte (ein Intel Nuc 8) die Proxmox Beta 8 installiert und wollte nun das Kernel Modul für meinen USB-Lan Adapter zu bauen. Dieses Modul wird benötigt um den Adapter im Full-Duplex Mode zu nutzen.

Beim bauen des Moduls unter Kernel 6.2.x wirft make folgenden Fehler (allerdings steht auch auf der Realtek Webseite, das es nur für Kernel 5.17 gedacht ist, https://www.realtek.com/en/componen...0-100-1000m-gigabit-ethernet-usb-3-0-software).

Aber vielleicht hat doch jemand eine idee?

Alternative wäre, den 5.x Kernel unter Proxmox zu verwenden, allerdings fehlen da die entsprechenden headers für den Kernel 5.15,x.

Code:
make -C /lib/modules/6.2.16-1-pve/build M=/root/r8152-2.16.3 modules
make[1]: Entering directory '/usr/src/linux-headers-6.2.16-1-pve'
  CC [M]  /root/r8152-2.16.3/r8152.o
/root/r8152-2.16.3/r8152.c: In function ‘sg_en_store’:
/root/r8152-2.16.3/r8152.c:20462:9: error: implicit declaration of function ‘netif_set_gso_max_size’; did you mean ‘netif_set_tso_max_size’? [-Werror=implicit-function-declaration]
20462 |         netif_set_gso_max_size(netdev, tso_size);
      |         ^~~~~~~~~~~~~~~~~~~~~~
      |         netif_set_tso_max_size
/root/r8152-2.16.3/r8152.c: In function ‘rtl8152_probe’:
/root/r8152-2.16.3/r8152.c:20704:17: error: too many arguments to function ‘netif_napi_add’
20704 |                 netif_napi_add(netdev, &tp->napi, r8152_poll, 256);
      |                 ^~~~~~~~~~~~~~
In file included from /root/r8152-2.16.3/r8152.c:16:
./include/linux/netdevice.h:2588:1: note: declared here
 2588 | netif_napi_add(struct net_device *dev, struct napi_struct *napi,
      | ^~~~~~~~~~~~~~
/root/r8152-2.16.3/r8152.c:20706:17: error: too many arguments to function ‘netif_napi_add’
20706 |                 netif_napi_add(netdev, &tp->napi, r8152_poll, 64);
      |                 ^~~~~~~~~~~~~~
./include/linux/netdevice.h:2588:1: note: declared here
 2588 | netif_napi_add(struct net_device *dev, struct napi_struct *napi,
      | ^~~~~~~~~~~~~~
cc1: some warnings being treated as errors
make[2]: *** [scripts/Makefile.build:260: /root/r8152-2.16.3/r8152.o] Error 1
make[1]: *** [Makefile:2026: /root/r8152-2.16.3] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-6.2.16-1-pve'
make: *** [Makefile:24: modules] Error 2
 
Dieses Modul wird benötigt um den Adapter im Full-Duplex Mode zu nutzen.
Ist das wirklich noch notwendig? - habe so einen Adapter leider nicht zur hand um es zu testen - aber auch wenn neuere realtek NICs immer eine Weile brauchen, bis die in-tree treiber mit ihnen auch vernünftig funktionieren, würde ich auf jeden Fall mal schauen, wie es ganz ohne dem dkms modul funktioniert. (kurzer blick ins git log des pve-kernel-6.2 zeigt, dass sich beim nic-modell r8152 in letzter Zeit durchaus etwas getan hat)

Ansonsten: PVE 8 wird initial auf den 6.2 kernel setzen und der 5.15 ist weder im Repository noch wird er mit PVE 8 getestet werden.

Ich hoffe das hilft!
 
Guten Morgen,
sorry für die späte Antwort meinerseits - bin leider erst heut Morgen wieder dazu gekommen.

Danke für deinen Hinweis, darauf hin habe ich nochmal geschaut und die Lösung gefunden:

https://github.com/wget/realtek-r8152-linux

Die in diesem Repo vorhandene Udev-Regel muss unter /etc/udev/rules.d abgelegt werden. Dann wird nach einen Reboot nicht der Standard USB Treiber, sondern der Realtek Treiber geladen.
 
  • Like
Reactions: Tux_1024
I was having a similar issue. I'm running a NUC 12 pro and have a Belkin USB-C to ethernet adapter with the RTL8156B chipset.
Running Proxmox 8.1.3 and a pfsense 2.7.2. I had shared the pfsense VM direct access to the network adapter (added as a USB device) and I got the same half duplex and packet drops.
Then I tried to create a bridge on the usb adapter and use that in my pfsense vm (as a VirtIO card) instead... problem solved.
`inxi -n` on the host shows it's using the correct r8152 driver and my traffic has never been smoother. I suppose the underlying FreeBSD from pfsense just doesn't have a good driver for this chipset yet.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!