linux-stable/drivers/net/ethernet/intel
Przemek Kitszel 696a2cef54 ice: fix stats being updated by way too large values
[ Upstream commit 257310e998 ]

Simplify stats accumulation logic to fix the case where we don't take
previous stat value into account, we should always respect it.

Main netdev stats of our PF (Tx/Rx packets/bytes) were reported orders of
magnitude too big during OpenStack reconfiguration events, possibly other
reconfiguration cases too.

The regression was reported to be between 6.1 and 6.2, so I was almost
certain that on of the two "preserve stats over reset" commits were the
culprit. While reading the code, it was found that in some cases we will
increase the stats by arbitrarily large number (thanks to ignoring "-prev"
part of condition, after zeroing it).

Note that this fixes also the case where we were around limits of u64, but
that was not the regression reported.

Full disclosure: I remember suggesting this particular piece of code to
Ben a few years ago, so blame on me.

Fixes: 2fd5e433cd ("ice: Accumulate HW and Netdev statistics over reset")
Reported-by: Nebojsa Stevanovic <nebojsa.stevanovic@gcore.com>
Link: https://lore.kernel.org/intel-wired-lan/VI1PR02MB439744DEDAA7B59B9A2833FE912EA@VI1PR02MB4397.eurprd02.prod.outlook.com
Reported-by: Christian Rohmann <christian.rohmann@inovex.de>
Link: https://lore.kernel.org/intel-wired-lan/f38a6ca4-af05-48b1-a3e6-17ef2054e525@inovex.de
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Tested-by: Pucha Himasekhar Reddy <himasekharx.reddy.pucha@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>
2024-03-26 18:16:53 -04:00
..
e1000 intel: legacy: field get conversion 2023-12-18 11:20:43 -08:00
e1000e intel: legacy: Partial revert of field get conversion 2024-03-05 10:07:04 -08:00
fm10k intel: legacy: field get conversion 2023-12-18 11:20:43 -08:00
i40e i40e: Fix firmware version comparison function 2024-03-05 09:49:59 -08:00
iavf iavf: field get conversion 2023-12-18 11:20:43 -08:00
ice ice: fix stats being updated by way too large values 2024-03-26 18:16:53 -04:00
idpf idpf: disable local BH when scheduling napi for marker packets 2024-03-05 09:47:38 -08:00
igb igb: Fix missing time sync events 2024-03-26 18:16:53 -04:00
igbvf intel: legacy: field get conversion 2023-12-18 11:20:43 -08:00
igc igc: Fix missing time sync events 2024-03-26 18:16:53 -04:00
ixgbe ixgbe: {dis, en}able irqs in ixgbe_txrx_ring_{dis, en}able 2024-03-01 09:35:19 -08:00
ixgbevf net: ethtool: pass a pointer to parameters to get/set_rxfh ethtool ops 2023-12-13 22:07:16 -08:00
Kconfig ice: read internal temperature sensor 2023-12-05 11:40:12 +01:00
Makefile idpf: add SRIOV support and other ndo_ops 2023-09-13 14:59:24 -07:00
e100.c e100: replace deprecated strncpy with strscpy 2023-10-18 18:10:17 -07:00