Re: [PATCH net-next v9 04/10] net: phy: Create SFP phy_port before registering upstream
From: Maxime Chevallier
Date: Wed Apr 15 2026 - 03:20:57 EST
Hi Andrew,
On 15/04/2026 01:46, Andrew Lunn wrote:
> On Fri, Apr 03, 2026 at 02:37:48PM +0200, Maxime Chevallier wrote:
>> When dealing with PHY-driven SFP, we create a phy_port representing the
>> SFP bus when we know we have such a bus.
>
> I'm missing the big picture here.
>
> Do we have three different things represented in the topology:
>
> SFP bus-> SFP cage-> SFP module
>
> Andrew
Ah by bad, this is a wording issue, this is the port for the cage indeed.
The model I ended-up with is to represent the SFP cage itself as a PHY
port, but I've been calling that the "sfp bus port" in the code so far :/
Let me try to summarize the phy_port usage, especially with SFP :
phylink->sfp_bus_port (should be renamed sfp_cage_port)
vacant = true
|
v
+-----+ +----------+
| MAC | - | SFP cage |
+-----+ +----------+
phylink->sfp_bus_port, vacant = false
|
| phylink->mod_port
v v
+-----+ +----------+ +------------+
| MAC | --- | SFP cage | --- | SFP Module |
+-----+ +----------+ +------------+
one of phydev->ports
v
+-----+ +-----+ +------+
| MAC | --- | PHY | --- | RJ45 |
+-----+ +-----+ +------+
one of phydev->ports
v
+------+
+-----+ +-----+ /-- | RJ45 |
| MAC | --- | PHY | -+ +------+
+-----+ | | -+ +----------+
+-----+ \-- | SFP Cage |
+----------+
^
phydev->sfp_bus_port +
is also in phydev->ports
port->vacant = true
one of phydev->ports
v
+------+
+-----+ +-----+ /-- | RJ45 | phydev->mod_port
| MAC | --- | PHY | -+ +------+ v
+-----+ | | -+ +----------+ +------------+
+-----+ \-- | SFP Cage | --- | SFP Module |
+----------+ +------------+
^
phydev->sfp_bus_port +
is also in phydev->ports
port->vacant = false
I should probably add that at least in the cover. Does it clarify the
picture a little bit ?
Thanks a lot for the reviews :)
Maxime