Thread (25 messages) 25 messages, 4 authors, 2026-03-04

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

From: Maxime Chevallier <maxime.chevallier@bootlin.com>
Date: 2026-03-04 16:09:14
Also in: linux-rdma, lkml

Hi Björn,

On 04/03/2026 16:52, Björn Töpel wrote:
Hey!

On Mon, 2 Mar 2026 at 10:01, Maxime Chevallier
[off-list ref] wrote:
quoted
The overall approach after all these discussions sounds fine to me, I do
think that the index of the component that does the loopback needs to be
there somewhere, when relevant.

Either through a name string, or a combo of an enum indicating the
component type (MAC/PHY/Module/etc.) + its index. I think it's safe to
assume that indices will fit in u32 ?

something like :

# MAC PCS loopback
ethtool --set-loopback eth0 loc mac name pcs

# PHY id 2 PMA loopback (I'm making things up here)
ethtool --set-loopback eth0 loc phy id 2 name pma

That way we can extend that fairly easily for, say, combo-port devices
where we could select which of the port we want to loopback :)
Ok! I'll spin a new version with this in mind. To improve my mental
model, could you give an example how you would use a combo-port from a
userland perspective?
Of course :)

Considering this setup :

 +-----+     +-----+
 | MAC |     | PHY |----- SFP
 |     |-----|     |----- RJ45
 +-----+     +-----+

It's still WIP but the current state of what I have in the pipe looks like :

# List the ports
ethtool --show-ports eth0

Port for eth10:       # <- This port represents the RJ45 port of the PHY
	Port id: 1
	Supported link modes:  10baseT/Half 10baseT/Full
	                       100baseT/Half 100baseT/Full
	                       1000baseT/Full
	                       10000baseT/Full
	                       2500baseT/Full
	                       5000baseT/Full
	Port type: mdi
	Active: yes
	Link: up

Port for eth1:          # <- This port represents the SFP cage
	Port id: 2
	Vacant: no
	Supported MII interfaces : 10gbase-r
	Port type: sfp
	Active: no

Port for eth1:          # <- This port represents the SFP module inside the cage
	Port id: 4
	Supported link modes:  10000baseCR/Full
	Port type: mdi
	Active: no
	Link: up


# Select the SFP port as the active one (note that we could either use
port 2 or 4 here for the same result) :

ethtool --set-port eth0 id 4 active on 

I may add something like :

ethtool --set-port eth0 type sfp active on
ethtool --set-port eth0 type tp active on
 
Maxime
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help