Re: [RFC net-next 0/4] ethtool: CMIS module diagnostic loopback support

From: Björn Töpel

Date: Wed Feb 25 2026 - 03:40:43 EST


On Wed, 25 Feb 2026 at 05:05, Andrew Lunn <andrew@xxxxxxx> wrote:
>
> > # ethtool --show-loopback eth0
> > Loopback endpoints for eth0:
> > id owner depth direction name enabled
> > 0 mac 1 host->loop->host mac off
> > 1 phy 2 host->loop->host phy-pcs on
> > 2 module 3 line->loop->line cmis-far off
> >
> > # Enable endpoint 2
> > ethtool --set-loopback eth0 id 2 on
>
> We have to be careful about what is ABI here. Initially you plan to
> implement module, so you will have:
>
> # ethtool --show-loopback eth0
> Loopback endpoints for eth0:
> id owner depth direction name enabled
> 0 module 1 line->loop->line cmis-far off
>
> ethtool --set-loopback eth0 id 0 on
>
> And then somebody implements loopback at the mac:
>
> # ethtool --show-loopback eth0
> Loopback endpoints for eth0:
> id owner depth direction name enabled
> 0 mac 1 host->loop->host mac off
> 1 module 2 line->loop->line cmis-far off
>
> You script doing
>
> ethtool --set-loopback eth0 id 0 on
>
> Suddenly does something else.

Indeed!

> Is this an ABI break? How do we make this reliable so implementing
> more loopbacks at different levels does not change how you use
> --set-loopback?

Isn't this somewhat similar to what we have with ifindex/phy_index,
but potentially unstable when modules are swapped/changed?

Instead of ids, use string name and/or topology indices (e.g.
phy_index)? All three -- owner, phy_index, name tuple?


Björn