Re: [PATCH net-next v2 1/2] r8152: Add support for 5Gbit Link Speeds and EEE
From: Birger Koblitz
Date: Thu Mar 19 2026 - 12:52:09 EST
On 19/03/2026 5:29 pm, Andrew Lunn wrote:
On Tue, Mar 17, 2026 at 07:07:14PM +0100, Birger Koblitz wrote:No, I have no idea, and I puzzled about this, too, plus triple checked it. But this reflects a hardware register, hardware engineers sometimes leave bits out. _10000bps will be bit 14 for the RTL8159.
The RTL8157 supports 5GBit Link speeds. Add support for this speed
in the setup and setting/getting through ethool. Also add 5GBit EEE.
Add functionality for setup and ethtool get/set methods.
Signed-off-by: Birger Koblitz <mail@xxxxxxxxxxxxxxxxx>
---
drivers/net/usb/r8152.c | 56 ++++++++++++++++++++++++++++++++++++++++++++++---
1 file changed, 53 insertions(+), 3 deletions(-)
diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c
index 3b6d4252d34c63ead8f11a120e212325a5f7d505..bab8e10e5f99afcb332e333c2739ed7509b03419 100644
--- a/drivers/net/usb/r8152.c
+++ b/drivers/net/usb/r8152.c
@@ -604,6 +604,7 @@ enum spd_duplex {
FORCE_100M_FULL,
FORCE_1000M_FULL,
NWAY_2500M_FULL,
+ NWAY_5000M_FULL,
};
/* OCP_ALDPS_CONFIG */
@@ -725,6 +726,7 @@ enum spd_duplex {
#define BP4_SUPER_ONLY 0x1578 /* RTL_VER_04 only */
enum rtl_register_content {
+ _5000bps = BIT(12),
_2500bps = BIT(10),
Any idea what bit 11 is for? There is not normally any speed between
2.5G and 5G.
I puzzled about this, too and then decided to leave it like this. The support for 5GBit is a hardware feature, so it is OK to state it is supported. But my tests with slower USB connections really show that it is better to rely on throttling the link speed itself, since flow control will do a rather bad job if the Ethernet connection can handle much more than the USB connection behind. However, if the user insists, they can advertise a higher speed.
@@ -9934,6 +9979,11 @@ static int rtl8152_probe_once(struct usb_interface *intf,
} else {
tp->speed = SPEED_1000;
}
+ if (tp->support_5000full &&
+ tp->udev->speed >= USB_SPEED_SUPER) {
+ tp->speed = SPEED_5000;
+ tp->advertising |= RTL_ADVERTISED_5000_FULL;
+ }
Let me check i understand this.
ethtool supported will indicate 5G, independent of the USB speed? But
it will only advertise 5G if the USB bus is USB 3.0 or higher, which
can do 5G. The user can however use ethtool to advertise 5G, for USB
2.0?
That was my rationale, too.
I suppose the question is, are there any link partners which do 2.5G
and/or 5G, but not 1G? I guess not.
Birger