From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b="Ly2EujlL" Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [IPv6:2001:4d48:ad52:32c8:5054:ff:fe00:142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 15742D71 for ; Fri, 24 Nov 2023 04:26:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=NJ4pJItto6MO5iPtZbee1r50454UJOBT1TQ8fJJMqok=; b=Ly2EujlL0oRmNrqS/oanmy4DqD WSEBUrvRFxdvt4SFxBUFU6i9ppQHvLtLOAIqB7lUsUPzWl82rTbtVTPpmlTKzTl/y1x6BRurZWZsO Td1OV8Hriugetkx8JQPOm237NgU9oaRHPB8NiOsftGIsLeC5Gop+su/IgfGN1iMGNihUga8N+CfW5 j1esv7JSs8Skq4RuzjUQwCjyDxGTaGnt2l8sajNYxY1HabX6sLgcBK3A7Cqo4duB3grq0xmU8FTVS gMuuEsgYBafytaWO4BoLW+v5EvqRnC6xhIclziAjmKmft+H9KcTL+850/JO0Q9+EKc5TzwGievag2 3YV5fYdQ==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:37702) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1r6VFs-0002rh-38; Fri, 24 Nov 2023 12:25:56 +0000 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1r6VFu-0007Eg-CP; Fri, 24 Nov 2023 12:25:58 +0000 Date: Fri, 24 Nov 2023 12:25:58 +0000 From: "Russell King (Oracle)" To: Andrew Lunn , Heiner Kallweit Cc: Broadcom internal kernel review list , "David S. Miller" , Eric Dumazet , Florian Fainelli , Jakub Kicinski , Marek =?iso-8859-1?Q?Beh=FAn?= , netdev@vger.kernel.org, Paolo Abeni Subject: [PATCH net-next 00/10] net: phylink: improve PHY validation Message-ID: References: Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: Russell King (Oracle) Hi, One of the issues which has concerned me about the rate matching implenentation that we have is that phy_get_rate_matching() returns whether rate matching will be used for a particular interface, and we enquire only for one interface. Aquantia PHYs can be programmed with the rate matching and interface mode settings on a per-media speed basis using the per-speed vendor 1 global configuration registers. Thus, it is possible for the PHY to be configured to use rate matching for 10G, 5G, 2.5G with 10GBASE-R, and then SGMII for the remaining speeds. Therefore, it clearly doesn't make sense to enquire about rate matching for just one interface mode. Also, PHYs that change their interfaces are handled sub-optimally, in that we validate all the interface modes that the host supports, rather than the interface modes that the PHY will use. This patch series changes the way we validate PHYs, but in order to do so, we need to know exactly which interface modes will be used by the PHY. So that phylib can convey this information, we add "possible_interfaces" to struct phy_device. possible_interfaces is to be filled in by a phylib driver once the PHY is configured (in other words in the PHYs .config_init method) with the interface modes that it will switch between. This then allows users of phylib to know which interface modes will be used by the PHY. This allows us to solve both these issues: where possible_interfaces is provided, we can validate which ethtool link modes can be supported by looking at which interface modes that both the PHY and host support, and request rate matching information for each mode. This should improve the accuracy of the validation. Sending this out again without RFC as Jie Luo will need it for the QCA8084 changes. No changes except to add the attributations already received. Thanks! drivers/net/phy/aquantia/aquantia.h | 5 + drivers/net/phy/aquantia/aquantia_main.c | 76 +++++++++++- drivers/net/phy/bcm84881.c | 12 ++ drivers/net/phy/marvell10g.c | 203 ++++++++++++++++++++----------- drivers/net/phy/phy_device.c | 2 + drivers/net/phy/phylink.c | 177 +++++++++++++++++++-------- include/linux/phy.h | 3 + 7 files changed, 353 insertions(+), 125 deletions(-) -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!