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