* [PATCH v3] net: sfp: handle 100G/25G active optical cables in sfp_parse_support
@ 2023-08-18 11:05 Josua Mayer
2023-08-18 11:37 ` Russell King (Oracle)
2023-08-19 18:34 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: Josua Mayer @ 2023-08-18 11:05 UTC (permalink / raw)
To: netdev, linux-kernel
Cc: Josua Mayer, Russell King, Andrew Lunn, Heiner Kallweit,
David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni
Handle extended compliance code 0x1 (SFF8024_ECC_100G_25GAUI_C2M_AOC)
for active optical cables supporting 25G and 100G speeds.
Since the specification makes no statement about transmitter range, and
as the specific sfp module that had been tested features only 2m fiber -
short-range (SR) modes are selected.
The 100G speed is irrelevant because it would require multiple fibers /
multiple SFP28 modules combined under one netdev.
sfp-bus.c only handles a single module per netdev, so only 25Gbps modes
are selected.
sfp_parse_support already handles SFF8024_ECC_100GBASE_SR4_25GBASE_SR
with compatible properties, however that entry is a contradiction in
itself since with SFP(28) 100GBASE_SR4 is impossible - that would likely
be a mode for qsfp modules only.
Add a case for SFF8024_ECC_100G_25GAUI_C2M_AOC selecting 25gbase-r
interface mode and 25000baseSR link mode.
Also enforce SFP28 bitrate limits on the values read from sfp eeprom as
requested by Russell King.
Tested with fs.com S28-AO02 AOC SFP28 module.
Signed-off-by: Josua Mayer <josua@solid-run.com>
---
drivers/net/phy/sfp-bus.c | 10 ++++++++++
1 file changed, 10 insertions(+)
V1 -> V2: added separate case SFF8024_ECC_100G_25GAUI_C2M_AOC
V1 -> V2: added bitrate check for eeprom values
V2 -> V3: updated multi-line comment style
diff --git a/drivers/net/phy/sfp-bus.c b/drivers/net/phy/sfp-bus.c
index e8dd47bffe43..208a9393c2df 100644
--- a/drivers/net/phy/sfp-bus.c
+++ b/drivers/net/phy/sfp-bus.c
@@ -258,6 +258,16 @@ void sfp_parse_support(struct sfp_bus *bus, const struct sfp_eeprom_id *id,
switch (id->base.extended_cc) {
case SFF8024_ECC_UNSPEC:
break;
+ case SFF8024_ECC_100G_25GAUI_C2M_AOC:
+ if (br_min <= 28000 && br_max >= 25000) {
+ /* 25GBASE-R, possibly with FEC */
+ __set_bit(PHY_INTERFACE_MODE_25GBASER, interfaces);
+ /* There is currently no link mode for 25000base
+ * with unspecified range, reuse SR.
+ */
+ phylink_set(modes, 25000baseSR_Full);
+ }
+ break;
case SFF8024_ECC_100GBASE_SR4_25GBASE_SR:
phylink_set(modes, 100000baseSR4_Full);
phylink_set(modes, 25000baseSR_Full);
--
2.35.3
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v3] net: sfp: handle 100G/25G active optical cables in sfp_parse_support
2023-08-18 11:05 [PATCH v3] net: sfp: handle 100G/25G active optical cables in sfp_parse_support Josua Mayer
@ 2023-08-18 11:37 ` Russell King (Oracle)
2023-08-19 18:34 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Russell King (Oracle) @ 2023-08-18 11:37 UTC (permalink / raw)
To: Josua Mayer
Cc: netdev, linux-kernel, Andrew Lunn, Heiner Kallweit,
David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni
On Fri, Aug 18, 2023 at 01:05:56PM +0200, Josua Mayer wrote:
> Handle extended compliance code 0x1 (SFF8024_ECC_100G_25GAUI_C2M_AOC)
> for active optical cables supporting 25G and 100G speeds.
>
> Since the specification makes no statement about transmitter range, and
> as the specific sfp module that had been tested features only 2m fiber -
> short-range (SR) modes are selected.
>
> The 100G speed is irrelevant because it would require multiple fibers /
> multiple SFP28 modules combined under one netdev.
> sfp-bus.c only handles a single module per netdev, so only 25Gbps modes
> are selected.
>
> sfp_parse_support already handles SFF8024_ECC_100GBASE_SR4_25GBASE_SR
> with compatible properties, however that entry is a contradiction in
> itself since with SFP(28) 100GBASE_SR4 is impossible - that would likely
> be a mode for qsfp modules only.
>
> Add a case for SFF8024_ECC_100G_25GAUI_C2M_AOC selecting 25gbase-r
> interface mode and 25000baseSR link mode.
> Also enforce SFP28 bitrate limits on the values read from sfp eeprom as
> requested by Russell King.
>
> Tested with fs.com S28-AO02 AOC SFP28 module.
>
> Signed-off-by: Josua Mayer <josua@solid-run.com>
Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Thanks!
--
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] 3+ messages in thread
* Re: [PATCH v3] net: sfp: handle 100G/25G active optical cables in sfp_parse_support
2023-08-18 11:05 [PATCH v3] net: sfp: handle 100G/25G active optical cables in sfp_parse_support Josua Mayer
2023-08-18 11:37 ` Russell King (Oracle)
@ 2023-08-19 18:34 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-08-19 18:34 UTC (permalink / raw)
To: Josua Mayer
Cc: netdev, linux-kernel, linux, andrew, hkallweit1, davem, edumazet,
kuba, pabeni
Hello:
This patch was applied to netdev/net.git (main)
by David S. Miller <davem@davemloft.net>:
On Fri, 18 Aug 2023 13:05:56 +0200 you wrote:
> Handle extended compliance code 0x1 (SFF8024_ECC_100G_25GAUI_C2M_AOC)
> for active optical cables supporting 25G and 100G speeds.
>
> Since the specification makes no statement about transmitter range, and
> as the specific sfp module that had been tested features only 2m fiber -
> short-range (SR) modes are selected.
>
> [...]
Here is the summary with links:
- [v3] net: sfp: handle 100G/25G active optical cables in sfp_parse_support
https://git.kernel.org/netdev/net/c/db1a6ad77c18
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-08-19 18:34 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-18 11:05 [PATCH v3] net: sfp: handle 100G/25G active optical cables in sfp_parse_support Josua Mayer
2023-08-18 11:37 ` Russell King (Oracle)
2023-08-19 18:34 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).