Re: [PATCH net-next] net: sfp: add quirk for OEM DFP-34X-2C2 GPON ONU SFP

Sergio Palumbo
2024-02-17T10:13:20Z

Hello Russell,
unfortunately I did not have time imediately to run tests.
Now I had some time available to run some more test, this is the result:

The current situation:
Host supports Module Mode Functional
1000base-X LAN_SDS_MODE=1 1000base-X Not tested
1000base-X LAN_SDS_MODE=6 1000base-X Not tested
1000base-X + 2500base-X LAN_SDS_MODE=1 1000base-X Yes
1000base-X + 2500base-X LAN_SDS_MODE=6 1000base-X Yes

I recompiled the linux firmware with the #define DEBUG in phylink.c

With the quirk:
Host supports Module Mode Functional
1000base-X LAN_SDS_MODE=1 1000base-X Not tested
1000base-X LAN_SDS_MODE=6 1000base-X Not tested
1000base-X + 2500base-X LAN_SDS_MODE=1 2500base-X Yes
1000base-X + 2500base-X LAN_SDS_MODE=6 2500base-X Yes

From the above it is clear that:
- using the quirk the module is always working at 2500base-X if the host is capable of 2500base-X
- the internal settings of te module does not affect the speed

Here below an extract of the kernel log with phylink debug for 1000base-X + 2500base-X LAN_SDS_MODE=1 2500base-X :
sfp-1/eth1= DFP-34X-2C2 module
sfp-2/lan = sfp/ethernet copper module working at 2500base-X

Sat Feb 10 19:17:29 2024 kern.info kernel: [ 2.111137] mt7530-mdio mdio-bus:1f: configuring for fixed/2500base-x link mode
Sat Feb 10 19:17:29 2024 kern.debug kernel: [ 2.118440] mt7530-mdio mdio-bus:1f: major config 2500base-x
Sat Feb 10 19:17:29 2024 kern.debug kernel: [ 2.124099] mt7530-mdio mdio-bus:1f: phylink_mac_config: mode=fixed/2500base-x/2.5Gbps/Full adv=0000000,00008000,00006240 pause=03 link=0 an=1
Sat Feb 10 19:17:29 2024 kern.info kernel: [ 2.138585] mt7530-mdio mdio-bus:1f: Link is Up - 2.5Gbps/Full - flow control rx/tx
Sat Feb 10 19:17:29 2024 kern.info kernel: [ 2.147273] mt7530-mdio mdio-bus:1f wan (uninitialized): PHY [mt7530-0:00] driver [MediaTek MT7531 PHY] (irq=146)
Sat Feb 10 19:17:29 2024 kern.debug kernel: [ 2.157515] mt7530-mdio mdio-bus:1f wan (uninitialized): phy: setting supported 0000000,00000000,000062ef advertising 0000000,00000000,000062ef
Sat Feb 10 19:17:29 2024 kern.info kernel: [ 2.180320] mt7530-mdio mdio-bus:1f lan1 (uninitialized): PHY [mt7530-0:01] driver [MediaTek MT7531 PHY] (irq=147)
Sat Feb 10 19:17:29 2024 kern.debug kernel: [ 2.190651] mt7530-mdio mdio-bus:1f lan1 (uninitialized): phy: setting supported 0000000,00000000,000062ef advertising 0000000,00000000,000062ef
Sat Feb 10 19:17:29 2024 kern.info kernel: [ 2.213265] mt7530-mdio mdio-bus:1f lan2 (uninitialized): PHY [mt7530-0:02] driver [MediaTek MT7531 PHY] (irq=148)
Sat Feb 10 19:17:29 2024 kern.debug kernel: [ 2.223598] mt7530-mdio mdio-bus:1f lan2 (uninitialized): phy: setting supported 0000000,00000000,000062ef advertising 0000000,00000000,000062ef
Sat Feb 10 19:17:29 2024 kern.info kernel: [ 2.246219] mt7530-mdio mdio-bus:1f lan3 (uninitialized): PHY [mt7530-0:03] driver [MediaTek MT7531 PHY] (irq=149)
Sat Feb 10 19:17:29 2024 kern.debug kernel: [ 2.256552] mt7530-mdio mdio-bus:1f lan3 (uninitialized): phy: setting supported 0000000,00000000,000062ef advertising 0000000,00000000,000062ef
Sat Feb 10 19:17:29 2024 kern.info kernel: [ 2.279159] mt7530-mdio mdio-bus:1f lan4 (uninitialized): PHY [mt7530-0:04] driver [MediaTek MT7531 PHY] (irq=150)
Sat Feb 10 19:17:29 2024 kern.debug kernel: [ 2.289490] mt7530-mdio mdio-bus:1f lan4 (uninitialized): phy: setting supported 0000000,00000000,000062ef advertising 0000000,00000000,000062ef
Sat Feb 10 19:17:29 2024 kern.info kernel: [ 7.482162] mtk_soc_eth 15100000.ethernet eth0: configuring for fixed/2500base-x link mode
Sat Feb 10 19:17:29 2024 kern.debug kernel: [ 7.490445] mtk_soc_eth 15100000.ethernet eth0: major config 2500base-x
Sat Feb 10 19:17:29 2024 kern.debug kernel: [ 7.497041] mtk_soc_eth 15100000.ethernet eth0: phylink_mac_config: mode=fixed/2500base-x/2.5Gbps/Full adv=0000000,00008000,00006240 pause=03 link=0 an=1
Sat Feb 10 19:17:29 2024 kern.info kernel: [ 7.510911] mtk_soc_eth 15100000.ethernet eth0: Link is Up - 2.5Gbps/Full - flow control rx/tx
Sat Feb 10 19:17:29 2024 kern.info kernel: [ 7.556750] mt7530-mdio mdio-bus:1f lan1: configuring for phy/gmii link mode
Sat Feb 10 19:17:29 2024 kern.debug kernel: [ 7.563831] mt7530-mdio mdio-bus:1f lan1: major config gmii
Sat Feb 10 19:17:29 2024 kern.debug kernel: [ 7.569386] mt7530-mdio mdio-bus:1f lan1: phylink_mac_config: mode=phy/gmii/Unknown/Unknown adv=0000000,00000000,00000000 pause=00 link=0 an=0
Sat Feb 10 19:17:29 2024 kern.debug kernel: [ 7.585159] mt7530-mdio mdio-bus:1f lan1: phy link up gmii/1Gbps/Full/rx/tx
Sat Feb 10 19:17:29 2024 kern.info kernel: [ 7.586893] mt7530-mdio mdio-bus:1f lan1: Link is Up - 1Gbps/Full - flow control rx/tx
Sat Feb 10 19:17:29 2024 kern.info kernel: [ 15.122661] sfp sfp-1: Host maximum power 3.0W
Sat Feb 10 19:17:29 2024 kern.info kernel: [ 15.127875] sfp sfp-2: Host maximum power 3.0W
Sat Feb 10 19:17:29 2024 kern.info kernel: [ 15.459629] sfp sfp-1: module OEM DFP-34X-2C2 rev sn XPONxxxxxxxx dc 230912
Sat Feb 10 19:17:29 2024 kern.debug kernel: [ 15.469121] mtk_soc_eth 15100000.ethernet eth1: requesting link mode inband/2500base-x with support 0000000,00000200,0000e440
Sat Feb 10 19:17:29 2024 kern.info kernel: [ 15.509967] sfp sfp-2: module rev 1.0 sn 2307210038 dc 230721
Sat Feb 10 19:17:29 2024 kern.debug kernel: [ 15.519434] mt7530-mdio mdio-bus:1f sfp2: requesting link mode inband/2500base-x with support 0000000,00000000,0000e440
Sat Feb 10 19:17:31 2024 kern.info kernel: [ 24.360320] mt7530-mdio mdio-bus:1f sfp2: configuring for inband/2500base-x link mode
Sat Feb 10 19:17:31 2024 kern.debug kernel: [ 24.368145] mt7530-mdio mdio-bus:1f sfp2: major config 2500base-x
Sat Feb 10 19:17:31 2024 kern.debug kernel: [ 24.374258] mt7530-mdio mdio-bus:1f sfp2: phylink_mac_config: mode=inband/2500base-x/Unknown/Unknown adv=0000000,00000000,0000e440 pause=04 link=0 an=1
Sat Feb 10 19:17:31 2024 kern.info kernel: [ 24.389679] br-lan: port 5(sfp2) entered blocking state
Sat Feb 10 19:17:31 2024 kern.info kernel: [ 24.394948] br-lan: port 5(sfp2) entered disabled state
Sat Feb 10 19:17:31 2024 kern.info kernel: [ 24.402405] device sfp2 entered promiscuous mode
Sat Feb 10 19:17:31 2024 kern.info kernel: [ 24.414853] mt7530-mdio mdio-bus:1f wan: configuring for phy/gmii link mode
Sat Feb 10 19:17:31 2024 kern.debug kernel: [ 24.421873] mt7530-mdio mdio-bus:1f wan: major config gmii
Sat Feb 10 19:17:31 2024 kern.debug kernel: [ 24.427355] mt7530-mdio mdio-bus:1f wan: phylink_mac_config: mode=phy/gmii/Unknown/Unknown adv=0000000,00000000,00000000 pause=00 link=0 an=0
Sat Feb 10 19:17:31 2024 kern.debug kernel: [ 24.443005] mt7530-mdio mdio-bus:1f wan: phy link down gmii/Unknown/Unknown/off
Sat Feb 10 19:17:31 2024 kern.info kernel: [ 24.472639] mtk_soc_eth 15100000.ethernet eth1: configuring for inband/2500base-x link mode
Sat Feb 10 19:17:31 2024 kern.debug kernel: [ 24.481074] mtk_soc_eth 15100000.ethernet eth1: major config 2500base-x
Sat Feb 10 19:17:31 2024 kern.debug kernel: [ 24.487693] mtk_soc_eth 15100000.ethernet eth1: phylink_mac_config: mode=inband/2500base-x/Unknown/Unknown adv=0000000,00000000,0000e440 pause=04 link=0 an=1

A stated by you the system is still connecting at 2500base-X even if the module is set for 1000base-X, as far as I can see, without any error.
My assumption that the module could have forced the speed down to 1000base-X was completely wrong.

Making a final recap:
- The module without the quirk is only showing up at 1000base-X due to a wrong EEPROM data
- The module without the quirk is working at 1000base-X in both of the 2 internal configurations
- The module with the quirk is only showing up at 1000base-X and 2500base-X
- The module with the quirk is working at 2500base-X in both of the 2 internal configurations

This module as is a GPON-ONU/ONT and is configured by the OLT same as FS GPON-INU-34-20BI and HUAWEI MA5671A already validated for the quirk.

Thanks for your patience and suggestions.
I remain at your disposal for any further test I can do.
I hope that with the above evidence the patch could be acceptable for both OEM and ODI vendor.