[BPI-R4] and SFP

What command can I use to interrupt the power to the SFP module?

I would like to restart the module together with the BPI-R4 OpenWrt system. I noticed that it remains powered and is functioning normally.

I have already used “ip link set dev eth2 down” but it does not work.

I would like it, like the BPI-R4 and my Huawei MA5671A, to restart periodically.

Afaik sfp power cannot be controlled by software

Hello I am looking for help with bpi-r4 and SFP+ -LRB 10G fiber transceiver - tx1330/rx1270

Problem looks like after software reboot router via ssh with command reboot. I totally lost connection to my ISP. ethtool -m and ethtool -S, ethtool commands says that everything is very good. But it can’t establish connection anymore. It sends packet but receive 0

i am even thinkin about erased firmware of this transiver becouse sound very strange how reboot can affect physical stability

Temperatures was good all time

And now physicall power off router, unplugging transiever or fiber cable nothing helps

Here is few logs:

ethtool -m eth2
        Identifier                                : 0x03 (SFP)
        Extended identifier                       : 0x04 (GBIC/SFP defined by 2-wire interface ID)
        Connector                                 : 0x07 (LC)
        Transceiver codes                         : 0x20 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
        Transceiver type                          : 10G Ethernet: 10G Base-LR
        Encoding                                  : 0x06 (64B/66B)
        BR, Nominal                               : 10300MBd
        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                          : 1330nm
        Vendor name                               : OEM
        Vendor OUI                                : 00:00:00
        Vendor PN                                 : SFP+-LRB
        Vendor rev                                : 00
        Option values                             : 0x00 0x00
        BR margin, max                            : 0%
        BR margin, min                            : 0%
        Vendor SN                                 : XC240131111
        Date code                                 : 240131
        Optical diagnostics support               : Yes
        Laser bias current                        : 32.362 mA
        Laser output power                        : 1.0765 mW / 0.32 dBm
        Receiver signal average optical power     : 1.2367 mW / 0.92 dBm
        Module temperature                        : 47.91 degrees C / 118.25 degrees F
        Module voltage                            : 3.3932 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                  : Off
        Laser rx power high warning               : Off
        Laser rx power low warning                : Off
        Laser bias current high alarm threshold   : 100.000 mA
        Laser bias current low alarm threshold    : 10.000 mA
        Laser bias current high warning threshold : 80.000 mA
        Laser bias current low warning threshold  : 20.000 mA
        Laser output power high alarm threshold   : 2.5118 mW / 4.00 dBm
        Laser output power low alarm threshold    : 0.1122 mW / -9.50 dBm
        Laser output power high warning threshold : 1.9952 mW / 3.00 dBm
        Laser output power low warning threshold  : 0.1412 mW / -8.50 dBm
        Module temperature high alarm threshold   : 100.00 degrees C / 212.00 degrees F
        Module temperature low alarm threshold    : -50.00 degrees C / -58.00 degrees F
        Module temperature high warning threshold : 85.00 degrees C / 185.00 degrees F
        Module temperature low warning threshold  : -40.00 degrees C / -40.00 degrees F
        Module voltage high alarm threshold       : 4.0000 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.9952 mW / 3.00 dBm
        Laser rx power low alarm threshold        : 0.0198 mW / -17.03 dBm
        Laser rx power high warning threshold     : 1.5848 mW / 2.00 dBm
        Laser rx power low warning threshold      : 0.0316 mW / -15.00 dBm
ethtool -S eth2
NIC statistics:
     tx_bytes: 11461
     tx_packets: 76
     tx_skip: 0
     tx_collisions: 0
     rx_bytes: 0
     rx_packets: 0
     rx_overflow: 0
     rx_fcs_errors: 0
     rx_short_errors: 0
     rx_long_errors: 0
     rx_checksum_errors: 0
     rx_flow_control_packets: 0
     rx_xdp_redirect: 0
     rx_xdp_pass: 0
     rx_xdp_drop: 0
     rx_xdp_tx: 0
     rx_xdp_tx_errors: 0
     tx_xdp_xmit: 0
     tx_xdp_xmit_errors: 0
     rx_pp_alloc_fast: 18818
     rx_pp_alloc_slow: 33
     rx_pp_alloc_slow_ho: 0
     rx_pp_alloc_empty: 33
     rx_pp_alloc_refill: 272
     rx_pp_alloc_waive: 0
     rx_pp_recycle_cached: 0
     rx_pp_recycle_cache_full: 0
     rx_pp_recycle_ring: 17075
     rx_pp_recycle_ring_full: 0
     rx_pp_recycle_released_ref: 0
ethtool eth2
Settings for eth2:
        Supported ports: [ FIBRE ]
        Supported link modes:   10000baseLR/Full
        Supported pause frame use: Symmetric Receive-only
        Supports auto-negotiation: Yes
        Supported FEC modes: Not reported
        Advertised link modes:  10000baseLR/Full
        Advertised pause frame use: Symmetric Receive-only
        Advertised auto-negotiation: Yes
        Advertised FEC modes: Not reported
        Speed: 10000Mb/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

Have bought a SFP+ module ONTi ONT-C11TE-R01 When I try to use it with the latest snapshot it beaks Luci UI … and do freezes in ssh console if I try to call ifconfig. dmesg shows that system identified it as OEM SPF-10G-T rev 02 … and nothing else Any ideas how to deal with it?

PS It seams that the problem with autoneg … after some time it finally interface starts but it shows 10G (ethtool eth1 shows “Speed: 10000Mb/s”) where a client has only 2.5G NIC card. And in dmesg “mtk_soc_eth 15100000.ethernet eth1: selection of interface failed, advertisement 00,00000000,00000000,00006248”

Hello, I’m planning to buy this module to replace my Alcatel G-010S-P which completely lose connection if bpi-r4 perform a soft reboot. Had to re-plug power cable to make it work again.

Can you confirm that your router has no problem establishing PPPoE through this Huawei one after a ‘reboot’ command? Thanks.

So now a solution is implemented in mainline by Russell:

[PATCH net-next 2/3] net: pcs: pcs-mtk-lynxi: implement pcs_inband_caps() method - Russell King (Oracle)

That is great news!

Edit: @dangowrt & @frank-w

But shouldn’t it report it cannot LINK_INBAND_ENABLE with PHY_INTERFACE_MODE_2500BASEX and maybe PHY_INTERFACE_MODE_1000BASEX ???

1 Like

The patch is afaik (if i understood correctly) only for sfp not supporting in-band-management (daniel told me only some with broadcom phy).

The in-band-management itself should only report link-state,not speed,duplex, etc. Kernel needs to know supported speeds from eeprom,if eeprom does not contain some speeds we have added them (or forced to one) with quirks.

https://lore.kernel.org/all/[email protected]/

From the first series I quote:

Phylink’s handling of in-band has been deficient for a long time, and people keep hitting problems with it. Notably, situations with the way- to-late standardized 2500Base-X and whether that should or should not have in-band enabled. We have also been carrying a hack in the form of phylink_phy_no_inband() for a PHY that has been used on a SFP module, but has no in-band capabilities, not even for SGMII.

When phylink is trying to operate in in-band mode, this series will look at the capabilities of the MAC-side PCS and PHY, and work out whether in-band can or should be used, programming the PHY as appropriate.

net: phylink: add negotiation of in-band capabilities Support for in-band signalling with Serdes links is uncertain. Some PHYs do not support in-band for e.g. SGMII. Some PCS do not support in-band for 2500Base-X. Some PCS require in-band for Base-X protocols.

Simply using what is in DT is insufficient when we have hot-pluggable PHYs e.g. in the form of SFP modules, which may not provide the in-band signalling.

In order to address this, we have introduced phy_inband_caps() and pcs_inband_caps() functions to allow phylink to retrieve the capabilities from each end of the PCS/PHY link. This commit adds code to resolve whether in-band will be used in the various scenarios that we have: In-band not being used, PHY present using SGMII or Base-X, PHY not present. We also deal with no capabilties provided.

So, I understood, here we can tell phylink the pcs does not support inband at 2500-basex and have phylink negotiate if it can link PCS to PHY using this limitation.

I did the same in my crude patch, but this is much better ofcourse. He mentioned a while back he was working on it, so I did not go any further with my patch, waiting for his work to be mainlined.

I have exactly the same issue with this module. After a soft or hard reboot it would occasionally lose link until unplugged and replugged into the router. Like this time:

[   96.130345] sfp sfp1: module OEM              SFP-2.5G-T-R-RM  rev 1.0  sn 2405070065       dc 240507  
[  100.866956] mtk_soc_eth 15100000.ethernet eth2: Link is Up - 2.5Gbps/Full - flow control rx
[  158.718349] mtk_soc_eth 15100000.ethernet eth2: Link is Down

Does anyone have any tips for troubleshooting it?

Edit.: I’m running the latest mainline OpenWrt.

tI am connected using PPPoE at the moment. The only issue I had to do is create a script to restart the LAN port after 120 seconds, after initiation. Through investigation I realized that there is a normal delay in establishing the PPPoE connection, creating the possibility of not propagating IPv6 PDs through the LAN port, because it started before the creation of PPP0E_WANv6 was established. Sometimes it doesn’t even propagate IPv4.

But this is independent of whether I used the SPF or UNO module, I always needed this trick.

It is not yet a definitive solution to the problem, but it is what I have at the moment.

Call at startup: sh /etc/ifup_delayed.sh

Script: #!/bin/sh sleep 120 ifup lan

So the establishment with PPPoe is normal, my problem is in DHCP propagation.