Subject: Re: [PATCH net-next 02/11] ethtool: Add loopback netlink UAPI definitions

From: Oleksij Rempel <[email-masked]>
Date: Thu, 12 Mar 2026 14:51:05 +0100

On Thu, Mar 12, 2026 at 02:34:40PM +0100, Andrew Lunn wrote:
> > As for me, it is problematic to help the user to understand the datapath
> > depth on a switch. For example:
> 
> Do you mean Ethernet switch? Or MII switch.
> 
> > 
> > CPU -- xMII --- MAC1 [loop] --- fabric --- MAC2 [loop] --- xMII -- PHY
> >                                     \----- MACx [loop] ---
> 
> In DSA, MAC1 is the CPU port of the switch. It is not represented by a
> netif. Since there is no netif, you cannot use ethtool on it. So it is
> impossible to apply loopback here.
> 
> This is one of the oddities of DSA. The CPU port and the conduit
> interface on the host are just plumbing to make the setup work. In
> terms of networking, they are not important. But sometimes you need to
> get into the plumbing to find out why it is blocked up, statistics are
> useful, and maybe loopback as well. We have discussed it a few times
> that MAC1 should have a netif, but the conclusion is that developers
> have a hard enough time with the conduit interface, adding yet another
> oddball interface with no real purpose other than diagnostics is gone
> to make the confusion even worse.
> 
> So i don't think depth is relevant here.
 
I have some projects where we need to configure the egress queue from
the switch to the CPU MAC. Currently my idea is to represent them as
optional HW offloading helpers for the host MAC. For example, this
pipe is already represented on the linux side as one interface:
eth0 - [ SoC MAC0 --- xMII --- Switch MAC1 ]

MAC0 and MAC1 counters are merged to one output.

So, the egress queue configuration of the Switch MAC1 would be an
ingress queue configuration of the MAC0 interface.
The same about remote loopback on MAC1, are additional local loopbacks
of MAC0. If we do it with counters, why not with everything else? 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |