XCP-ng
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    What to do about Realtek RTL8125 RTL8126 RTL8127 drivers

    Scheduled Pinned Locked Moved XCP-ng
    5 Posts 3 Posters 830 Views 3 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • A Online
      Andrew Top contributor
      last edited by

      @olivierlambert Realtek has released three related ethernet PCI chips: RTL8125 (2.5G), RTL8126 (5G), RTL8127 (10G).

      Realtek started with a single driver that supported the 8125 and 8126 as they are closely related. The current XCP driver is based on that single set of code. Now they have split the code into three different drivers.

      The problem is they have released new versions of the RTL8125 that require new driver code to work. This already caused problem in the mainline upstream Linux and required updates to the kernel driver (early 2025) and at least one XCP user has hit this problem on a desktop board. Since XCP is using the vendor driver, the question is what to do next:

      1. Do nothing and let people use other ethernets
      2. Make a new alt-driver for only the 8125 chip (no 8126 support), leave the old 8125 driver alone (maybe for 8.2?)
      3. Use the new Realtek 8125 code and add new drivers for the 8126 and 8127 (maybe for 8.3?)
      4. ???

      The path forward could be different for XCP 8.3 vs. 8.2.1 ...

      S 1 Reply Last reply Reply Quote 0
      • S Offline
        snowstruk @Andrew
        last edited by olivierlambert

        @Andrew I bought a RTL8126 5G card (because of the price) for my home lab that doesn't appear to be working with 8.3 like you said. It is trying to use the r8125 driver.

        [08:53 tw-xcp-ng-02 ~]# ethtool -i eth2
        driver: r8125
        version: 9.012.04-NAPI-PTP-RSS
        firmware-version: 
        expansion-rom-version: 
        bus-info: 0000:02:00.0
        supports-statistics: yes
        supports-test: no
        supports-eeprom-access: no
        supports-register-dump: yes
        supports-priv-flags: no
        

        I removed the r8125 driver and manually installed the r8126 driver which I downloaded from here. I can see the interface using the driver, and it shows the 5G capabilities of the driver, however I cannot get this to negotiate the speed (see below). I have tried this with a 2.5G switch and a 10G switch. The 10G switch can negotiate down to 5G so that shouldn't be an issue. On both switches it shows its connection as just fast ethernet. If I manually set the port on the switch to 5G I will not even get a link light.

        Would you happen to have any suggestions or ideas to get the card working?

        [09:49 tw-xcp-ng-02 ~]# ethtool -i eth2
        driver: r8126
        version: 10.015.00-NAPI
        firmware-version: 
        expansion-rom-version: 
        bus-info: 0000:02:00.0
        supports-statistics: yes
        supports-test: no
        supports-eeprom-access: no
        supports-register-dump: yes
        supports-priv-flags: no
        
        [09:46 tw-xcp-ng-02 ~]# ethtool eth2
        Settings for eth2:
        	Supported ports: [ TP ]
        	Supported link modes:   10baseT/Half 10baseT/Full 
        	                        100baseT/Half 100baseT/Full 
        	                        1000baseT/Full 
        	                        2500baseX/Full 
        	                        2500baseT/Full 
        	                        5000baseT/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/Half 1000baseT/Full 
        	                        2500baseX/Full 
        	                        2500baseT/Full 
        	                        5000baseT/Full 
        	Advertised pause frame use: No
        	Advertised auto-negotiation: Yes
        	Advertised FEC modes: Not reported
        	Speed: Unknown!
        	Duplex: Unknown! (255)
        	Port: Twisted Pair
        	PHYAD: 0
        	Transceiver: internal
        	Auto-negotiation: on
        	MDI-X: on
        	Supports Wake-on: pumbg
        	Wake-on: d
        	Current message level: 0x00000033 (51)
        			       drv probe ifdown ifup
        	Link detected: no
        
        [09:52 tw-xcp-ng-02 ~]# lspci | grep Ethernet
        00:1f.6 Ethernet controller: Intel Corporation Ethernet Connection (17) I219-LM (rev 11)
        02:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. Device 8126 (rev 01)
        03:00.0 Ethernet controller: Intel Corporation Ethernet Controller I225-V (rev 03)
        A 1 Reply Last reply Reply Quote 0
        • A Online
          Andrew Top contributor @snowstruk
          last edited by

          @snowstruk The stock XCP 8.3 r8125 driver works for my 8125 and 8126 devices. I have not tried it a 5G, so it's possible the 8126 is not working at 5G (I don't see it advertised) with the current driver.

          I have run the current dedicated realtek 8125 driver and it works but I have not tried the 8126 driver. I don't know how many people are using the 8126 chipset (I guess not many).

          If your device is not working at >1G then it sees to be a hardware incompatibility issue. You could try loading the new 8126 firmware to see if that helps.

          Here's the output about my test 8126 card (attached to a 2.5G switch):

          # lspci -v -s 04:00.0
          04:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8126 5GbE Controller (rev 01)
                  Subsystem: Realtek Semiconductor Co., Ltd. Device 0123
                  Flags: bus master, fast devsel, latency 0, IRQ 18
                  I/O ports at 3000 [size=256]
                  Memory at e0d00000 (64-bit, non-prefetchable) [size=64K]
                  Memory at e0d10000 (64-bit, non-prefetchable) [size=16K]
                  Expansion ROM at e0d20000 [disabled] [size=64K]
                  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=32 Masked-
                  Capabilities: [d0] Vital Product Data
                  Capabilities: [100] Advanced Error Reporting
                  Capabilities: [148] Virtual Channel
                  Capabilities: [170] Device Serial Number 01-00-00-00-b4-b3-c9-88
                  Capabilities: [180] #19
                  Capabilities: [190] Transaction Processing Hints
                  Capabilities: [21c] Latency Tolerance Reporting
                  Capabilities: [224] L1 PM Substates
                  Capabilities: [234] Vendor Specific Information: ID=0002 Rev=4 Len=100 <?>
                  Kernel driver in use: r8125
                  Kernel modules: r8125
          
          # ethtool -i eth1
          driver: r8125
          version: 9.012.04-NAPI-PTP-RSS
          firmware-version: rtl8126a-2_0.0.2 02/01/24
          expansion-rom-version:
          bus-info: 0000:04:00.0
          supports-statistics: yes
          supports-test: no
          supports-eeprom-access: no
          supports-register-dump: yes
          supports-priv-flags: no
          
          # ethtool eth1
          Settings for eth1:
                  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: Symmetric Receive-only
                  Advertised auto-negotiation: Yes
                  Advertised FEC modes: Not reported
                  Link partner advertised link modes:  10baseT/Half 10baseT/Full
                                                       100baseT/Half 100baseT/Full
                                                       1000baseT/Full
                                                       2500baseX/Full
                  Link partner advertised pause frame use: Symmetric Receive-only
                  Link partner advertised auto-negotiation: Yes
                  Link partner 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
          
          1 Reply Last reply Reply Quote 0
          • stormiS Offline
            stormi Vates 🪐 XCP-ng Team
            last edited by stormi

            I've had this thread in my TODO list for long.

            I'm not sure what the different options we have mean for users.

            As r8125-module is installed by default, we'll want to avoid breaking it for existing users. Would using the new code risk causing regressions? Maybe that's what you meant but I'm not sure. Does our current r8125 driver support both 8125 and 8126, and not 8127? Or just 8125?

            If we can't update the driver without causing regressions, then can we offer an alternate driver based on the new code for each chip (8125, 8126, 8127), and what amount of work might this represent?

            The target would be XCP-ng 8.3. In XCP-ng 9.0 we'll have a newer kernel and newer drivers anyway.

            CCing @Team-Hypervisor-Kernel for their opinion.

            A 1 Reply Last reply Reply Quote 0
            • A Online
              Andrew Top contributor @stormi
              last edited by

              @stormi Unless new Dom0 is Kernel 6.15 or newer (with updates), this will be an ongoing problem to support the newest hardware as they seem to keep updating the chips (you can't stop progress).

              The current r8125 driver in 8.2/8.3 supports the 8125 and some 8126 chips, but not 8127. Other than supporting the new hardware versions of the chips, I have not seen any real complaints posted about the current r8125 driver (may be there are some Vates tickets?)

              While the risk on the new driver is low, it is different (not just an update). I agree that it would be best to have r8125-module-alt for the new code and then r8126-module and r8127-module.

              Note, that the new r8126-module driver should not be installed without the r8125-module-alt as the existing r8125-module would conflict with the new r8126-module driver.

              The work is already done (compiled and running)... I'm just waiting for Realtek to fix some issues with the new code before it's worth fully testing the drivers (issues already acknowledged by Realtek).

              1 Reply Last reply Reply Quote 0
              • First post
                Last post