From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7F10634AB03 for ; Thu, 12 Mar 2026 13:51:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773323505; cv=none; b=H7oe5LUpegZJq8OOe5727ZSxTw/3GV+OyjL53kJYJZWShLvLYkLfsQ5SVbX8YEPfWHOFR5GGchGZXLEF0tGNypVJzz4wunK62chUIeT2nta2Td60qYHfRrfaC46GUaMOflTsz321XVj3WUClULlYIimf3uCkIs+e8mUoXM90+Yo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773323505; c=relaxed/simple; bh=9ACImsV3PaE3MjN2Tt3sT85C9g5/Cskv8/oIpybHlhQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=ailSTsZZPnkw3ZbWq710gCUnhjyq95suxuTE3Gi5Wc9o/BYGUebmL70hRr4G8CNha0laPLFgTo1YdpC4B67HFl38ct3HH2em/wa7PHLt99mV8M4eNeeEJUioVx5YDZgk1w5zjn6ei1DS3ryqzHf04JMlKOZ46qhcL7qbk/9A7+s= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1w0gRP-0003i6-Hh; Thu, 12 Mar 2026 14:51:07 +0100 Received: from pty.whiteo.stw.pengutronix.de ([2a0a:edc0:2:b01:1d::c5]) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1w0gRL-0051yO-35; Thu, 12 Mar 2026 14:51:05 +0100 Received: from ore by pty.whiteo.stw.pengutronix.de with local (Exim 4.98.2) (envelope-from ) id 1w0gRN-0000000FJkc-0htF; Thu, 12 Mar 2026 14:51:05 +0100 Date: Thu, 12 Mar 2026 14:51:05 +0100 From: Oleksij Rempel To: Andrew Lunn Cc: Jakub Kicinski , Maxime Chevallier , =?utf-8?B?QmrDtnJuIFTDtnBlbA==?= , netdev@vger.kernel.org, "David S. Miller" , Andrew Lunn , Donald Hunter , Eric Dumazet , Naveen Mamindlapalli , Paolo Abeni , Simon Horman , Danielle Ratson , Hariprasad Kelam , Ido Schimmel , Kory Maincent , Leon Romanovsky , Michael Chan , Pavan Chebbi , Piergiorgio Beruto , Russell King , Saeed Mahameed , Shuah Khan , Tariq Toukan , Willem de Bruijn , linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-rdma@vger.kernel.org Subject: Re: [PATCH net-next 02/11] ethtool: Add loopback netlink UAPI definitions Message-ID: References: <20260310104743.907818-1-bjorn@kernel.org> <20260310104743.907818-3-bjorn@kernel.org> <580debbb-8f6c-4b60-95ef-22c68480ded1@bootlin.com> <085bb0a9-85d3-4d62-9ac4-3461b61da5f3@bootlin.com> <438dae03-4dac-4e66-9f4d-e08b0434c9b4@lunn.ch> <20260311195052.1202174f@kernel.org> <7c45ebf6-0cb2-4a4c-ac12-f4f9bb59c908@lunn.ch> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <7c45ebf6-0cb2-4a4c-ac12-f4f9bb59c908@lunn.ch> X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-Accept-Language: de,en X-Accept-Content-Type: text/plain X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ore@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: netdev@vger.kernel.org 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 |