diff mbox series

[net-next] eth: lan966x: don't clear unsupported stats

Message ID 20240613003222.3327368-1-kuba@kernel.org (mailing list archive)
State Accepted
Commit 72421f35540c3e8830be8897ef1b99d2b7aa0981
Delegated to: Netdev Maintainers
Headers show
Series [net-next] eth: lan966x: don't clear unsupported stats | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 850 this patch: 850
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers success CCed 6 of 6 maintainers
netdev/build_clang success Errors and warnings before: 854 this patch: 854
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 854 this patch: 854
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 33 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-06-14--21-00 (tests: 650)

Commit Message

Jakub Kicinski June 13, 2024, 12:32 a.m. UTC
Commit 12c2d0a5b8e2 ("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.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
CC: horatiu.vultur@microchip.com
CC: UNGLinuxDriver@microchip.com
---
 drivers/net/ethernet/microchip/lan966x/lan966x_ethtool.c | 8 --------
 1 file changed, 8 deletions(-)

Comments

Horatiu Vultur June 13, 2024, 2:06 p.m. UTC | #1
The 06/12/2024 17:32, Jakub Kicinski wrote:
> Commit 12c2d0a5b8e2 ("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.
> 
> Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Acked-by: Horatiu Vultur <horatiu.vultur@microchip.com>

> ---
> CC: horatiu.vultur@microchip.com
> CC: UNGLinuxDriver@microchip.com
> ---
>  drivers/net/ethernet/microchip/lan966x/lan966x_ethtool.c | 8 --------
>  1 file changed, 8 deletions(-)
> 
> diff --git a/drivers/net/ethernet/microchip/lan966x/lan966x_ethtool.c b/drivers/net/ethernet/microchip/lan966x/lan966x_ethtool.c
> index 06811c60d598..c0fc85ac5db3 100644
> --- a/drivers/net/ethernet/microchip/lan966x/lan966x_ethtool.c
> +++ b/drivers/net/ethernet/microchip/lan966x/lan966x_ethtool.c
> @@ -376,7 +376,6 @@ static void lan966x_get_eth_mac_stats(struct net_device *dev,
>                 lan966x->stats[idx + SYS_COUNT_TX_PMAC_BC];
>         mac_stats->SingleCollisionFrames =
>                 lan966x->stats[idx + SYS_COUNT_TX_COL];
> -       mac_stats->MultipleCollisionFrames = 0;
>         mac_stats->FramesReceivedOK =
>                 lan966x->stats[idx + SYS_COUNT_RX_UC] +
>                 lan966x->stats[idx + SYS_COUNT_RX_MC] +
> @@ -384,26 +383,19 @@ static void lan966x_get_eth_mac_stats(struct net_device *dev,
>         mac_stats->FrameCheckSequenceErrors =
>                 lan966x->stats[idx + SYS_COUNT_RX_CRC] +
>                 lan966x->stats[idx + SYS_COUNT_RX_CRC];
> -       mac_stats->AlignmentErrors = 0;
>         mac_stats->OctetsTransmittedOK =
>                 lan966x->stats[idx + SYS_COUNT_TX_OCT] +
>                 lan966x->stats[idx + SYS_COUNT_TX_PMAC_OCT];
>         mac_stats->FramesWithDeferredXmissions =
>                 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 =
>                 lan966x->stats[idx + SYS_COUNT_RX_OCT];
> -       mac_stats->FramesLostDueToIntMACRcvError = 0;
>         mac_stats->MulticastFramesXmittedOK =
>                 lan966x->stats[idx + SYS_COUNT_TX_MC] +
>                 lan966x->stats[idx + SYS_COUNT_TX_PMAC_MC];
>         mac_stats->BroadcastFramesXmittedOK =
>                 lan966x->stats[idx + SYS_COUNT_TX_BC] +
>                 lan966x->stats[idx + SYS_COUNT_TX_PMAC_BC];
> -       mac_stats->FramesWithExcessiveDeferral = 0;
>         mac_stats->MulticastFramesReceivedOK =
>                 lan966x->stats[idx + SYS_COUNT_RX_MC];
>         mac_stats->BroadcastFramesReceivedOK =
> --
> 2.45.2
> 
>
patchwork-bot+netdevbpf@kernel.org June 15, 2024, 1:50 a.m. UTC | #2
Hello:

This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Wed, 12 Jun 2024 17:32:22 -0700 you wrote:
> Commit 12c2d0a5b8e2 ("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.
> 
> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
> 
> [...]

Here is the summary with links:
  - [net-next] eth: lan966x: don't clear unsupported stats
    https://git.kernel.org/netdev/net-next/c/72421f35540c

You are awesome, thank you!
diff mbox series

Patch

diff --git a/drivers/net/ethernet/microchip/lan966x/lan966x_ethtool.c b/drivers/net/ethernet/microchip/lan966x/lan966x_ethtool.c
index 06811c60d598..c0fc85ac5db3 100644
--- a/drivers/net/ethernet/microchip/lan966x/lan966x_ethtool.c
+++ b/drivers/net/ethernet/microchip/lan966x/lan966x_ethtool.c
@@ -376,7 +376,6 @@  static void lan966x_get_eth_mac_stats(struct net_device *dev,
 		lan966x->stats[idx + SYS_COUNT_TX_PMAC_BC];
 	mac_stats->SingleCollisionFrames =
 		lan966x->stats[idx + SYS_COUNT_TX_COL];
-	mac_stats->MultipleCollisionFrames = 0;
 	mac_stats->FramesReceivedOK =
 		lan966x->stats[idx + SYS_COUNT_RX_UC] +
 		lan966x->stats[idx + SYS_COUNT_RX_MC] +
@@ -384,26 +383,19 @@  static void lan966x_get_eth_mac_stats(struct net_device *dev,
 	mac_stats->FrameCheckSequenceErrors =
 		lan966x->stats[idx + SYS_COUNT_RX_CRC] +
 		lan966x->stats[idx + SYS_COUNT_RX_CRC];
-	mac_stats->AlignmentErrors = 0;
 	mac_stats->OctetsTransmittedOK =
 		lan966x->stats[idx + SYS_COUNT_TX_OCT] +
 		lan966x->stats[idx + SYS_COUNT_TX_PMAC_OCT];
 	mac_stats->FramesWithDeferredXmissions =
 		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 =
 		lan966x->stats[idx + SYS_COUNT_RX_OCT];
-	mac_stats->FramesLostDueToIntMACRcvError = 0;
 	mac_stats->MulticastFramesXmittedOK =
 		lan966x->stats[idx + SYS_COUNT_TX_MC] +
 		lan966x->stats[idx + SYS_COUNT_TX_PMAC_MC];
 	mac_stats->BroadcastFramesXmittedOK =
 		lan966x->stats[idx + SYS_COUNT_TX_BC] +
 		lan966x->stats[idx + SYS_COUNT_TX_PMAC_BC];
-	mac_stats->FramesWithExcessiveDeferral = 0;
 	mac_stats->MulticastFramesReceivedOK =
 		lan966x->stats[idx + SYS_COUNT_RX_MC];
 	mac_stats->BroadcastFramesReceivedOK =