]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
ice: use u64_stats API to access pkts/bytes in dim sample
authorJacob Keller <jacob.e.keller@intel.com>
Thu, 20 Nov 2025 20:20:44 +0000 (12:20 -0800)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Mon, 26 Jan 2026 17:32:36 +0000 (09:32 -0800)
commitb1c16d9cb21ed7ae0f01f5991adabc4c5ae002fd
treed97915f1302b08e2d61da072baf5a3b6f28f846b
parentb470944ee6e8f51c1d561899c045286b6c416b46
ice: use u64_stats API to access pkts/bytes in dim sample

The __ice_update_sample and __ice_get_ethtool_stats functions directly
accesses the pkts and bytes counters from the ring stats. A following
change is going to update the fields to be u64_stats_t type, and will need
to be accessed appropriately. This will ensure that the accesses do not
cause load/store tearing.

Add helper functions similar to the ones used for updating the stats
values, and use them. This ensures use of the syncp pointer on 32-bit
architectures. Once the fields are updated to u64_stats_t, it will then
properly avoid tears on all architectures.

Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Tested-by: Rinitha S <sx.rinitha@intel.com> (A Contingent worker at Intel)
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
drivers/net/ethernet/intel/ice/ice_ethtool.c
drivers/net/ethernet/intel/ice/ice_lib.c
drivers/net/ethernet/intel/ice/ice_lib.h
drivers/net/ethernet/intel/ice/ice_txrx.c