From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtpout-04.galae.net (smtpout-04.galae.net [185.171.202.116]) (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 B93AF3376A9 for ; Mon, 2 Mar 2026 09:01:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.171.202.116 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772442078; cv=none; b=YrPE5YZvcKYnKhStgsjA6THyJHnXJckrwjlMvMVRD00RwgiXxun9xBQl+pj20IECpx2LpEGPCAGOuh1u0X4jGarU1DK9ZqwCWwNOb03Q07TLqv7IG25fvLLPBD8sxmxxIfJFShi4O8XR9k6U9318eMJhwVAx00YinAG/amNxWnU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772442078; c=relaxed/simple; bh=O7thirgE/HmH5gPIPWkZO3RkV6af64nRGWm0dBCW59Q=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=JKdYRbSmZxtyL3fkHDu3g1QAJVGdG+7ne2fCWJ9T/SzPcVRFvsDTV+dnRGBgxgfcnHYphyruqMaVWOsi/axsmb2BA18y1h+S3QA79Tw78oMzPZkmD6robqgc/E4de6SmCpM7Kl8C0FNbZksDd0Fz22W1SsZ6IJjSEviYzj2UByg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=RrA52l3b; arc=none smtp.client-ip=185.171.202.116 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="RrA52l3b" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-04.galae.net (Postfix) with ESMTPS id 36490C40F8A; Mon, 2 Mar 2026 09:01:32 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id D46905FE89; Mon, 2 Mar 2026 09:01:14 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 80AAA10369517; Mon, 2 Mar 2026 10:00:40 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1772442073; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:content-language:in-reply-to:references; bh=NatQwThJvajcx8kzrOyk8duEdQeD0wDtLj00K/M0jVo=; b=RrA52l3bxUkrs68CzjlH+eUAASGK1rdtkxtcwY/JLXcYLWEvnkrgQR2m8p5YUlq2sp3OD3 4x8czOfzEOF4arj0ayiQxXXHL8XR9a8eoVGT4oQSKQxgd4/bnratP9wIlsUiLRqdcWaHu7 Nvl1NgmVBGdqJaLnDx0IadewB2wS/Qccv0wgbGkBGtr3eMmsF5ZIeeQ6G01eriOI4jmTc2 2EW/rXaraBQH1xhbBcFAXfLwkSP4Gx/O/1v+KMChnLo9gtJOG1NAEtph7/l+gq4qUt1064 3lXMKgVbmEndCBIf1piM7EJg7Cgx8u8DhA9DBd6VEmRQSFdl5BZBfWJKHXlatw== Message-ID: Date: Mon, 2 Mar 2026 10:00:36 +0100 Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [RFC net-next 0/4] ethtool: CMIS module diagnostic loopback support To: Andrew Lunn , =?UTF-8?B?QmrDtnJuIFTDtnBlbA==?= Cc: Jakub Kicinski , netdev@vger.kernel.org, Donald Hunter , "David S. Miller" , Eric Dumazet , Paolo Abeni , Simon Horman , Saeed Mahameed , Tariq Toukan , Leon Romanovsky , Andrew Lunn , Michael Chan , Hariprasad Kelam , Ido Schimmel , Danielle Ratson , linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org References: <20260219130050.2390226-1-bjorn@kernel.org> <415c4922-cc8d-4e35-bbac-3a532f44d238@lunn.ch> <20260219160519.323041bf@kernel.org> <3b0949fa-0b05-4bce-86c0-2a7a058865a5@lunn.ch> <20260220131254.03874c4c@kernel.org> <20260223150401.7993b11a@kernel.org> <363527d6-1f29-4399-83a7-978785d1e11f@lunn.ch> <4c51f18c-5eb1-4a9e-93b9-70cf7a4fd387@lunn.ch> From: Maxime Chevallier Content-Language: en-US In-Reply-To: <4c51f18c-5eb1-4a9e-93b9-70cf7a4fd387@lunn.ch> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Last-TLS-Session-Version: TLSv1.3 Hello Andrew, BJörn, On 25/02/2026 14:14, Andrew Lunn wrote: >>> 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? > > If you hot plug hardware, a new PHY pops into existence, i don't think > it is too unreasonable for the hot plugable parts to change ids. I > would however expect the fixed parts to keep there IDs. That's indeed the phy index behaviour. > > But here we are talking about software, a kernel upgrade/downgrade > causing the IDs to change. > >> Instead of ids, use string name and/or topology indices (e.g. >> phy_index)? All three -- owner, phy_index, name tuple? 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 :) Maxime