]> git.ipfire.org Git - thirdparty/linux.git/commit
net: enetc: change the statistics of ring to unsigned long type
authorWei Fang <wei.fang@nxp.com>
Fri, 27 Jun 2025 02:11:06 +0000 (10:11 +0800)
committerJakub Kicinski <kuba@kernel.org>
Tue, 1 Jul 2025 01:23:54 +0000 (18:23 -0700)
commitf5ed33771bced4a0743ec2cef7b4e220a08db5c9
tree134e88fa0ead5cfb60141c9d0d2e33041762c001
parentb7ad21258f9e9a7f58b19595d5ceed2cde3bed68
net: enetc: change the statistics of ring to unsigned long type

The statistics of the ring are all unsigned int type, so the statistics
will overflow quickly under heavy traffic. In addition, the statistics
of struct net_device_stats are obtained from struct enetc_ring_stats,
but the statistics of net_device_stats are unsigned long type. So it is
better to keep the statistics types consistent in these two structures.
Considering these two factors, and the fact that both LS1028A and i.MX95
are arm64 architecture, the statistics of enetc_ring_stats are changed
to unsigned long type. Note that unsigned int and unsigned long are the
same thing on some systems, and on such systems there is no overflow
advantage of one over the other.

Signed-off-by: Wei Fang <wei.fang@nxp.com>
Reviewed-by: Claudiu Manoil <claudiu.manoil@nxp.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20250627021108.3359642-2-wei.fang@nxp.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/freescale/enetc/enetc.h