From: Mohsin Bashir Date: Mon, 25 Aug 2025 20:02:02 +0000 (-0700) Subject: eth: fbnic: Reset hw stats upon PCI error X-Git-Tag: v6.17.8~470 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2b58eec23eae7a457e14938a223e76ba509c2229;p=thirdparty%2Fkernel%2Fstable.git eth: fbnic: Reset hw stats upon PCI error [ Upstream commit b1161b1863c5f3d592adba5accd6e5c79741720f ] Upon experiencing a PCI error, fbnic reset the device to recover from the failure. Reset the hardware stats as part of the device reset to ensure accurate stats reporting. Note that the reset is not really resetting the aggregate value to 0, which may result in a spike for a system collecting deltas in stats. Rather, the reset re-latches the current value as previous, in case HW got reset. Signed-off-by: Mohsin Bashir Reviewed-by: Jacob Keller Link: https://patch.msgid.link/20250825200206.2357713-3-kuba@kernel.org Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- diff --git a/drivers/net/ethernet/meta/fbnic/fbnic_pci.c b/drivers/net/ethernet/meta/fbnic/fbnic_pci.c index 28e23e3ffca88..c4d51490140eb 100644 --- a/drivers/net/ethernet/meta/fbnic/fbnic_pci.c +++ b/drivers/net/ethernet/meta/fbnic/fbnic_pci.c @@ -489,6 +489,8 @@ static void __fbnic_pm_attach(struct device *dev) struct net_device *netdev = fbd->netdev; struct fbnic_net *fbn; + fbnic_reset_hw_stats(fbd); + if (fbnic_init_failure(fbd)) return;