ice: safer stats processing
authorJesse Brandeburg <jesse.brandeburg@intel.com>
Sat, 13 Nov 2021 01:06:02 +0000 (17:06 -0800)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Wed, 8 Dec 2021 18:37:02 +0000 (10:37 -0800)
commit1a0f25a52e08b1f67510cabbb44888d2b3c46359
tree6fe8dc6c14076cebc162c118d67802577b2ba0c0
parentde6acd1cdd4d38823b7f4adae82e8a7d62993354
ice: safer stats processing

The driver was zeroing live stats that could be fetched by
ndo_get_stats64 at any time. This could result in inconsistent
statistics, and the telltale sign was when reading stats frequently from
/proc/net/dev, the stats would go backwards.

Fix by collecting stats into a local, and delaying when we write to the
structure so it's not incremental.

Fixes: fcea6f3da546 ("ice: Add stats and ethtool support")
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Gurucharan G <gurucharanx.g@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
drivers/net/ethernet/intel/ice/ice_main.c