Re: [PATCH net-next v9 03/10] net: phylink: Register a phy_port for MAC-driven SFP busses
From: Maxime Chevallier
Date: Wed May 13 2026 - 09:02:03 EST
Hi Andrew,
On 4/15/26 01:38, Andrew Lunn wrote:
This phy_port represents the SFP cage itself, and not the module
+static int phylink_create_sfp_port(struct phylink *pl)
I'm thinking about naming here. If this represent the cage, why not
call this phylink_create_sfp_cage_port(). I assume as some point there
is going to be something for the module, and it seem like the naming
is going to be confusing.
+{
+ struct phy_port *port;
+ int ret = 0;
+
+ if (!pl->netdev || !pl->sfp_bus)
+ return 0;
+
+ port = phy_port_alloc();
+ if (!port)
+ return -ENOMEM;
+
+ port->is_sfp = true;
+ port->is_mii = true;
+ port->active = true;
If this is a cage, not a module, does is_sfp = true make sense?
And what does an active cage mean?
My bad I realised that I forgot to reply to this comment :( So, is_sfp is meant for sfp cages, I'll followup with some documentation update.
Active means we want this port to be used. For now, every port we represent is active. The next step for that work will implement the muxing and port switchover logic, where the active ports will represent the ones that actually got the link. For now, we don't have the logic
to expose and use that.
In retrospect, It's something that should've been added in later steps.
Maxime
Andrew