Commit 72421f35 authored by Jakub Kicinski's avatar Jakub Kicinski

eth: lan966x: don't clear unsupported stats

Commit 12c2d0a5 ("net: lan966x: add ethtool configuration and statistics")
added support for various standard stats. We should not clear the stats
which are not collected by the device. Core code uses a special
initializer to detect when device does not report given stat.
Acked-by: default avatarHoratiu Vultur <horatiu.vultur@microchip.com>
Link: https://lore.kernel.org/r/20240613003222.3327368-1-kuba@kernel.orgSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 404dbd26
...@@ -376,7 +376,6 @@ static void lan966x_get_eth_mac_stats(struct net_device *dev, ...@@ -376,7 +376,6 @@ static void lan966x_get_eth_mac_stats(struct net_device *dev,
lan966x->stats[idx + SYS_COUNT_TX_PMAC_BC]; lan966x->stats[idx + SYS_COUNT_TX_PMAC_BC];
mac_stats->SingleCollisionFrames = mac_stats->SingleCollisionFrames =
lan966x->stats[idx + SYS_COUNT_TX_COL]; lan966x->stats[idx + SYS_COUNT_TX_COL];
mac_stats->MultipleCollisionFrames = 0;
mac_stats->FramesReceivedOK = mac_stats->FramesReceivedOK =
lan966x->stats[idx + SYS_COUNT_RX_UC] + lan966x->stats[idx + SYS_COUNT_RX_UC] +
lan966x->stats[idx + SYS_COUNT_RX_MC] + lan966x->stats[idx + SYS_COUNT_RX_MC] +
...@@ -384,26 +383,19 @@ static void lan966x_get_eth_mac_stats(struct net_device *dev, ...@@ -384,26 +383,19 @@ static void lan966x_get_eth_mac_stats(struct net_device *dev,
mac_stats->FrameCheckSequenceErrors = mac_stats->FrameCheckSequenceErrors =
lan966x->stats[idx + SYS_COUNT_RX_CRC] + lan966x->stats[idx + SYS_COUNT_RX_CRC] +
lan966x->stats[idx + SYS_COUNT_RX_CRC]; lan966x->stats[idx + SYS_COUNT_RX_CRC];
mac_stats->AlignmentErrors = 0;
mac_stats->OctetsTransmittedOK = mac_stats->OctetsTransmittedOK =
lan966x->stats[idx + SYS_COUNT_TX_OCT] + lan966x->stats[idx + SYS_COUNT_TX_OCT] +
lan966x->stats[idx + SYS_COUNT_TX_PMAC_OCT]; lan966x->stats[idx + SYS_COUNT_TX_PMAC_OCT];
mac_stats->FramesWithDeferredXmissions = mac_stats->FramesWithDeferredXmissions =
lan966x->stats[idx + SYS_COUNT_TX_MM_HOLD]; lan966x->stats[idx + SYS_COUNT_TX_MM_HOLD];
mac_stats->LateCollisions = 0;
mac_stats->FramesAbortedDueToXSColls = 0;
mac_stats->FramesLostDueToIntMACXmitError = 0;
mac_stats->CarrierSenseErrors = 0;
mac_stats->OctetsReceivedOK = mac_stats->OctetsReceivedOK =
lan966x->stats[idx + SYS_COUNT_RX_OCT]; lan966x->stats[idx + SYS_COUNT_RX_OCT];
mac_stats->FramesLostDueToIntMACRcvError = 0;
mac_stats->MulticastFramesXmittedOK = mac_stats->MulticastFramesXmittedOK =
lan966x->stats[idx + SYS_COUNT_TX_MC] + lan966x->stats[idx + SYS_COUNT_TX_MC] +
lan966x->stats[idx + SYS_COUNT_TX_PMAC_MC]; lan966x->stats[idx + SYS_COUNT_TX_PMAC_MC];
mac_stats->BroadcastFramesXmittedOK = mac_stats->BroadcastFramesXmittedOK =
lan966x->stats[idx + SYS_COUNT_TX_BC] + lan966x->stats[idx + SYS_COUNT_TX_BC] +
lan966x->stats[idx + SYS_COUNT_TX_PMAC_BC]; lan966x->stats[idx + SYS_COUNT_TX_PMAC_BC];
mac_stats->FramesWithExcessiveDeferral = 0;
mac_stats->MulticastFramesReceivedOK = mac_stats->MulticastFramesReceivedOK =
lan966x->stats[idx + SYS_COUNT_RX_MC]; lan966x->stats[idx + SYS_COUNT_RX_MC];
mac_stats->BroadcastFramesReceivedOK = mac_stats->BroadcastFramesReceivedOK =
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment