From nobody Sat Jan 4 23:11:50 2025 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 7286D1EC4C2 for ; Sat, 21 Dec 2024 08:15:50 +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=1734768952; cv=none; b=dRple3RKonB5BChWeI5Elz1fomyyqLVYVhAm/Q6LqWU3WKTRKNKxAkMk9whPKgYL3XiYzC9WlMBvri+jbFT/Tj4XI3vTFLvOMlBNjbQQsLGItvKBROi+w/DjaonbUtUVNAZz/1OhHyUDMtMCLwMAu7dEf0yN4HBdlaim3PSMSMw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734768952; c=relaxed/simple; bh=2wXbYqaWGW9mOPTkLt5y4RaTyBb9rPot160rt9mK8bo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=DHdQKBIfiGf00apJwQBJDRRNnuU2wV6TVr/mln8tzr63+aophmlvPagHaVcXT7hvL4exXxVfyTT9inLFD/877bkkCYZ9A+D/kjVYYTpd1PUby2o7t1asXFLjNfBS4m5ftejR1/GPJwcumOhPQwPwbgwt57C4VbjtHOMxVl9pSbU= 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 1tOue8-0000Qq-3z; Sat, 21 Dec 2024 09:15:36 +0100 Received: from dude04.red.stw.pengutronix.de ([2a0a:edc0:0:1101:1d::ac]) 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 1tOue2-004Vds-37; Sat, 21 Dec 2024 09:15:31 +0100 Received: from ore by dude04.red.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1tOue3-00CbTD-25; Sat, 21 Dec 2024 09:15:31 +0100 From: Oleksij Rempel To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Andrew Lunn , Heiner Kallweit , Jonathan Corbet Cc: Oleksij Rempel , kernel@pengutronix.de, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, Simon Horman , Russell King , Maxime Chevallier , linux-doc@vger.kernel.org Subject: [PATCH net-next v4 4/8] Documentation: networking: update PHY error counter diagnostics in twisted pair guide Date: Sat, 21 Dec 2024 09:15:26 +0100 Message-Id: <20241221081530.3003900-5-o.rempel@pengutronix.de> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241221081530.3003900-1-o.rempel@pengutronix.de> References: <20241221081530.3003900-1-o.rempel@pengutronix.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Replace generic instructions for monitoring error counters with a procedure using the unified PHY statistics interface (`--all-groups`). Signed-off-by: Oleksij Rempel --- .../twisted_pair_layer1_diagnostics.rst | 39 +++++++++++++------ 1 file changed, 28 insertions(+), 11 deletions(-) diff --git a/Documentation/networking/diagnostic/twisted_pair_layer1_diagno= stics.rst b/Documentation/networking/diagnostic/twisted_pair_layer1_diagnos= tics.rst index c9be5cc7e113..079e17effadf 100644 --- a/Documentation/networking/diagnostic/twisted_pair_layer1_diagnostics.r= st +++ b/Documentation/networking/diagnostic/twisted_pair_layer1_diagnostics.r= st @@ -713,17 +713,23 @@ driver supports reporting such events. =20 - **Monitor Error Counters**: =20 - - While some NIC drivers and PHYs provide error counters, there is no un= ified - set of PHY-specific counters across all hardware. Additionally, not all - PHYs provide useful information related to errors like CRC errors, fra= me - drops, or link flaps. Therefore, this step is dependent on the specific - hardware and driver support. - - - **Next Steps**: Use `ethtool -S ` to check if your driver - provides useful error counters. In some cases, counters may provide - information about errors like link flaps or physical layer problems (e= .g., - excessive CRC errors), but results can vary significantly depending on= the - PHY. + - Use `ethtool -S --all-groups` to retrieve standardized int= erface + statistics if the driver supports the unified interface: + + - **Command:** `ethtool -S --all-groups` + + - **Example Output (if supported)**: + + .. code-block:: bash + + phydev-RxFrames: 100391 + phydev-RxErrors: 0 + phydev-TxFrames: 9 + phydev-TxErrors: 0 + + - If the unified interface is not supported, use `ethtool -S = ` to + retrieve MAC and PHY counters. Note that non-standardized PHY counter = names + vary by driver and must be interpreted accordingly: =20 - **Command:** `ethtool -S ` =20 @@ -740,6 +746,17 @@ driver supports reporting such events. condition) or kernel log messages (e.g., link up/down events) to furth= er diagnose the issue. =20 + - **Compare Counters**: + + - Compare the egress and ingress frame counts reported by the PHY and = MAC. + + - A small difference may occur due to sampling rate differences betwee= n the + MAC and PHY drivers, or if the PHY and MAC are not always fully + synchronized in their UP or DOWN states. + + - Significant discrepancies indicate potential issues in the data path + between the MAC and PHY. + When All Else Fails... ~~~~~~~~~~~~~~~~~~~~~~ =20 --=20 2.39.5