linux-stable/drivers/net/ethernet/intel/ice
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
..
ice.h ice: Enable SW interrupt from FW for LL TS 2024-01-02 11:18:32 -08:00
ice_adminq_cmd.h Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2024-01-04 18:06:46 -08:00
ice_arfs.c
ice_arfs.h
ice_base.c ice: Fix ASSERT_RTNL() warning during certain scenarios 2024-02-20 13:30:26 -08:00
ice_base.h ice: ice_base.c: Add const modifier to params and vars 2024-01-02 11:18:32 -08:00
ice_cgu_regs.h
ice_common.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2024-01-04 18:06:46 -08:00
ice_common.h ice: remove FW logging code 2023-12-14 09:43:04 -08:00
ice_controlq.c
ice_controlq.h
ice_dcb.c ice: cleanup inconsistent code 2023-12-18 11:20:43 -08:00
ice_dcb.h
ice_dcb_lib.c ice: field prep conversion 2023-12-18 11:20:26 -08:00
ice_dcb_lib.h
ice_dcb_nl.c ice: field get conversion 2023-12-18 11:20:43 -08:00
ice_dcb_nl.h
ice_ddp.c ice: fix DDP package download for packages without signature segment 2023-11-13 10:56:58 -08:00
ice_ddp.h ice: Add support for E830 DDP package segment 2023-10-26 20:32:39 -07:00
ice_debugfs.c ice: add ability to read and configure FW log data 2023-12-14 09:50:58 -08:00
ice_devids.h ice: Add E830 device IDs, MAC type and registers 2023-10-26 20:32:38 -07:00
ice_devlink.c ice: add CGU info to devlink info callback 2023-12-05 11:40:12 +01:00
ice_devlink.h ice: set Tx topology every time new repr is added 2023-11-13 11:42:14 -08:00
ice_dpll.c Merge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue 2024-03-06 10:28:02 +00:00
ice_dpll.h ice: dpll: fix check for dpll input priority range 2023-11-13 10:02:15 -08:00
ice_eswitch.c ice: field prep conversion 2023-12-18 11:20:26 -08:00
ice_eswitch.h ice: reserve number of CP queues 2023-11-13 11:42:15 -08:00
ice_eswitch_br.c ice: make representor code generic 2023-11-13 11:42:14 -08:00
ice_eswitch_br.h
ice_ethtool.c ice: remove rx_len_errors statistic 2024-01-02 11:18:32 -08:00
ice_ethtool.h ice: Add 200G speed/phy type use 2023-10-26 20:32:38 -07:00
ice_ethtool_fdir.c ice: field get conversion 2023-12-18 11:20:43 -08:00
ice_fdir.c ice: field prep conversion 2023-12-18 11:20:26 -08:00
ice_fdir.h
ice_flex_pipe.c ice: field prep conversion 2023-12-18 11:20:26 -08:00
ice_flex_pipe.h ice: enable symmetric-xor RSS for Toeplitz hash function 2023-12-13 22:07:17 -08:00
ice_flex_type.h ice: enable symmetric-xor RSS for Toeplitz hash function 2023-12-13 22:07:17 -08:00
ice_flow.c ice: enable symmetric-xor RSS for Toeplitz hash function 2023-12-13 22:07:17 -08:00
ice_flow.h ice: enable symmetric-xor RSS for Toeplitz hash function 2023-12-13 22:07:17 -08:00
ice_fltr.c
ice_fltr.h
ice_fw_update.c
ice_fw_update.h
ice_fwlog.c ice: add ability to read and configure FW log data 2023-12-14 09:50:58 -08:00
ice_fwlog.h ice: add ability to read and configure FW log data 2023-12-14 09:50:58 -08:00
ice_gnss.c ice: check netlist before enabling ICE_F_GNSS 2023-09-18 11:27:33 -07:00
ice_gnss.h
ice_hw_autogen.h ice: Enable SW interrupt from FW for LL TS 2024-01-02 11:18:32 -08:00
ice_hwmon.c ice: read internal temperature sensor 2023-12-05 11:40:12 +01:00
ice_hwmon.h ice: read internal temperature sensor 2023-12-05 11:40:12 +01:00
ice_idc.c
ice_idc_int.h
ice_irq.c
ice_irq.h
ice_lag.c ice: Add check for lport extraction to LAG init 2024-02-14 17:58:45 -08:00
ice_lag.h ice: Add check for lport extraction to LAG init 2024-02-14 17:58:45 -08:00
ice_lan_tx_rx.h ice: Support RX hash XDP hint 2023-12-13 16:16:40 -08:00
ice_lib.c ice: fix typo in assignment 2024-03-05 09:49:54 -08:00
ice_lib.h ice: Fix ASSERT_RTNL() warning during certain scenarios 2024-02-20 13:30:26 -08:00
ice_main.c ice: fix stats being updated by way too large values 2024-03-26 18:16:53 -04:00
ice_nvm.c ice: field get conversion 2023-12-18 11:20:43 -08:00
ice_nvm.h
ice_osdep.h net: intel: fix old compiler regressions 2024-02-07 09:15:27 -08:00
ice_pf_vsi_vlan_ops.c
ice_pf_vsi_vlan_ops.h
ice_protocol_type.h
ice_ptp.c ice: Fix some null pointer dereference issues in ice_ptp.c 2024-01-02 11:18:32 -08:00
ice_ptp.h ice: Enable SW interrupt from FW for LL TS 2024-01-02 11:18:32 -08:00
ice_ptp_consts.h ice: Rename E822 to E82X 2023-12-05 11:40:12 +01:00
ice_ptp_hw.c ice: Rename E822 to E82X 2023-12-05 11:40:12 +01:00
ice_ptp_hw.h ice: Enable SW interrupt from FW for LL TS 2024-01-02 11:18:32 -08:00
ice_repr.c ice: add VF representors one by one 2023-11-13 11:42:14 -08:00
ice_repr.h ice: add VF representors one by one 2023-11-13 11:42:14 -08:00
ice_sbq_cmd.h
ice_sched.c ice: field get conversion 2023-12-18 11:20:43 -08:00
ice_sched.h ice: drop two params of ice_aq_move_sched_elems() 2023-10-03 12:17:11 -07:00
ice_sriov.c ice: reconfig host after changing MSI-X on VF 2024-03-01 09:40:11 -08:00
ice_sriov.h ice: set MSI-X vector count on VF 2023-10-20 12:53:05 +01:00
ice_switch.c ice: Add support for packet mirroring using hardware in switchdev mode 2024-01-02 11:18:32 -08:00
ice_switch.h
ice_tc_lib.c ice: Add support for packet mirroring using hardware in switchdev mode 2024-01-02 11:18:32 -08:00
ice_tc_lib.h
ice_trace.h
ice_txrx.c ice: remove redundant xdp_rxq_info registration 2024-01-24 16:24:06 -08:00
ice_txrx.h ice: work on pre-XDP prog frag count 2024-01-24 16:24:06 -08:00
ice_txrx_lib.c ice: use VLAN proto from ring packet context in skb path 2023-12-13 16:16:41 -08:00
ice_txrx_lib.h ice: work on pre-XDP prog frag count 2024-01-24 16:24:06 -08:00
ice_type.h net: intel: fix old compiler regressions 2024-02-07 09:15:27 -08:00
ice_vf_lib.c ice: replace ice_vf_recreate_vsi() with ice_vf_reconfig_vsi() 2024-01-02 11:18:32 -08:00
ice_vf_lib.h ice: replace ice_vf_recreate_vsi() with ice_vf_reconfig_vsi() 2024-01-02 11:18:32 -08:00
ice_vf_lib_private.h ice: replace ice_vf_recreate_vsi() with ice_vf_reconfig_vsi() 2024-01-02 11:18:32 -08:00
ice_vf_mbx.c
ice_vf_mbx.h
ice_vf_vsi_vlan_ops.c ice: Restore fix disabling RX VLAN filtering 2023-12-05 10:51:22 -08:00
ice_vf_vsi_vlan_ops.h
ice_virtchnl.c ice: virtchnl: stop pretending to support RSS over AQ or registers 2024-03-05 09:49:21 -08:00
ice_virtchnl.h iavf: enable symmetric-xor RSS for Toeplitz hash function 2023-12-13 22:07:17 -08:00
ice_virtchnl_allowlist.c ice: virtchnl: stop pretending to support RSS over AQ or registers 2024-03-05 09:49:21 -08:00
ice_virtchnl_allowlist.h
ice_virtchnl_fdir.c ice: field get conversion 2023-12-18 11:20:43 -08:00
ice_virtchnl_fdir.h
ice_vlan.h
ice_vlan_mode.c
ice_vlan_mode.h
ice_vsi_vlan_lib.c ice: fix pre-shifted bit usage 2023-12-18 11:20:43 -08:00
ice_vsi_vlan_lib.h
ice_vsi_vlan_ops.c
ice_vsi_vlan_ops.h
ice_xsk.c ice: reorder disabling IRQ and NAPI in ice_qp_dis 2024-03-01 09:39:10 -08:00
ice_xsk.h
Makefile ice: configure FW logging 2023-12-14 09:50:48 -08:00