Received: by 2002:a05:7412:98c1:b0:fa:551:50a7 with SMTP id kc1csp214291rdb; Fri, 5 Jan 2024 07:34:48 -0800 (PST) X-Google-Smtp-Source: AGHT+IGgBK2CCKBazddWb1mALBrI3R8HXvG/Rw6Uv5wg/bYpXdLQeR/OmWWOBryZ1z77xOjfYbdU X-Received: by 2002:aa7:9843:0:b0:6da:401a:c5e1 with SMTP id n3-20020aa79843000000b006da401ac5e1mr2476618pfq.49.1704468888689; Fri, 05 Jan 2024 07:34:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704468888; cv=none; d=google.com; s=arc-20160816; b=ZFjjaSKtNv37XGuhifv4TbYYMciSLFb03u19cxUtKi/BpJI43GZU1Ko84TG0ZW+i15 ZRi/4fMYbqgvN9SnS5CUQiM5PkKT3rirQgNsA348EVf0ziQory8EaNrx1+wAxW1IJ6qc HEaE7SycDu6BBwvIQ9JMMOooTGuSQQd9d2Dnitm0azgiTHJV1JtTAQ1lBq0WALfotOZt II2CLxj99Zbmo9Ra94lKS3ip7Lt8y7PfkEFA8S0TeYBJ0bJ66muyVdf/JAJcYL4DPDcJ H1U6wo2nWKK8TJ4lkrHcWFmSA36ggfqT5ouko2xxHFEDhaUQLH7FD9WLo/Z6+Z3ay/aG SmOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=HlJFqg+osmXCgn/pXd3UWCmw8xaEkh4vZNHNpeYjElM=; fh=LC2oG+6w0geia0TeWcvO+8OTNxqJKljWfNfweFKsL20=; b=aNgZ+vkiWTj0Jfg/8bwGSeRqf92mip/f20DwKfC5xdYrfRKmkEWGG5a1Ud0TfJur6f vnRTYB5qtxD0Ju904AvqSINrnHuF0q+Eg1NYDgHXPUAH1M3aFDZLUtYOLTow1r6p5EUj lE7Qy24Z2jPP7On2wgqsPNyAiXTjyQUtssjzz1FjY6WCOG8q6NrTLC7/m/oOfqpB1P11 jSghIdn65t24N+JIQz+Kdxu7r/01b0wi5M9VmgZzbj9407Ag9VzWeKKjiE/7qDIu6+MA YpuEKza+Cu+1+a6MWUuKNqy0yLC5zm0KCzIFl8fJa6+/3GPAHrwrFVf34qayVYsInisz XRQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=GSYVL9PT; spf=pass (google.com: domain of linux-kernel+bounces-17998-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-17998-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id k1-20020a634b41000000b005be1ee5dfc7si1463539pgl.9.2024.01.05.07.34.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Jan 2024 07:34:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-17998-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=GSYVL9PT; spf=pass (google.com: domain of linux-kernel+bounces-17998-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-17998-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 5A7AE284E0C for ; Fri, 5 Jan 2024 15:34:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 018682E650; Fri, 5 Jan 2024 15:34:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="GSYVL9PT" X-Original-To: linux-kernel@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 2D9A72E630; Fri, 5 Jan 2024 15:34:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D3CF9C433C7; Fri, 5 Jan 2024 15:34:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1704468874; bh=HlJFqg+osmXCgn/pXd3UWCmw8xaEkh4vZNHNpeYjElM=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=GSYVL9PTXAYSwpNALY1SVn2NXlMKmUEVgTF9+mh8uTuYpAxYLi2Wdx7VA4uK5leMy 8viMtR4nB43HoWEFWWkdnF4cPnTP9UW6zMAQ/q2+389q2YWnq44ojIUj1d0ivO24K5 2+A9bV8FRiOukLRlFbCSiImG/YQ1voZ5crrKPv8GFwSJ6FOOAr6i9m86dLuxWwYIdz vhv/bxh8tEjpzhJMMapIt++UdSNp5c135AkkTURe7pxgk2gkHsnILYAWIpS1TIHpmq L6wp54OdzK9K9CHBdzlnrymMOCM29X/X6GZ/BFng9LqIkXpSBbOC5Y+5EaK8rH+2+5 7ttzvqPCjh6PA== Date: Fri, 5 Jan 2024 07:34:32 -0800 From: Jakub Kicinski To: Maxime Chevallier Cc: davem@davemloft.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, thomas.petazzoni@bootlin.com, Andrew Lunn , Eric Dumazet , Paolo Abeni , Russell King , linux-arm-kernel@lists.infradead.org, Christophe Leroy , Herve Codina , Florian Fainelli , Heiner Kallweit , Vladimir Oltean , =?UTF-8?B?S8O2cnk=?= Maincent , Jesse Brandeburg , Jonathan Corbet , Marek =?UTF-8?B?QmVow7pu?= , Piergiorgio Beruto , Oleksij Rempel , =?UTF-8?B?Tmljb2zDsg==?= Veronese , Simon Horman Subject: Re: [PATCH net-next v5 01/13] net: phy: Introduce ethernet link topology representation Message-ID: <20240105073432.671159e9@kernel.org> In-Reply-To: <20240105102918.24398552@device-28.home> References: <20231221180047.1924733-1-maxime.chevallier@bootlin.com> <20231221180047.1924733-2-maxime.chevallier@bootlin.com> <20240104151242.52fa8cb4@kernel.org> <20240105102918.24398552@device-28.home> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Fri, 5 Jan 2024 10:29:18 +0100 Maxime Chevallier wrote: > I'll give it a try, it could be doable to try to keep the index for > _some_ PHYs. I had a first try at this in the very first iteration, but > that was lost when converting to xarray for the index management. Since > the phy_device keeps track of its own index, we can try to re-use it, > but I can see it becoming difficult if we destroy the topology when all > PHYs are detached (after ndo_close). What I was thinking is if phy already has phyindex, and that index is unused in the xarray of netdev in question - try to use that phyindex instead of allocating a new one? IDK if phys can move between netdevs, or get freed/recreated automatically - otherwise it should work? (If user unbinds and rebinds the PHY driver for instance that's their fault, we can renumber).