Mikrotik RB5009 SFP+ Supported Link Modes

Howdy,

I installed OpenWrt 24.10.0-rc5 r28304-6dacba30a7 / LuCI openwrt-24.10 branch 25.001.48925~f5c1806 on my MikroTik RB5009 and everything works great save my SFP+ port. I have a Magic-SFP (https://www.mdslink.com/magic-sfp/) which operates at 2.5G and does work without issue on stock Mikrotik hardware (autoneg off and forcing 2500) but I cannot get it to operate in any capacity in OpenWrt.

Using ethtools (removing ethtool and installing ethtool-full) I get this on the empty cage:

root@OpenWrt:~# ethtool sfp
Settings for sfp:
	Supported ports: [ MII ]
	Supported link modes:   10000baseT/Full
	                        10000baseKX4/Full
	                        10000baseKR/Full
	                        10000baseCR/Full
	                        10000baseSR/Full
	                        10000baseLR/Full
	                        10000baseLRM/Full
	                        10000baseER/Full
	Supported pause frame use: Symmetric
	Supports auto-negotiation: Yes
	Supported FEC modes: Not reported
	Advertised link modes:  10000baseT/Full
	                        10000baseKX4/Full
	                        10000baseKR/Full
	                        10000baseCR/Full
	                        10000baseSR/Full
	                        10000baseLR/Full
	                        10000baseLRM/Full
	                        10000baseER/Full
	Advertised pause frame use: Symmetric
	Advertised auto-negotiation: Yes
	Advertised FEC modes: Not reported
	Speed: Unknown!
	Duplex: Unknown! (255)
	Auto-negotiation: on
	Port: MII
	PHYAD: 0
	Transceiver: internal
	Supports Wake-on: d
	Wake-on: d
	Link detected: no

plugging in the module ethtools returns

	Supported ports: [ TP ]
	Supported link modes:   1000baseX/Full
	Supported pause frame use: Symmetric
	Supports auto-negotiation: Yes
	Supported FEC modes: Not reported
	Advertised link modes:  1000baseX/Full
	Advertised pause frame use: Symmetric
	Advertised auto-negotiation: No
	Advertised FEC modes: Not reported
	Speed: 1000Mb/s
	Duplex: Full
	Auto-negotiation: off
	Port: Twisted Pair
	PHYAD: 0
	Transceiver: internal
	MDI-X: Unknown
	Supports Wake-on: d
	Wake-on: d
	Link detected: no

The SFP port just doesn't seem to want to communicate with the rest of the network and neither can serve as a DHCP client or communicate out for a DHCP server.

Running ethtools -m sfp I can get

root@OpenWrt:~# ethtool -m sfp
	Identifier                                : 0x03 (SFP)
	Extended identifier                       : 0x04 (GBIC/SFP defined by 2-wire interface ID)
	Connector                                 : 0x22 (RJ45)
	Transceiver codes                         : 0x00 0x00 0x00 0x01 0x00 0x00 0x00 0x00 0x00
	Transceiver type                          : Ethernet: 1000BASE-SX
	Encoding                                  : 0x01 (8B/10B)
	BR, Nominal                               : 2500MBd
	Rate identifier                           : 0x00 (unspecified)
	Length (SMF,km)                           : 0km
	Length (SMF)                              : 0m
	Length (50um)                             : 0m
	Length (62.5um)                           : 0m
	Length (Copper)                           : 100m
	Length (OM3)                              : 0m
	Laser wavelength                          : 0nm
	Vendor name                               : MDSLinkkk_______
	Vendor OUI                                : 00:00:00
	Vendor PN                                 : MaGiC-SFP_______
	Vendor rev                                : V1.0
	Option values                             : 0x22 0x00
	Option                                    : Power level 2 requirement
	Option                                    : Power level 3 requirement
	BR margin, max                            : 0%
	BR margin, min                            : 0%
	Vendor SN                                 : 0000000000000001
	Date code                                 : 23-04-08

Is there some sort of kmod or package I need to install? Thanks for the help!

@robimarko I think you know most about this during the dev for this device

Most likely the module has broken EEPROM since you can see it advertises 1000BASE-SX which is why you only get 1G.

So adding a quirk like this for your module is probably required:
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tree/drivers/net/phy/sfp.c?h=next-20250109#n495

Interesting. Is that something I can do from the firmware? Will I need to build a custom image? The module does work without issue in some no-name switches and MikroTik's default firmware but I do get that the module is highly specialized and comes from a very small vendor.

Indeed I can't seem to get EEPROM info:

root@cammarouter:~# ethtool -e sfp
Cannot get EEPROM data: Not supported

No, kernel needs to be patched so you need to custom build.

SFP module EEPROM can be read for sure as ethtool -m is working and kernel actually recognizes the module, its all read from the EEPROM.

Bummer. ethtool -m sfp does respond with information but not -e so i don't know what the deal is. I've got a BananaPi R4 coming so it'll be interested if the issue continues there. I only have one other device with an SFP port but its not + so I don't think that is a fair comparison.

Ignore the -e, that is for dumping via custom network driver OP, that doesn't matter.

Again, your issue is that EEPROM is not properly populated and kernel is thus limiting it to 1000Base-X only, you need to add a quirk for the module, I have linked you to the quirk for another module but only the vendor and model strings will be different.

Do you have an example of how to add the quirk? Is https://openwrt.org/docs/guide-developer/toolchain/use-buildsystem the path forward?

You need to add a kernel patch

https://openwrt.org/docs/guide-developer/toolchain/use-patches-with-buildsystem#adding_or_editing_kernel_patches

I have exactly the same problem in RB5009 and a SFP 10G BASE-T being recognized as Transceiver type: 10G Ethernet: 10G Base-SR
I would like to patch the sfp.c as your examples, but I do not really know how to get those information to adapt for example SFP_QUIRK_F("Walsun", "HXSX-ATRC-1", sfp_fixup_fs_10gt), to my device. Reading the function, those two first parameters are vendor and part number i suppose, so should I use OEM and SFP-10G-T since those are the output I get in my ethtool?

ethtool  -m sfp  | grep -i 'vendor'
	Vendor name                               : OEM
	Vendor PN                                 : SFP-10G-T
	Vendor rev                                : 02

Actually looking closer on the sfp.c, it does appear to already have a SFP_QUIRK_F("OEM", "SFP-10G-T", sfp_fixup_rollball_cc), , so I do not know what to do then.

Can you post the whole ethtool -m output?

Sure.

# ethtool -m sfp
	Identifier                                : 0x03 (SFP)
	Extended identifier                       : 0x04 (GBIC/SFP defined by 2-wire interface ID)
	Connector                                 : 0x07 (LC)
	Transceiver codes                         : 0x10 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
	Transceiver type                          : 10G Ethernet: 10G Base-SR
	Encoding                                  : 0x06 (64B/66B)
	BR, Nominal                               : 10300MBd
	Rate identifier                           : 0x00 (unspecified)
	Length (SMF,km)                           : 0km
	Length (SMF)                              : 0m
	Length (50um)                             : 80m
	Length (62.5um)                           : 20m
	Length (Copper)                           : 0m
	Length (OM3)                              : 300m
	Laser wavelength                          : 850nm
	Vendor name                               : OEM
	Vendor OUI                                : 00:90:65
	Vendor PN                                 : SFP-10G-T
	Vendor rev                                : 02
	Option values                             : 0x00 0x1a
	Option                                    : RX_LOS implemented
	Option                                    : TX_FAULT implemented
	Option                                    : TX_DISABLE implemented
	BR margin, max                            : 0%
	BR margin, min                            : 0%
	Vendor SN                                 : CSY392O71271
	Date code                                 : 240618
	Optical diagnostics support               : Yes
	Laser bias current                        : 6.000 mA
	Laser output power                        : 0.5000 mW / -3.01 dBm
	Receiver signal average optical power     : 0.0000 mW / -inf dBm
	Module temperature                        : 45.66 degrees C / 114.19 degrees F
	Module voltage                            : 3.3278 V
	Alarm/warning flags implemented           : Yes
	Laser bias current high alarm             : Off
	Laser bias current low alarm              : Off
	Laser bias current high warning           : Off
	Laser bias current low warning            : Off
	Laser output power high alarm             : Off
	Laser output power low alarm              : Off
	Laser output power high warning           : Off
	Laser output power low warning            : Off
	Module temperature high alarm             : Off
	Module temperature low alarm              : Off
	Module temperature high warning           : Off
	Module temperature low warning            : Off
	Module voltage high alarm                 : Off
	Module voltage low alarm                  : Off
	Module voltage high warning               : Off
	Module voltage low warning                : Off
	Laser rx power high alarm                 : Off
	Laser rx power low alarm                  : On
	Laser rx power high warning               : Off
	Laser rx power low warning                : On
	Laser bias current high alarm threshold   : 15.000 mA
	Laser bias current low alarm threshold    : 1.000 mA
	Laser bias current high warning threshold : 13.000 mA
	Laser bias current low warning threshold  : 2.000 mA
	Laser output power high alarm threshold   : 1.9952 mW / 3.00 dBm
	Laser output power low alarm threshold    : 0.1584 mW / -8.00 dBm
	Laser output power high warning threshold : 1.5848 mW / 2.00 dBm
	Laser output power low warning threshold  : 0.1778 mW / -7.50 dBm
	Module temperature high alarm threshold   : 95.00 degrees C / 203.00 degrees F
	Module temperature low alarm threshold    : -50.00 degrees C / -58.00 degrees F
	Module temperature high warning threshold : 90.00 degrees C / 194.00 degrees F
	Module temperature low warning threshold  : -45.00 degrees C / -49.00 degrees F
	Module voltage high alarm threshold       : 3.6000 V
	Module voltage low alarm threshold        : 3.0000 V
	Module voltage high warning threshold     : 3.5000 V
	Module voltage low warning threshold      : 3.1000 V
	Laser rx power high alarm threshold       : 1.1220 mW / 0.50 dBm
	Laser rx power low alarm threshold        : 0.0199 mW / -17.01 dBm
	Laser rx power high warning threshold     : 1.0000 mW / 0.00 dBm
	Laser rx power low warning threshold      : 0.0223 mW / -16.52 dBm

Do you have a spec sheet for your module?

Unfortunately not. I've sent an email to the manufacturer to check If I can get it.
Model: ASF-10G2-T-113C/YT

Maybe this https://doc.10gtek.com/en/p/10Gtek-ASF-10G2-T

I found one, it even contains the EEPROM content.

Give me some time to dig out the relevatn SFF spec for transceiver type.

Well, looking into it, the EEPROM is advertising 10G compliance code as 10GBase-SR so short range.

Can you share the kernel log, as I dont see an issue here

But it should be copper, not fiber.

[   17.907940] i2c-gpio sfp-i2c: using lines 32 (SDA) and 33 (SCL)
[   17.914390] sfp sfp: Host maximum power 1.0W
[   18.248645] sfp sfp: module OEM              SFP-10G-T        rev 02   sn CSY101O75965     dc 240618  
[   23.667554] mv88e6085 f212a200.mdio-mii:00 sfp: configuring for inband/10gbase-r link mode
[   23.820512] br-lan: port 8(sfp) entered blocking state
[   23.825704] br-lan: port 8(sfp) entered disabled state
[   23.830951] mv88e6085 f212a200.mdio-mii:00 sfp: entered allmulticast mode
[   23.850526] mv88e6085 f212a200.mdio-mii:00 sfp: entered promiscuous mode
[   51.175618] mv88e6085 f212a200.mdio-mii:00 sfp: PHY [i2c:sfp:11] driver [Aquantia AQR113C] (irq=POLL)

Do you need the whole dmesg or just that ?

Well, that is because EEPROM advertises the connector as LC, but I see that it finds the onboard AQR via RollBall protocol just fine so it should work even when miss-represented

Quick question: Is this SFP 10GB/only ?
Or can I connect to a 1Gbps and 2.5Gbps ?
I am trying to connect to a 2.5Gbps and it does not connect.