public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] net: sfp: support 25G long-range modules (extended compliance code 0x3)
@ 2026-01-18 14:07 Josua Mayer
  2026-01-18 14:07 ` [PATCH 1/2] net: ethtool: Add link mode for 25Gbps long-range fiber Josua Mayer
  2026-01-18 14:07 ` [PATCH 2/2] net: sfp: support 25G long-range modules (extended compliance code 0x3) Josua Mayer
  0 siblings, 2 replies; 8+ messages in thread
From: Josua Mayer @ 2026-01-18 14:07 UTC (permalink / raw)
  To: Andrew Lunn, Heiner Kallweit, Russell King, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Simon Horman
  Cc: Mikhail Anikin, Rabeeh Khoury, Yazan Shhady, netdev, linux-kernel,
	Josua Mayer

Add ethtool link-mode bit for 25Gbps long-range fiber, and enable it
when parsing sfp module eeprom for extended compliance code 0x3.

Signed-off-by: Josua Mayer <josua@solid-run.com>
---
Josua Mayer (2):
      net: ethtool: Add link mode for 25Gbps long-range fiber
      net: sfp: support 25G long-range modules (extended compliance code 0x3)

 drivers/net/phy/phy-core.c   | 2 +-
 drivers/net/phy/sfp-bus.c    | 4 +++-
 include/uapi/linux/ethtool.h | 1 +
 net/ethtool/common.c         | 2 ++
 4 files changed, 7 insertions(+), 2 deletions(-)
---
base-commit: b4e486e2c46f754a515571a8ca1238fa567396dd
change-id: 20260118-sfp-25g-lr-b0b8cccbb19a

Best regards,
-- 
Josua Mayer <josua@solid-run.com>



^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 1/2] net: ethtool: Add link mode for 25Gbps long-range fiber
  2026-01-18 14:07 [PATCH 0/2] net: sfp: support 25G long-range modules (extended compliance code 0x3) Josua Mayer
@ 2026-01-18 14:07 ` Josua Mayer
  2026-01-18 14:07 ` [PATCH 2/2] net: sfp: support 25G long-range modules (extended compliance code 0x3) Josua Mayer
  1 sibling, 0 replies; 8+ messages in thread
From: Josua Mayer @ 2026-01-18 14:07 UTC (permalink / raw)
  To: Andrew Lunn, Heiner Kallweit, Russell King, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Simon Horman
  Cc: Mikhail Anikin, Rabeeh Khoury, Yazan Shhady, netdev, linux-kernel,
	Josua Mayer

ethtool.h header already has a link-mode bit for short-range (SR) fiber.
but missing the long-range (LR) variant.

Define link-mode bit for 25Gbps long-range fiber (25000baseLR_Full).

Signed-off-by: Josua Mayer <josua@solid-run.com>
---
 drivers/net/phy/phy-core.c   | 2 +-
 include/uapi/linux/ethtool.h | 1 +
 net/ethtool/common.c         | 2 ++
 3 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/net/phy/phy-core.c b/drivers/net/phy/phy-core.c
index 3badf6e84554..cccd1316e145 100644
--- a/drivers/net/phy/phy-core.c
+++ b/drivers/net/phy/phy-core.c
@@ -18,7 +18,7 @@
  */
 const char *phy_speed_to_str(int speed)
 {
-	BUILD_BUG_ON_MSG(__ETHTOOL_LINK_MODE_MASK_NBITS != 125,
+	BUILD_BUG_ON_MSG(__ETHTOOL_LINK_MODE_MASK_NBITS != 126,
 		"Enum ethtool_link_mode_bit_indices and phylib are out of sync. "
 		"If a speed or mode has been added please update phy_speed_to_str "
 		"and the PHY settings array.\n");
diff --git a/include/uapi/linux/ethtool.h b/include/uapi/linux/ethtool.h
index ce9aeb65a8e1..51929f3e00d9 100644
--- a/include/uapi/linux/ethtool.h
+++ b/include/uapi/linux/ethtool.h
@@ -2094,6 +2094,7 @@ enum ethtool_link_mode_bit_indices {
 	ETHTOOL_LINK_MODE_1600000baseKR8_Full_BIT	 = 122,
 	ETHTOOL_LINK_MODE_1600000baseDR8_Full_BIT	 = 123,
 	ETHTOOL_LINK_MODE_1600000baseDR8_2_Full_BIT	 = 124,
+	ETHTOOL_LINK_MODE_25000baseLR_Full_BIT		 = 125,
 
 	/* must be last entry */
 	__ETHTOOL_LINK_MODE_MASK_NBITS
diff --git a/net/ethtool/common.c b/net/ethtool/common.c
index 4036561b078b..0010debce4e6 100644
--- a/net/ethtool/common.c
+++ b/net/ethtool/common.c
@@ -237,6 +237,7 @@ const char link_mode_names[][ETH_GSTRING_LEN] = {
 	__DEFINE_LINK_MODE_NAME(1600000, KR8, Full),
 	__DEFINE_LINK_MODE_NAME(1600000, DR8, Full),
 	__DEFINE_LINK_MODE_NAME(1600000, DR8_2, Full),
+	__DEFINE_LINK_MODE_NAME(25000, LR, Full),
 };
 static_assert(ARRAY_SIZE(link_mode_names) == __ETHTOOL_LINK_MODE_MASK_NBITS);
 
@@ -464,6 +465,7 @@ const struct link_mode_info link_mode_params[] = {
 	__DEFINE_LINK_MODE_PARAMS(1600000, KR8, Full, K),
 	__DEFINE_LINK_MODE_PARAMS(1600000, DR8, Full, D),
 	__DEFINE_LINK_MODE_PARAMS(1600000, DR8_2, Full, D),
+	__DEFINE_LINK_MODE_PARAMS(25000, LR, Full, L),
 };
 static_assert(ARRAY_SIZE(link_mode_params) == __ETHTOOL_LINK_MODE_MASK_NBITS);
 EXPORT_SYMBOL_GPL(link_mode_params);

-- 
2.43.0



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 2/2] net: sfp: support 25G long-range modules (extended compliance code 0x3)
  2026-01-18 14:07 [PATCH 0/2] net: sfp: support 25G long-range modules (extended compliance code 0x3) Josua Mayer
  2026-01-18 14:07 ` [PATCH 1/2] net: ethtool: Add link mode for 25Gbps long-range fiber Josua Mayer
@ 2026-01-18 14:07 ` Josua Mayer
  2026-01-18 16:01   ` Andrew Lunn
  2026-01-19 19:30   ` Jakub Kicinski
  1 sibling, 2 replies; 8+ messages in thread
From: Josua Mayer @ 2026-01-18 14:07 UTC (permalink / raw)
  To: Andrew Lunn, Heiner Kallweit, Russell King, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Simon Horman
  Cc: Mikhail Anikin, Rabeeh Khoury, Yazan Shhady, netdev, linux-kernel,
	Josua Mayer

The extended compliance code value SFF8024_ECC_100GBASE_ER4_25GBASE_ER
(0x3) means either 4-lane 100G or single lane 25G.

Set 25000baseLR_Full mode supported in addition to the already set
100000baseLR4_ER4_Full, and handle it in sfp_select_interface.

This fixes detection of 25G capability for two SFP fiber modules:

- GigaLight GSS-SPO250-LRT
- FS SFP-25G23-BX20-I

Signed-off-by: Josua Mayer <josua@solid-run.com>
---
 drivers/net/phy/sfp-bus.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/phy/sfp-bus.c b/drivers/net/phy/sfp-bus.c
index b945d75966d5..2caa0e0c4ec8 100644
--- a/drivers/net/phy/sfp-bus.c
+++ b/drivers/net/phy/sfp-bus.c
@@ -247,6 +247,7 @@ static void sfp_module_parse_support(struct sfp_bus *bus,
 	case SFF8024_ECC_100GBASE_LR4_25GBASE_LR:
 	case SFF8024_ECC_100GBASE_ER4_25GBASE_ER:
 		phylink_set(modes, 100000baseLR4_ER4_Full);
+		phylink_set(modes, 25000baseLR_Full);
 		break;
 	case SFF8024_ECC_100GBASE_CR4:
 		phylink_set(modes, 100000baseCR4_Full);
@@ -342,7 +343,8 @@ phy_interface_t sfp_select_interface(struct sfp_bus *bus,
 {
 	if (phylink_test(link_modes, 25000baseCR_Full) ||
 	    phylink_test(link_modes, 25000baseKR_Full) ||
-	    phylink_test(link_modes, 25000baseSR_Full))
+	    phylink_test(link_modes, 25000baseSR_Full) ||
+	    phylink_test(link_modes, 25000baseLR_Full))
 		return PHY_INTERFACE_MODE_25GBASER;
 
 	if (phylink_test(link_modes, 10000baseCR_Full) ||

-- 
2.43.0



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH 2/2] net: sfp: support 25G long-range modules (extended compliance code 0x3)
  2026-01-18 14:07 ` [PATCH 2/2] net: sfp: support 25G long-range modules (extended compliance code 0x3) Josua Mayer
@ 2026-01-18 16:01   ` Andrew Lunn
  2026-01-19  7:30     ` Josua Mayer
  2026-01-19 19:30   ` Jakub Kicinski
  1 sibling, 1 reply; 8+ messages in thread
From: Andrew Lunn @ 2026-01-18 16:01 UTC (permalink / raw)
  To: Josua Mayer
  Cc: Heiner Kallweit, Russell King, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Simon Horman, Mikhail Anikin,
	Rabeeh Khoury, Yazan Shhady, netdev, linux-kernel

On Sun, Jan 18, 2026 at 04:07:38PM +0200, Josua Mayer wrote:
> The extended compliance code value SFF8024_ECC_100GBASE_ER4_25GBASE_ER
> (0x3) means either 4-lane 100G or single lane 25G.

Is there a way to tell them apart?

If it is a QSFP, it means 4-lane 100G? You can however split it into
4x 25GBASE_ER, if the MAC supports port spitting? If it is an SFP, it
must mean 25GBASE_ER because the SFP only supports a single lane?

> Set 25000baseLR_Full mode supported in addition to the already set
> 100000baseLR4_ER4_Full, and handle it in sfp_select_interface.
> 
> This fixes detection of 25G capability for two SFP fiber modules:
> 
> - GigaLight GSS-SPO250-LRT
> - FS SFP-25G23-BX20-I

Are these SFPs or QSFPs?

> Signed-off-by: Josua Mayer <josua@solid-run.com>
> ---
>  drivers/net/phy/sfp-bus.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/phy/sfp-bus.c b/drivers/net/phy/sfp-bus.c
> index b945d75966d5..2caa0e0c4ec8 100644
> --- a/drivers/net/phy/sfp-bus.c
> +++ b/drivers/net/phy/sfp-bus.c
> @@ -247,6 +247,7 @@ static void sfp_module_parse_support(struct sfp_bus *bus,
>  	case SFF8024_ECC_100GBASE_LR4_25GBASE_LR:
>  	case SFF8024_ECC_100GBASE_ER4_25GBASE_ER:
>  		phylink_set(modes, 100000baseLR4_ER4_Full);
> +		phylink_set(modes, 25000baseLR_Full);

Given the question above, i'm wondering if it is as simple as this, or
we need to look at the type of SFP?

	Andrew

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 2/2] net: sfp: support 25G long-range modules (extended compliance code 0x3)
  2026-01-18 16:01   ` Andrew Lunn
@ 2026-01-19  7:30     ` Josua Mayer
  2026-01-19 10:48       ` Russell King (Oracle)
  0 siblings, 1 reply; 8+ messages in thread
From: Josua Mayer @ 2026-01-19  7:30 UTC (permalink / raw)
  To: Andrew Lunn
  Cc: Heiner Kallweit, Russell King, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Simon Horman, Mikhail Anikin,
	Rabeeh Khoury, Yazan Shhady, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org

On 18/01/2026 18:01, Andrew Lunn wrote:
> On Sun, Jan 18, 2026 at 04:07:38PM +0200, Josua Mayer wrote:
>> The extended compliance code value SFF8024_ECC_100GBASE_ER4_25GBASE_ER
>> (0x3) means either 4-lane 100G or single lane 25G.
> Is there a way to tell them apart?
The physical connectors are different, so we can know from the
device-tree compatible string.

For now sfp driver does not support qsfp.

>
> If it is a QSFP, it means 4-lane 100G?
This is my suspicion, but I have not parsed real-world qsfp eeproms.
> You can however split it into
> 4x 25GBASE_ER, if the MAC supports port spitting? If it is an SFP, it
> must mean 25GBASE_ER because the SFP only supports a single lane?
Does it?
I thought SR, ER and LR indicate distance not host interface lane count.

Either way if you have a QSFP module, there is a single module with a single
eeprom on a single connector of 4 lanes.

When you have SFP module, there is a module / eeprom for each lane.

>
>> Set 25000baseLR_Full mode supported in addition to the already set
>> 100000baseLR4_ER4_Full, and handle it in sfp_select_interface.
>>
>> This fixes detection of 25G capability for two SFP fiber modules:
>>
>> - GigaLight GSS-SPO250-LRT
>> - FS SFP-25G23-BX20-I
> Are these SFPs or QSFPs?

SFP.

>
>> Signed-off-by: Josua Mayer <josua@solid-run.com>
>> ---
>>   drivers/net/phy/sfp-bus.c | 4 +++-
>>   1 file changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/net/phy/sfp-bus.c b/drivers/net/phy/sfp-bus.c
>> index b945d75966d5..2caa0e0c4ec8 100644
>> --- a/drivers/net/phy/sfp-bus.c
>> +++ b/drivers/net/phy/sfp-bus.c
>> @@ -247,6 +247,7 @@ static void sfp_module_parse_support(struct sfp_bus *bus,
>>   	case SFF8024_ECC_100GBASE_LR4_25GBASE_LR:
>>   	case SFF8024_ECC_100GBASE_ER4_25GBASE_ER:
>>   		phylink_set(modes, 100000baseLR4_ER4_Full);
>> +		phylink_set(modes, 25000baseLR_Full);
> Given the question above, i'm wondering if it is as simple as this, or
> we need to look at the type of SFP?
I don't think we need to worry about QSFP at this time.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 2/2] net: sfp: support 25G long-range modules (extended compliance code 0x3)
  2026-01-19  7:30     ` Josua Mayer
@ 2026-01-19 10:48       ` Russell King (Oracle)
  0 siblings, 0 replies; 8+ messages in thread
From: Russell King (Oracle) @ 2026-01-19 10:48 UTC (permalink / raw)
  To: Josua Mayer
  Cc: Andrew Lunn, Heiner Kallweit, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Simon Horman, Mikhail Anikin,
	Rabeeh Khoury, Yazan Shhady, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org

On Mon, Jan 19, 2026 at 07:30:20AM +0000, Josua Mayer wrote:
> On 18/01/2026 18:01, Andrew Lunn wrote:
> > On Sun, Jan 18, 2026 at 04:07:38PM +0200, Josua Mayer wrote:
> >> The extended compliance code value SFF8024_ECC_100GBASE_ER4_25GBASE_ER
> >> (0x3) means either 4-lane 100G or single lane 25G.
> > Is there a way to tell them apart?
> The physical connectors are different, so we can know from the
> device-tree compatible string.
> 
> For now sfp driver does not support qsfp.

And likely will never do.

I did look at QSFP support due to the LX2160A SR board, and I did
scratch some code together, but I didn't get far with it:

(a) LX2160A is just not flexible enough to consider the possibilities
    properly to implement support (no run-time reconfiguration of the
    interface mode.)

(b) QSFPs can be used as a single interface, or as multiple interfaces.
    There is no way that the SFP and phylink layers can cope with that
    as they are currently structured.

(c) QSFP EEPROMs have a completely different structure to SFP EEPROMs.

(d) I couldn't see any way that the QSFP EEPROM distinguished between
    e.g. a cable that had QSFP at one end and 4x SFP at the other vs
    a cable that had QSFP at each end, thus making it impossible to
    know whether 100G as 4 25G lanes would be possible.

(e) I'm aware that there's devlink which I believe can deal with some
    of this "single network interface of 4 lanes" vs "four network
    interfaces of 1 lane" configuration, but I've never used it, and
    when I looked at it, it wasn't clear how. I have no hardware that
    makes use of devlink to play with to find out.

Basically, QSFP support is something I have little knowledge of, there
is precious little on the 'net about its use, I have no hardware
experience with, and I don't see how it fits into Linux networking.
So I decided it would be a fools errand to attempt to implement
anything.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 2/2] net: sfp: support 25G long-range modules (extended compliance code 0x3)
  2026-01-18 14:07 ` [PATCH 2/2] net: sfp: support 25G long-range modules (extended compliance code 0x3) Josua Mayer
  2026-01-18 16:01   ` Andrew Lunn
@ 2026-01-19 19:30   ` Jakub Kicinski
  2026-01-21  9:44     ` Josua Mayer
  1 sibling, 1 reply; 8+ messages in thread
From: Jakub Kicinski @ 2026-01-19 19:30 UTC (permalink / raw)
  To: Josua Mayer
  Cc: Andrew Lunn, Heiner Kallweit, Russell King, David S. Miller,
	Eric Dumazet, Paolo Abeni, Simon Horman, Mikhail Anikin,
	Rabeeh Khoury, Yazan Shhady, netdev, linux-kernel

On Sun, 18 Jan 2026 16:07:38 +0200 Josua Mayer wrote:
> @@ -247,6 +247,7 @@ static void sfp_module_parse_support(struct sfp_bus *bus,
>  	case SFF8024_ECC_100GBASE_LR4_25GBASE_LR:
>  	case SFF8024_ECC_100GBASE_ER4_25GBASE_ER:
>  		phylink_set(modes, 100000baseLR4_ER4_Full);
> +		phylink_set(modes, 25000baseLR_Full);

I _think_ the discussion here concluded that the patch is insufficient 
/ DoA? Either way, I wanted to relay that AI code review points out
we may also want to set __set_bit(PHY_INTERFACE_MODE_25GBASER,
interfaces) here:

https://netdev-ai.bots.linux.dev/ai-review.html?id=c91c0f54-56d5-4356-89cd-b57cbb289495

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 2/2] net: sfp: support 25G long-range modules (extended compliance code 0x3)
  2026-01-19 19:30   ` Jakub Kicinski
@ 2026-01-21  9:44     ` Josua Mayer
  0 siblings, 0 replies; 8+ messages in thread
From: Josua Mayer @ 2026-01-21  9:44 UTC (permalink / raw)
  To: Jakub Kicinski
  Cc: Andrew Lunn, Heiner Kallweit, Russell King, David S. Miller,
	Eric Dumazet, Paolo Abeni, Simon Horman, Mikhail Anikin,
	Rabeeh Khoury, Yazan Shhady, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org

On 19/01/2026 21:30, Jakub Kicinski wrote:
> On Sun, 18 Jan 2026 16:07:38 +0200 Josua Mayer wrote:
>> @@ -247,6 +247,7 @@ static void sfp_module_parse_support(struct sfp_bus *bus,
>>   	case SFF8024_ECC_100GBASE_LR4_25GBASE_LR:
>>   	case SFF8024_ECC_100GBASE_ER4_25GBASE_ER:
>>   		phylink_set(modes, 100000baseLR4_ER4_Full);
>> +		phylink_set(modes, 25000baseLR_Full);
> I _think_ the discussion here concluded that the patch is insufficient
> / DoA? Either way, I wanted to relay that AI code review points out
> we may also want to set __set_bit(PHY_INTERFACE_MODE_25GBASER,
> interfaces) here:
>
> https://netdev-ai.bots.linux.dev/ai-review.html?id=c91c0f54-56d5-4356-89cd-b57cbb289495
>
I concluded the following:

1. there is no confusion with qsfp / 4 serdes lanes

2. 25GBASER is indeed missing, because this case does not fallthrough.

Something open for discussion is whether to handle
SFF8024_ECC_100GBASE_LR4_25GBASE_LR/_ER differently, e.g.:

     case SFF8024_ECC_100GBASE_LR4_25GBASE_LR:
         phylink_set(modes, 25000baseLR_Full);
         fallthrough;
     case SFF8024_ECC_100GBASE_ER4_25GBASE_ER:
         phylink_set(modes, 100000baseLR4_ER4_Full);
         __set_bit(PHY_INTERFACE_MODE_25GBASER, interfaces);
         break;

I.e. should the ER variant support 25000baseLR_Full?


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2026-01-21  9:44 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-18 14:07 [PATCH 0/2] net: sfp: support 25G long-range modules (extended compliance code 0x3) Josua Mayer
2026-01-18 14:07 ` [PATCH 1/2] net: ethtool: Add link mode for 25Gbps long-range fiber Josua Mayer
2026-01-18 14:07 ` [PATCH 2/2] net: sfp: support 25G long-range modules (extended compliance code 0x3) Josua Mayer
2026-01-18 16:01   ` Andrew Lunn
2026-01-19  7:30     ` Josua Mayer
2026-01-19 10:48       ` Russell King (Oracle)
2026-01-19 19:30   ` Jakub Kicinski
2026-01-21  9:44     ` Josua Mayer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox