You are not logged in.

#1 2021-03-21 14:58:38

johan.cb
Member
From: Leipzig, Germany
Registered: 2016-07-10
Posts: 62

[SOLVED] 2.5 Gbit/s NIC autonegotiating only 1 Gbit/s

Hello forum members,


I recently bought a new modem/router with a 2.5GBASE-T port and a matching NIC capable of handling those speeds.
The issue I am facing is that my NIC does not seem to properly negotiate the 2.5 Gbit speed and falls back on 1 Gbit/s.

Kernel version:

Linux Johan-PC 5.11.7-arch1-1 #1 SMP PREEMPT Wed, 17 Mar 2021 16:59:58 +0000 x86_64 GNU/Linux

Network card:

 05:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8125 2.5GbE Controller (rev 04)

ethtool details:

Settings for enp5s0:
	Supported ports: [ TP	 MII ]
	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: 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/Half 1000baseT/Full
	                                     2500baseT/Full
	Link partner advertised pause frame use: Symmetric
	Link partner advertised auto-negotiation: Yes
	Link partner advertised FEC modes: Not reported
	Speed: 1000Mb/s
	Duplex: Full
	Auto-negotiation: on
	master-slave cfg: preferred slave
	master-slave status: slave
	Port: MII
	PHYAD: 0
	Transceiver: external
	Supports Wake-on: pumbg
	Wake-on: d
	Link detected: yes

dmesg extract:

[    2.042181] libphy: r8169: probed
[    2.042371] r8169 0000:05:00.0 eth0: RTL8125B, 00:e0:4c:68:00:eb, XID 641, IRQ 120
[    2.042374] r8169 0000:05:00.0 eth0: jumbo features [frames: 9194 bytes, tx checksumming: ko]
[    2.126333] r8169 0000:05:00.0 enp5s0: renamed from eth0
[    2.443014] RTL8226B_RTL8221B 2.5Gbps PHY r8169-500:00: attached PHY driver (mii_bus:phy_addr=r8169-500:00, irq=IGNORE)
[    2.603157] r8169 0000:05:00.0 enp5s0: Link is Down
[    5.555640] r8169 0000:05:00.0 enp5s0: Link is Up - 2.5Gbps/Full - flow control rx/tx
[    5.557284] r8169 0000:05:00.0 enp5s0: Link is Down
[    7.951288] r8169 0000:05:00.0 enp5s0: Link is Up - 1Gbps/Full - flow control rx/tx 

I am able to force the 2.5 Gbit link speed with following command successfully until the next reboot:

sudo ethtool -s enp5s0 speed 2500 duplex full

which gives me following ethtool output:

Settings for enp5s0:
	Supported ports: [ TP	 MII ]
	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:  2500baseT/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/Half 1000baseT/Full
	                                     2500baseT/Full
	Link partner advertised pause frame use: Symmetric
	Link partner advertised auto-negotiation: Yes
	Link partner advertised FEC modes: Not reported
	Speed: 2500Mb/s
	Duplex: Full
	Auto-negotiation: on
	master-slave cfg: preferred slave
	master-slave status: slave
	Port: MII
	PHYAD: 0
	Transceiver: external
	Supports Wake-on: pumbg
	Wake-on: d
	Link detected: yes

Auto-negotiation seems to be properly set up and I am not experiencing any instabilities after forcing the link speed to 2.5 Gbit/s.

Any ideas on how to set auto negotiation to 2.5 Gbit for my link?

Last edited by johan.cb (2021-06-21 07:37:27)

Offline

#2 2021-03-21 16:49:33

hkall
Member
Registered: 2019-11-11
Posts: 18

Re: [SOLVED] 2.5 Gbit/s NIC autonegotiating only 1 Gbit/s

Which kernel version do we talk about? And which firmware version is in use? (ethtool -i enp5s0)

What looks starnge is that the 2.5Gbps mode isn't advertised. Something removed the mode. Maybe some network manager issue. Can you try it manually, w/o a network manager?
Make sure that 2.5Gbps is advertised (in aneg mode), and bring up the link with "ip link set enp5s0 up".

Offline

#3 2021-03-21 17:08:19

progandy
Member
Registered: 2012-05-17
Posts: 5,190

Re: [SOLVED] 2.5 Gbit/s NIC autonegotiating only 1 Gbit/s

If the driver does not add 2.5Gbps to the auto-negotiation, you could try to change the advertised modes like this:

ethtool -s enp5s0 advertise 0x80000000002f

| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

#4 2021-03-21 17:52:47

hkall
Member
Registered: 2019-11-11
Posts: 18

Re: [SOLVED] 2.5 Gbit/s NIC autonegotiating only 1 Gbit/s

The driver per default advertises everything that is supported. And initially 2.5Gbps are auto-negotiated. But as soon as the link is up some tool seems to remove the 2.5Gbps mode (maybe because it's not aware of speeds >1Gbps yet).

Offline

#5 2021-03-21 17:53:40

hkall
Member
Registered: 2019-11-11
Posts: 18

Re: [SOLVED] 2.5 Gbit/s NIC autonegotiating only 1 Gbit/s

The driver per default advertises everything that is supported. And initially 2.5Gbps are auto-negotiated. But as soon as the link is up some tool seems to remove the 2.5Gbps mode (maybe because it's not aware of speeds >1Gbps yet).

Offline

#6 2021-03-21 20:08:35

johan.cb
Member
From: Leipzig, Germany
Registered: 2016-07-10
Posts: 62

Re: [SOLVED] 2.5 Gbit/s NIC autonegotiating only 1 Gbit/s

I am currently running the latest kernel:

Linux Johan-PC 5.11.7-arch1-1 #1 SMP PREEMPT Wed, 17 Mar 2021 16:59:58 +0000 x86_64 GNU/Linux

Indeed the first autonegotiated speed seems to be 2.5 Gbps and something (NetworkManager?) puts it back to 1Gbps.

And which firmware version is in use? (ethtool -i enp5s0)

johan@Johan-PC : ~ ethtool -i enp5s0
driver: r8169
version: 5.11.7-arch1-1
firmware-version: rtl8125b-2_0.0.2 07/13/20
expansion-rom-version: 
bus-info: 0000:05:00.0
supports-statistics: yes
supports-test: no
supports-eeprom-access: no
supports-register-dump: yes
supports-priv-flags: no

Offline

#7 2021-03-21 20:28:32

johan.cb
Member
From: Leipzig, Germany
Registered: 2016-07-10
Posts: 62

Re: [SOLVED] 2.5 Gbit/s NIC autonegotiating only 1 Gbit/s

If the driver does not add 2.5Gbps to the auto-negotiation, you could try to change the advertised modes like this:

ethtool -s enp5s0 advertise 0x80000000002f

Resultet in following change:

johan@Johan-PC : ~ ethtool enp5s0
Settings for enp5s0:
        Supported ports: [ TP    MII ]
        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
                                2500baseT/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/Half 1000baseT/Full
                                             2500baseT/Full
        Link partner advertised pause frame use: Symmetric
        Link partner advertised auto-negotiation: Yes
        Link partner advertised FEC modes: Not reported
        Speed: 2500Mb/s
        Duplex: Full
        Auto-negotiation: on
        master-slave cfg: preferred slave
        master-slave status: slave
        Port: MII
        PHYAD: 0
        Transceiver: external
netlink error: Operation not permitted
        Link detected: yes

And my link is immediately up at 2.5Gbps

[18587.675747] r8169 0000:05:00.0 enp5s0: Link is Down
[18590.539062] r8169 0000:05:00.0 enp5s0: Link is Up - 2.5Gbps/Full - flow control off

But is not persistent after a reboot.

Offline

#8 2021-03-21 20:51:46

hkall
Member
Registered: 2019-11-11
Posts: 18

Re: [SOLVED] 2.5 Gbit/s NIC autonegotiating only 1 Gbit/s

I briefly checked the NetworkManager soure code and indeed it doesn't seem to know the NBase-T modes 2.5Gbps and 5Gbps.
Therefore one solution would be to switch to an alternative network manager like netctl or systemd-networkd.

Offline

#9 2021-03-21 21:19:09

progandy
Member
Registered: 2012-05-17
Posts: 5,190

Re: [SOLVED] 2.5 Gbit/s NIC autonegotiating only 1 Gbit/s

The problem with networkmanager seems to be that it uses the deprecated ethtool_cmd structure which limits the speed flags to 32bit, but the 2.5Gbps flag needs 64bit (usable with struct ethtool_link_settings)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

#10 2021-03-22 11:26:57

johan.cb
Member
From: Leipzig, Germany
Registered: 2016-07-10
Posts: 62

Re: [SOLVED] 2.5 Gbit/s NIC autonegotiating only 1 Gbit/s

I don't know if one of you, @progandy or @hkall, just opened following ticket:
https://gitlab.freedesktop.org/NetworkM … issues/686

but it now seems to be at the right place smile

I was about to ask where I could document / open a ticket regarding this issue.

Offline

#11 2021-03-22 11:27:59

johan.cb
Member
From: Leipzig, Germany
Registered: 2016-07-10
Posts: 62

Re: [SOLVED] 2.5 Gbit/s NIC autonegotiating only 1 Gbit/s

As a workaround I just found following thread in the Arch forum that should solve my issue:
https://bbs.archlinux.org/viewtopic.php?id=262075

I will test this as soon as I am back home and let you know if this is viable.

Offline

#12 2021-03-22 14:34:57

hkall
Member
Registered: 2019-11-11
Posts: 18

Re: [SOLVED] 2.5 Gbit/s NIC autonegotiating only 1 Gbit/s

Actually a very basic systemd-networkd setup should be sufficient because r8169 advertises everything that is supported. The referenced Intel driver seems to be different and disables 2,5Gbps advertisement per default.

Offline

#13 2021-06-21 07:37:01

johan.cb
Member
From: Leipzig, Germany
Registered: 2016-07-10
Posts: 62

Re: [SOLVED] 2.5 Gbit/s NIC autonegotiating only 1 Gbit/s

Solved by the latest NetworkManager 1.32 release.

Thanks all for your help.

Marking as solved.

Offline

Board footer

Powered by FluxBB