]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commita31f9d3a58aa57bb43af754249513817eae379da
tree6fe8dc6c14076cebc162c118d67802577b2ba0c0
parentd9a05551b3ee5238b16dc668e69b6acf8d67bb50
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: 7c3e0ebc363c ("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