[PATCH net-next] net: sfp: Add quirk for Dell M14MK module

Xander Wilmink <[email protected]>
Newsgroups org.kernel.vger.netdev
Message-ID <[email protected]>
Greetings,

This adds an quirk for the Dell M14MK (S28-10G-25G-SR-85C) SFP28 module.
These are short range fiber modules, and should advertise 10000baseSR/Full.
Incorrectly these advertise as being a copper module: 10000baseCR/Full. 
The link fails to come up, and the kernel logs "unsupported SFP module: 
no common interface modes."
With the quirk added, the 10Gbit/s link comes up.

Tested on a Linksys LGS328PC with OpenWRT SNAPSHOT version:
OpenWrt SNAPSHOT r35298-2a73f02e56 / LuCI Master 26.190.71895~a18dc50.
Ethtool advertises now "10000baseSR/Full" and the link works on 10Gbit/s.

Thank you for your time.

Kind regards,

Xander Wilmink

Co-authored-by: Jonas Jelonek <[email protected]>
Signed-off-by: Xander Wilmink <[email protected]>

---
 drivers/net/phy/sfp.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/net/phy/sfp.c b/drivers/net/phy/sfp.c
index 6c25b73c668a..64b4ec08f28a 100644
--- a/drivers/net/phy/sfp.c
+++ b/drivers/net/phy/sfp.c
@@ -477,6 +477,13 @@ static void sfp_quirk_2500basex(const struct sfp_eeprom_id *id,
 	__set_bit(PHY_INTERFACE_MODE_2500BASEX, caps->interfaces);
 }
 
+static void sfp_quirk_25g_10g_dual(const struct sfp_eeprom_id *id,
+				   struct sfp_module_caps *caps)
+{
+	linkmode_set_bit(ETHTOOL_LINK_MODE_10000baseSR_Full_BIT,
+			 caps->link_modes);
+	__set_bit(PHY_INTERFACE_MODE_10GBASER, caps->interfaces);
+
 static void sfp_quirk_disable_autoneg(const struct sfp_eeprom_id *id,
 				      struct sfp_module_caps *caps)
 {
@@ -523,6 +530,10 @@ static const struct sfp_quirk sfp_quirks[] = {
 	SFP_QUIRK("ALCATELLUCENT", "G010SP", sfp_quirk_2500basex,
 		  sfp_fixup_ignore_tx_fault),
 
+	// Dell M14MK, 10/25 GBit SFP28 module. Labeled as Dell S28-10G-25G-SR-85C.
+	// Runs at 10 Gbit/s in a SFP+ port, but does not advertise this properly.
+	SFP_QUIRK_S("DELL", "M14MK", sfp_quirk_25g_10g_dual),
+
 	// Alcatel Lucent G-010S-A can operate at 2500base-X, but report 3.2GBd
 	// NRZ in their EEPROM
 	SFP_QUIRK("ALCATELLUCENT", "3FE46541AA", sfp_quirk_2500basex,
-- 
2.52.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.