]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ice: fix possible under reporting of ethtool Tx and Rx statistics
authorPaul Greenwalt <paul.greenwalt@intel.com>
Thu, 28 Apr 2022 21:11:42 +0000 (14:11 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 25 May 2022 07:17:58 +0000 (09:17 +0200)
commit9e0e75a5e753d52aa4ff6ac3efca5225fb6a08d7
tree8d059d7fce05997c3d21a689b1f4b38f5263c710
parent6e2caee5cddc3d9e0ad0484c9c21b9f10676c044
ice: fix possible under reporting of ethtool Tx and Rx statistics

[ Upstream commit 31b6298fd8e29effe9ed6b77351ac5969be56ce0 ]

The hardware statistics counters are not cleared during resets so the
drivers first access is to initialize the baseline and then subsequent
reads are for reporting the counters. The statistics counters are read
during the watchdog subtask when the interface is up. If the baseline
is not initialized before the interface is up, then there can be a brief
window in which some traffic can be transmitted/received before the
initial baseline reading takes place.

Directly initialize ethtool statistics in driver open so the baseline will
be initialized when the interface is up, and any dropped packets
incremented before the interface is up won't be reported.

Fixes: 28dc1b86f8ea9 ("ice: ignore dropped packets during init")
Signed-off-by: Paul Greenwalt <paul.greenwalt@intel.com>
Tested-by: Gurucharan <gurucharanx.g@intel.com> (A Contingent worker at Intel)
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/intel/ice/ice_main.c