BPI-R3 SFP Module compatibility

IMHO the SFP cage is set to 2.5G as default (even without any module insterted) and the kernel it is not able to activate a 1G module or a 1/2.5Gb module at 1G.

one more update

My Banana Pi is running with openwrt snapshot from 23.1.2023

My Mikrotik RB760iGS (hEX S) is running with openwrt snapshot from 24.1.2023

I tested now with 4 different SFP Optical Fibre Transmitter Modules

  1. FS.com - SFP Transceiver Modul mit DOM - 1000BASE-BX BiDi SFP 1310nm-TX/1550nm-RX 20km LC SMF https://www.fs.com/de/products/20140.html

  2. TP-Link - TL-SM321B 1G Mini-GBIC Single-Mode Transceiver Module, 1000Base-BX WDM Bi-Directional SFP Module, LC Port https://www.tp-link.com/en/business-networking/accessory/tl-sm321b/

  3. Elfcam - ELfCAM ESB3512-3LCD10 1.25 Gbps SFP Modul, 1000Base-BX WDM Bi-Directional, Singlemode LC/UPC, DDM, bis zu 10KM (TX 1310nm) https://smile.amazon.de/dp/B08V9J5ZVM

  4. DIGITUS - Gigabit SFP Modul, Mini GBIC, Singlemode, LC Simplex (BiDi), Tx 1310nm / Rx 1550nm, 20 km, 1.25 Gbit/s https://smile.amazon.de/dp/B00609EB0K

All of them are working fine with my Mikrotik RB760iGS (hEX S). Working fine means, they connect and getting a DHCP Address.

But none of them are working with my banana pi r3 who runs with the same configuration and MAC address as the Mikrotik.

On my Banana Pi I get the following symptoms.

  • All modules are detected and identified properly.
  • All modules are showing “Link UP”.
  • All modules are showing “Laser output power” and “Receiver signal average optical power” values, which means they send and receive light.
  • All modules are able to send packages (verified by “cat /proc/net/dev” and “ethtool -S eth1”)
  • But no modules are receiving packages back (rx is always 0)

The only difference is that “Supported ports:” on my Mikrotik SFP Port is “[TP MII]” and on my Banana Pi R3 is “[FIBRE]” and the Banana Pi is using the XDP (eXpress Data Path) Stack

Another difference is that on my Mikrotik calling “ethtool sfp” I see

    Link partner advertised link modes:  1000baseX/Full
    Link partner advertised pause frame use: No
    Link partner advertised auto-negotiation: Yes
    Link partner advertised FEC modes: Not reported

and on my BananaPi this is missing, but it shows link up

@frank-w any idea or hint how I can debug or investigate deeper into my problem?

e.g. can I compile related drivers with a debug flag? or is there a way to capture some kind of raw data receiving from link partner?

it’s so strange that it works with a different device but the same module, os and configuration.

I do not know if drivers expose some debug data.

Basicly if there are dev_dbg you should see them if your debuglevel matches (and dynamic debug symbol is enabled). You have to pass debug=7 to your cmdline.

I mostly add dev_err statements.

https://wiki.fw-web.de/doku.php?id=programming:start#linux (sorry german only)

Else you have to add own debug-messages in code. Some drivers expose a debugfs knob. For it you have to mount debugfs.

It depends on which sfp slot you use…

Left one uses mtk_soc_eth.c right one uses mt7530.c,both use sfp.c additionally.

Vielen Dank! :slight_smile:

I installed a fresh version of openwrt (master), this time together with kernel modules (sfp and mtk_soc_eth) with debug symbols… I hope it will give me some more insights.

Debug symbols allowing running debugger (gdb) in linux…i’m not sure this will help you here.

ok. My understanding was that a kernel without debug option compiled, will strip out all debug related stuff lik “dev_*dbg/pr_debug()”.

I will try out “/sys/kernel/debug/dynamic_debug/control” and check if this will show me some more messages.


just another idea regarding the topic “BRI-R3 SFP Module compatibility”. Maybe it will be helpful to have a page with a “compatibility matrix”. Currently you have to read the full topic to get an idea which modules are supported and which not. And you have to read also unrelated messages like my messages. :innocent:

Hi! Any chance to solve this? I’m not found any way to make this module working… :frowning:

It is a very strange behaviour cause the module is declared full compatible with Cisco GLC-T/SFP-GE-T, Meraki MA-SFP-1GB-TX, Mikrotik, Ubiquiti UniFi UF-RJ45-1G, Intel, Netgear… My question is if anyone have a 1000base-T RJ45 working with R3. Thanks

I can add such matrix in my repo,but i need to know which modules are tested and working not working, maybe detailed in “recognized” and “really working”. I guess we need a way for find out the correct module informations like “how to find on a shop” and some kind of technical part number for identification. Maybe some kind of class like copper/fibre/ont/1g/2g(only)

something like this:

https://www.fw-web.de/dokuwiki/doku.php?id=en:bpi-r3:start#network_connections

have now only added mine, maybe i can add a column for comments (working after patch xyz or something) or maybe ethtool output. For speed i can use the 1000baseX/T names

I need some help. This XPON sfp adapter ( DFP-34X-2C2 ) support 2500Base-x

 sfp sfp1: module ODI              DFP-34X-2C2      rev      sn XPON22XXXXXX     dc 221206  
mtk_soc_eth 15100000.ethernet eth1: switched to inband/1000base-x link mode
mtk_soc_eth 15100000.ethernet eth1: configuring for inband/1000base-x link mode

I have tried LAN_SDS_MODE ( 0,4,5,6 ) followed by reboot and the result is always the same.

Anyone have a clue ? what can be changed to put the module in 2500Base-x ?

 ethtool -m eth1
        Identifier                                : 0x03 (SFP)
        Extended identifier                       : 0x04 (GBIC/SFP defined by 2-wire interface ID)
        Connector                                 : 0x01 (SC)
        Transceiver codes                         : 0x00 0x00 0x00 0x02 0x22 0x00 0x01 0x00 0x00
        Transceiver type                          : Ethernet: 1000BASE-LX
        Transceiver type                          : FC: intermediate distance (I)
        Transceiver type                          : FC: Longwave laser (LC)
        Transceiver type                          : FC: Single Mode (SM)
        Encoding                                  : 0x01 (8B/10B)
        BR, Nominal                               : 1300MBd
        Rate identifier                           : 0x00 (unspecified)
        Length (SMF,km)                           : 20km
        Length (SMF)                              : 20000m
        Length (50um)                             : 0m
        Length (62.5um)                           : 0m
        Length (Copper)                           : 0m
        Length (OM3)                              : 0m
        Laser wavelength                          : 1310nm
        Vendor name                               : ODI
        Vendor OUI                                : 00:00:00
        Vendor PN                                 : DFP-34X-2C2
        Vendor rev                                : 
        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                                 : XPON22XXXXXX
        Date code                                 : 221206

Which slot do you use and which image/kernel do you use? My kernel has reworked phylink support. I’m not sure this is already merged to recent openwrt snapshots.

Can you provide ethtool for parent interface too? Maybe we need to add 2500baseX to adverticed modes.

Hi, Thanks for your help. I tried a dozen or more snapshots in the last 3 weeks. Now R3 is using this release.

  OpenWrt SNAPSHOT r21962-d649a8dcef

I’m testing recently in wan port ( left port = eth1 ). Already tested some weeks ago in lan port ( right port = sfp2 ) with the same results. If the port is empty ethtool shows 2500Base-x as available. The moment that plugged the xpon module it shows that message “mtk_soc_eth 15100000.ethernet eth1: switched to inband/1000base-x link mode” and doesn’t revert back to 2500base-x in any way. Unplugging the xpon module and after plugging a 2.5gbase-t module ( that works ok if plugged directly ) doesn’t solve this.

By parent interface do you are refering to what ? at night I can test and post the ethtool results.

I don’t know if openwrt use the phylink-changes currently mainline. Have no 2g5 sfp at the moment…only 1g fibre.

I meant eth1/lan4,you had posted only ethtool of the module itself.but the parent itself maybe should show both (maybe more) modes…eth1 itself can be 1g and 2g5,but sfp limits this to modes it supports

For 2g5 mode we have to look if speed needs to be set too…here for sfp1/eth1 sfp slot.

Or maybe this is wrong beginning here:

At least this looks strange to me:

if (interface == PHY_INTERFACE_MODE_2500BASEX)
		rgc3 = RG_PHY_SPEED_3_125G;
	else
		rgc3 = 0;
...
regmap_update_bits(mpcs->regmap, mpcs->ana_rgc3,
			   RG_PHY_SPEED_3_125G, rgc3);

Either RG_PHY_SPEED_3_125G is a genmask or a value,but using it as both in the regmap looks strange

Maybe you can add printks on these positions to figure out which mode is requested and if options are set right

eth1 after a reboot of bpi-r3.

ethtool eth1
Settings for eth1:
        Supported ports: [ MII ]
        Supported link modes:   2500baseX/Full
        Supported pause frame use: Symmetric Receive-only
        Supports auto-negotiation: Yes
        Supported FEC modes: Not reported
        Advertised link modes:  2500baseX/Full
        Advertised pause frame use: Symmetric Receive-only
        Advertised auto-negotiation: Yes
        Advertised FEC modes: Not reported
        Speed: Unknown!
        Duplex: Unknown! (255)
        Auto-negotiation: on
        Port: MII
        PHYAD: 0
        Transceiver: internal
        Current message level: 0x000000ff (255)
                               drv probe link timer ifdown ifup rx_err tx_err
        Link detected: no

After plugging the XPON SFP

at logread
Wed Feb  1 18:25:05 2023 kern.info kernel: [  151.432958] sfp sfp1: module ODI             DFP-34X-2C2      rev      sn XPON22120052     dc 221206
Wed Feb  1 18:25:05 2023 kern.info kernel: [  151.442363] mtk_soc_eth 15100000.ethernet eth1: switched to inband/1000base-x link mode
ethtool eth1
Settings for eth1:
        Supported ports: [ FIBRE ]
        Supported link modes:   1000baseX/Full
        Supported pause frame use: Symmetric Receive-only
        Supports auto-negotiation: Yes
        Supported FEC modes: Not reported
        Advertised link modes:  1000baseX/Full
        Advertised pause frame use: Symmetric Receive-only
        Advertised auto-negotiation: Yes
        Advertised FEC modes: Not reported
        Speed: 1000Mb/s
        Duplex: Full
        Auto-negotiation: on
        Port: FIBRE
        PHYAD: 0
        Transceiver: internal
        Current message level: 0x000000ff (255)
                               drv probe link timer ifdown ifup rx_err tx_err
        Link detected: yes

Thx,so basicly eth1 is initially in 2500baseX/Full mode and change when sfp is inserted. You can try to force mode to 2500baseX in code i posted above

1 Like

@prdtabim

can you try if this series from @dangowrt fixes your 2g5-problem?

https://patchwork.kernel.org/project/linux-mediatek/cover/[email protected]/

?

see comment in coverletter as it requires additional patch to 6.2 for apply

Hi

Thanks for the tips. I will try this weekend.

note series is based on net-next (patch 8 will fail, so apply it with reject and make changes manually)

have applied series here, but have no 2g5 sfp to test: https://github.com/frank-w/BPI-Router-Linux/tree/6.2-netnext-pcs

Updated series is here https://patchwork.kernel.org/project/linux-mediatek/cover/[email protected]/

This one has an option to order for banana pi

€ 14,24 59%OFF | SFP-2.5GE-RJ45 Gigabit 2.5G Module SFP To RJ45 Optical Interface Expansion 2500M Rate Compatible Huawei H3C Cisco TPLINK Switch https://a.aliexpress.com/_EyiBS4l

Anyone have any experience?

2 Likes