diff mbox series

[net-next,2/2] net: sit: Do not set .ndo_get_stats64

Message ID 20240228113125.3473685-3-leitao@debian.org (mailing list archive)
State Accepted
Commit fa0cd90213695b928410484264b38982757a5c28
Delegated to: Netdev Maintainers
Headers show
Series net: collect tstats automatically | expand

Checks

Context Check Description
netdev/series_format success Posting correctly formatted
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: 940 this patch: 940
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers success CCed 5 of 5 maintainers
netdev/build_clang success Errors and warnings before: 957 this patch: 957
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: 957 this patch: 957
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 7 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-02-28--18-00 (tests: 882)

Commit Message

Breno Leitao Feb. 28, 2024, 11:31 a.m. UTC
If the driver is using the network core allocation mechanism, by setting
NETDEV_PCPU_STAT_TSTATS, as this driver is, then, it doesn't need to set
the dev_get_tstats64() generic .ndo_get_stats64 function pointer. Since
the network core calls it automatically, and .ndo_get_stats64 should
only be set if the driver needs special treatment.

This simplifies the driver, since all the generic statistics is now
handled by core.

Signed-off-by: Breno Leitao <leitao@debian.org>
---
 net/ipv6/sit.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Simon Horman Feb. 28, 2024, 2:34 p.m. UTC | #1
On Wed, Feb 28, 2024 at 03:31:22AM -0800, Breno Leitao wrote:
> If the driver is using the network core allocation mechanism, by setting
> NETDEV_PCPU_STAT_TSTATS, as this driver is, then, it doesn't need to set
> the dev_get_tstats64() generic .ndo_get_stats64 function pointer. Since
> the network core calls it automatically, and .ndo_get_stats64 should
> only be set if the driver needs special treatment.
> 
> This simplifies the driver, since all the generic statistics is now
> handled by core.
> 
> Signed-off-by: Breno Leitao <leitao@debian.org>

Reviewed-by: Simon Horman <horms@kernel.org>
diff mbox series

Patch

diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c
index 5ad01480854d..655c9b1a19b8 100644
--- a/net/ipv6/sit.c
+++ b/net/ipv6/sit.c
@@ -1398,7 +1398,6 @@  static const struct net_device_ops ipip6_netdev_ops = {
 	.ndo_uninit	= ipip6_tunnel_uninit,
 	.ndo_start_xmit	= sit_tunnel_xmit,
 	.ndo_siocdevprivate = ipip6_tunnel_siocdevprivate,
-	.ndo_get_stats64 = dev_get_tstats64,
 	.ndo_get_iflink = ip_tunnel_get_iflink,
 	.ndo_tunnel_ctl = ipip6_tunnel_ctl,
 };