From patchwork Fri Nov 24 12:27:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 13467594 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b="tntoHK3/" 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 CAABCB6 for ; Fri, 24 Nov 2023 04:27:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:Content-Type:MIME-Version: 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:In-Reply-To:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=zC/jfcnCG06BLzzia+PcDPSaY6kjpC32tyOCy49Eg9U=; b=tntoHK3/hlKUz/ETZlrQn+wm4Y WRHSCG8fVczZCioP7jZtL8cspuLBI/GVB5ThqkxpSlt3AaJFSpkOfikdeCs1nlLovnEUizI3lp1mX 66+gE2P7gHXHgVv78Y34ttrAxPovFvOPSlWtM9C6gOhbKrZIFwhH2MUUh67ZmgtEjD9j0U6edhKXW V9yuELqgOn3u54BJMq0FvbSf+KOsCZbI31bMLuvNSfUYEj4ieQmSCdsNsek0LBkqZ3495MUp+k5DL uDfgoJCgjZWdluiMea3A4KBrMZ8YkFCXxpcUdMoTzcv+Mzh1UBlwYIbGV2E+WjctmZKulGsLilFd+ sHjFby7A==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:53184) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1r6VH3-0002rx-1a; Fri, 24 Nov 2023 12:27:09 +0000 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1r6VH5-0007Eq-Ds; Fri, 24 Nov 2023 12:27:11 +0000 Date: Fri, 24 Nov 2023 12:27:11 +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: Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline Sender: Russell King (Oracle) X-Patchwork-Delegate: kuba@kernel.org 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! And I'll send the cover message again without threading it to the previous series! 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(-)