openwrt / openwrt

This repository is a mirror of https://git.openwrt.org/openwrt/openwrt.git It is for reference only and is not active for check-ins. We will continue to accept Pull Requests here. They will be merged via staging trees then into openwrt.git.
Other
20.62k stars 10.58k forks source link

realtek: RTL838x switch does not show correct speed of SFP modules #16438

Open GoetzGoerisch opened 2 months ago

GoetzGoerisch commented 2 months ago

Describe the bug

SFP or SFP+ modules in the switch are reporting the incorrect link speed.

The operate at 1000Mbps but are shown and reported as 10Mbps.

Was already like this with 5.15 but remains with 6.6

OpenWrt version

r27466-f368e2d5ec

OpenWrt release

SNAPSHOT

OpenWrt target/subtarget

realtek/rtl838x

Device

HPE 1920-24G (JG924A

Image kind

Official downloaded image

Steps to reproduce

Actual behaviour

Link speed is reported as 10Mbps rtl83xx-switch switch@1b000000 lan25: Link is Up - 10Mbps/Half - flow control off

Actual throughput is 1000Mbps

Expected behaviour

Correct link speed is reported

Additional info

Modules as reported by kernel-log

sfp sfp-0: module OEM              SFP-GE-T         rev      sn <REDACTED>      dc 23110101
rtl83xx-switch switch@1b000000 lan25: Link is Up - 10Mbps/Half - flow control off

Model: https://www.amazon.de/gp/product/B07BQWFBC8

sfp sfp-3: module OEM              SFP-H10GB-CU1M   rev R    sn <REDACTED>  dc 240217
rtl83xx-switch switch@1b000000 lan28: Link is Up - 10Mbps/Full - flow control off

Model: https://www.amazon.de/gp/product/B01DCZCQTC

ethtool lan28
Settings for lan28:
    Supported ports: [ TP MII FIBRE ]
    Supported link modes:   10baseT/Half 10baseT/Full 
                            100baseT/Half 100baseT/Full 
                            1000baseT/Half 1000baseT/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 
    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 
    Link partner advertised pause frame use: No
    Link partner advertised auto-negotiation: Yes
    Link partner advertised FEC modes: Not reported
    Speed: 10Mb/s
    Duplex: Full
    Port: Twisted Pair
    PHYAD: 27
    Transceiver: external
    Auto-negotiation: on
    MDI-X: Unknown
    Supports Wake-on: d
    Wake-on: d
    Link detected: yes

Previous discussion on the forum: https://forum.openwrt.org/t/support-for-rtl838x-based-managed-switches/57875/2804

Diffconfig

No response

Terms

plappermaul commented 1 month ago

No real idea, but can you have a look at rtl83xx_phylink_mac_link_up() and print out the debugging info there.

Neustradamus commented 1 month ago

Linked to:

evs93 commented 1 month ago

No real idea, but can you have a look at rtl83xx_phylink_mac_link_up() and print out the debugging info there.

To get this moving along, and just to sanity check:

Build latest code. kernel/module loglevel set correctly? You want the pr_debug statement from rtl83xx_phylink_mac_link_up

https://github.com/openwrt/openwrt/blob/a2aabc9a7a4ec8a66477fbdde84a73b5942b460e/target/linux/realtek/files-6.6/drivers/net/dsa/rtl83xx/dsa.c#L949

Neustradamus commented 1 month ago

@GoetzGoerisch, @evs93: The @plappermaul PR has been merged, can you test?

evs93 commented 1 month ago

@GoetzGoerisch, @evs93: The @plappermaul PR has been merged, can you test?

* [realtek: phy/ethernet fixes #16457](https://github.com/openwrt/openwrt/pull/16457)

I'll test again at some point.

To clarify: my initial testing indicated behaviour didn't change before/after.

It was my initial confusion as I didn't know whether it was existing behaviour, and then I edited to indicate that it was existing behaviour.