Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp8000185rdb; Thu, 4 Jan 2024 15:12:55 -0800 (PST) X-Google-Smtp-Source: AGHT+IGP4lrwPbBlX6Maj0smy01pGEYqFgiWrRIwpwZRUQ++Z+l9QXAxQGJosqVvwN8SkctW+o7b X-Received: by 2002:a05:620a:5376:b0:77f:5fa:6054 with SMTP id op54-20020a05620a537600b0077f05fa6054mr1377140qkn.15.1704409975295; Thu, 04 Jan 2024 15:12:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704409975; cv=none; d=google.com; s=arc-20160816; b=PjHNE4WOcbuVVG/UPDN5r+6HdQPXrx8b6uL6ikOjTEO30E+F2vREdf06oL6wDb7h7b JsMmZOAj0vly4ZqZ/xFcl/MP2/KPAuErmPi4zVf1V/+aGlFYO1tvrqsUrhrIHS0u74It mE4k4wNWr2e0IgUFjV+bdvxp/kT1FH7rZVnwfSStn4O/kijt6qWb8QpGWmRDl0qTaFJj Do42fT5YzdY5YB0w51xafgIMKtOweAcMEiZxF1isCVj68QlrUdfI08FVZCANv5lX7I+1 HzUW0stqap4WPVITTmSB5Ko5mxiwdUu3M8ljd4KUj0BNV17C6kG0+vw+4VBGOS2zYnT1 v4Xw== 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=Q0MxSa+Y3CXRirXVa6rgGykcuAMJko6xDLLC/qm9iLs=; fh=LC2oG+6w0geia0TeWcvO+8OTNxqJKljWfNfweFKsL20=; b=Sk/LIyxG33C43lJfDmPy+mTULF3RU2xCW8A4cYLV5zZYLVtICNkguaQj1SxPs+eUtq GGn1f2BF6BDCKjdmJ1Z3JTe96pUUpJioftdjwg+q4ToaeO4O70udsRbfXTLBVinCxp// 2fCeqfcTvj+uZnBJd6iZA6aKPsqPX/k0IFeQrDFfatdGX3laFVbUpUWvI1Pgkwvu6fnR Y376iBC3rrrhLY6WBCpE9veS4prY2Bie4+eHP/gTSDQStHELKy/G6h4FBMB6maomfw/j NP13RXLx+A4UlMHqjDtGe2doiRsS6KDlR+/is0LanFAD2vHHXpVUfPKTpGrfswSnkk9A IC/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=K7uutDbO; spf=pass (google.com: domain of linux-kernel+bounces-17319-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-17319-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id oq10-20020a05620a610a00b007814ea41d08si490058qkn.182.2024.01.04.15.12.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jan 2024 15:12:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-17319-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=K7uutDbO; spf=pass (google.com: domain of linux-kernel+bounces-17319-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-17319-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id F3B071C2229D for ; Thu, 4 Jan 2024 23:12:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D47DA2D054; Thu, 4 Jan 2024 23:12:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="K7uutDbO" 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 12D7E2D036; Thu, 4 Jan 2024 23:12:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A4408C433C7; Thu, 4 Jan 2024 23:12:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1704409964; bh=pna8e9qSOEoIxNWRYi8FBs+Y3qy9hZxpLEHfzkPhAic=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=K7uutDbOmNGjFWw3LNJOkzdRI12thZbYoWybuII94Oumo+hdXEvUXvCMvw0YYbjyB eAI19/r67/1Wnl5uwHCoIGnbGMn6A7W20m2Mc0fFC2wQ08RxCydThkigdlrdvToazm on7ChpgLLum9DQ7HJOPa3wnMKRb0lqG4qG5Ld+cjWesc/R9orAtE/A5IOzD/kTQVbD hujps7Zm+aO0RSUAgfSgA83ELs2aofO/O7faW3mV2ex2gxpQ1JVhY0nx02iFP1fSR1 J4l1Mbgfa8NajA7xR9HQFOaghWhpitCqKQvVrp4FfyoGWXTJE0f2YhrYRfGJdcOF9z QU7iTVyedRgvw== Date: Thu, 4 Jan 2024 15:12:42 -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: <20240104151242.52fa8cb4@kernel.org> In-Reply-To: <20231221180047.1924733-2-maxime.chevallier@bootlin.com> References: <20231221180047.1924733-1-maxime.chevallier@bootlin.com> <20231221180047.1924733-2-maxime.chevallier@bootlin.com> 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 Thu, 21 Dec 2023 19:00:34 +0100 Maxime Chevallier wrote: > @@ -2441,6 +2442,7 @@ struct net_device { > #if IS_ENABLED(CONFIG_CGROUP_NET_PRIO) > struct netprio_map __rcu *priomap; > #endif > + struct phy_link_topology link_topo; Perhaps others would disagree but can we make this a pointer instead? Only allocate it on demand, when first PHY gets attached? Both saves space and netdevice.h will no longer need to know the definition of the struct. Complete noob question but I thought PHYs get attached at ndo_open time for drivers, don't they? We shouldn't want to re-ID in that case. > struct phy_device *phydev; > struct sfp_bus *sfp_bus; > struct lock_class_key *qdisc_tx_busylock; > @@ -10872,6 +10873,8 @@ struct net_device *alloc_netdev_mqs(int sizeof_priv, const char *name, > #ifdef CONFIG_NET_SCHED > hash_init(dev->qdisc_hash); > #endif > + phy_link_topo_init(&dev->link_topo); > + > dev->priv_flags = IFF_XMIT_DST_RELEASE | IFF_XMIT_DST_RELEASE_PERM; > setup(dev); > I think you're missing a call to xa_destroy() somewhere, no?