Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Documentation: networking: update PHY error counter diagnostics in twisted pair guide

Replace generic instructions for monitoring error counters with a
procedure using the unified PHY statistics interface (`--all-groups`).

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>

authored by

Oleksij Rempel and committed by
Paolo Abeni
7d66c74a 6167c0b6

+27 -10
+27 -10
Documentation/networking/diagnostic/twisted_pair_layer1_diagnostics.rst
··· 713 713 714 714 - **Monitor Error Counters**: 715 715 716 - - While some NIC drivers and PHYs provide error counters, there is no unified 717 - set of PHY-specific counters across all hardware. Additionally, not all 718 - PHYs provide useful information related to errors like CRC errors, frame 719 - drops, or link flaps. Therefore, this step is dependent on the specific 720 - hardware and driver support. 716 + - Use `ethtool -S <interface> --all-groups` to retrieve standardized interface 717 + statistics if the driver supports the unified interface: 721 718 722 - - **Next Steps**: Use `ethtool -S <interface>` to check if your driver 723 - provides useful error counters. In some cases, counters may provide 724 - information about errors like link flaps or physical layer problems (e.g., 725 - excessive CRC errors), but results can vary significantly depending on the 726 - PHY. 719 + - **Command:** `ethtool -S <interface> --all-groups` 720 + 721 + - **Example Output (if supported)**: 722 + 723 + .. code-block:: bash 724 + 725 + phydev-RxFrames: 100391 726 + phydev-RxErrors: 0 727 + phydev-TxFrames: 9 728 + phydev-TxErrors: 0 729 + 730 + - If the unified interface is not supported, use `ethtool -S <interface>` to 731 + retrieve MAC and PHY counters. Note that non-standardized PHY counter names 732 + vary by driver and must be interpreted accordingly: 727 733 728 734 - **Command:** `ethtool -S <interface>` 729 735 ··· 745 739 not supported, you may need to rely on physical inspections (e.g., cable 746 740 condition) or kernel log messages (e.g., link up/down events) to further 747 741 diagnose the issue. 742 + 743 + - **Compare Counters**: 744 + 745 + - Compare the egress and ingress frame counts reported by the PHY and MAC. 746 + 747 + - A small difference may occur due to sampling rate differences between the 748 + MAC and PHY drivers, or if the PHY and MAC are not always fully 749 + synchronized in their UP or DOWN states. 750 + 751 + - Significant discrepancies indicate potential issues in the data path 752 + between the MAC and PHY. 748 753 749 754 When All Else Fails... 750 755 ~~~~~~~~~~~~~~~~~~~~~~