From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (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 047E11F3BA4 for ; Wed, 20 Aug 2025 04:45:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755665121; cv=none; b=cNyPtd2zpZQ57tmFKqxglCj35QXRfYtWJVDjemf8gs9y9ANW+PWla1hb7Wv1lJJgQ7u4XbqNL7PPCVOdI0Gr7Dq71y2dquOcGvQPASspV3IZkt1H5bK143QIm2fRlSVOAwedT+6n1xZikg4Z3MDLhGIV442DMFvMjFMTrgcmT/g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755665121; c=relaxed/simple; bh=FjnnWJI1niM6HBzIl/Pa9v+/KqD2U3tukeGd7ncCZ8I=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=L8dtnbMHgv2oVnu9xtcgIaSw+jR+gsnTgno+Y30OQjYQwj1OBYjTYjTthYAvp9rBejryoE08r3bIfo1Seh0uAfQVigiD70G9izHBbvr6Ej8LaPHOeP0Ty++x2x3U+9fnuuVdqcH0ZNDPbmfusA7aIKoLwBxSufgfB/6rw8BqpmI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1uoagY-000120-MU; Wed, 20 Aug 2025 06:44:30 +0200 Received: from pty.whiteo.stw.pengutronix.de ([2a0a:edc0:2:b01:1d::c5]) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1uoagQ-001Bgj-2e; Wed, 20 Aug 2025 06:44:22 +0200 Received: from ore by pty.whiteo.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1uoagQ-005pET-2F; Wed, 20 Aug 2025 06:44:22 +0200 Date: Wed, 20 Aug 2025 06:44:22 +0200 From: Oleksij Rempel To: Andrew Lunn Cc: Jakub Kicinski , "David S. Miller" , Eric Dumazet , Paolo Abeni , Simon Horman , Donald Hunter , Jonathan Corbet , Heiner Kallweit , Russell King , Kory Maincent , Maxime Chevallier , Nishanth Menon , kernel@pengutronix.de, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, UNGLinuxDriver@microchip.com, linux-doc@vger.kernel.org, Michal Kubecek , Roan van Dijk Subject: Re: [PATCH net-next v2 1/5] ethtool: introduce core UAPI and driver API for PHY MSE diagnostics Message-ID: References: <20250815063509.743796-1-o.rempel@pengutronix.de> <20250815063509.743796-2-o.rempel@pengutronix.de> <489b2959-3374-4766-a982-9e7c26077899@lunn.ch> Precedence: bulk X-Mailing-List: linux-doc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <489b2959-3374-4766-a982-9e7c26077899@lunn.ch> X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-Accept-Language: de,en X-Accept-Content-Type: text/plain X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ore@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-doc@vger.kernel.org On Wed, Aug 20, 2025 at 05:03:14AM +0200, Andrew Lunn wrote: > > Channel-to-pair mapping is normally straightforward, but in some cases > > (e.g. 100BASE-TX with MDI-X resolution unknown) the mapping is ambiguous. > > If hardware does not expose MDI-X status, the exact pair cannot be > > determined. To avoid returning misleading per-channel data in this case, > > a LINK selector is defined for aggregate MSE measurements. > > This is the same with cable test. The API just labels the pairs using > > ETHTOOL_A_CABLE_PAIR_A, > ETHTOOL_A_CABLE_PAIR_B, > ETHTOOL_A_CABLE_PAIR_C, > ETHTOOL_A_CABLE_PAIR_D, > > It does not take into account MDI-X or anything. In the case of the cable test, MDI-X does not affect the reported results, or if it does, we can actively change the configuration and re-run the test. For SQI/MSE on this chip, however, the measurement is purely passive. If the hardware does not expose an MDI-X indicator, we cannot reliably assign the values to a specific pair, so we need the LINK selector to avoid returning misleading data. > > @@ -1174,6 +1246,60 @@ struct phy_driver { > > /** @get_sqi_max: Get the maximum signal quality indication */ > > int (*get_sqi_max)(struct phy_device *dev); > > > > + /** > > + * get_mse_config - Get configuration and scale of MSE measurement > > + * @dev: PHY device > > + * @config: Output (filled on success) > > + * > > + * Fill @config with the PHY's MSE configuration for the current > > + * link mode: scale limits (max_average_mse, max_peak_mse), update > > + * interval (refresh_rate_ps), sample length (num_symbols) and the > > + * capability bitmask (supported_caps). > > + * > > + * Implementations may defer configuration until hardware has > > + * converged; in that case they should return -EAGAIN and allow the > > + * caller to retry later. > > + * > > + * Return: > > + * * 0 - success, @config is valid > > + * * -EOPNOTSUPP - MSE configuration not implemented by the PHY > > + * or not supported in the current link mode > > + * * -ENETDOWN - link is down and configuration is not > > + * available in that state > > This seems a bit odd. phylib knows the state of the link. If it is > down, why would it even ask? Good point. I'll remove this part of comment. -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |