git: d0303ad18ae9 - stable/12 - if_ix: Reset on an ECC error

From: Neel Chauhan <nc_at_FreeBSD.org>
Date: Wed, 29 Jun 2022 17:08:11 UTC
The branch stable/12 has been updated by nc (ports committer):

URL: https://cgit.FreeBSD.org/src/commit/?id=d0303ad18ae9cb9715f168b69a3e86a2424bcfec

commit d0303ad18ae9cb9715f168b69a3e86a2424bcfec
Author:     Neel Chauhan <nc@FreeBSD.org>
AuthorDate: 2022-06-22 02:13:19 +0000
Commit:     Neel Chauhan <nc@FreeBSD.org>
CommitDate: 2022-06-29 17:08:13 +0000

    if_ix: Reset on an ECC error
    
    This mirrors the Linux behavior as seen in the kernel commit d773ce2.
    
    Reviewed by:            kbowling
    MFH after:              3 days
    Differential Revision:  https://reviews.freebsd.org/D35542
    
    (cherry picked from commit 4f1d91e413d7e05f13f12d43a48178c023150dde)
---
 sys/dev/ixgbe/if_ix.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/sys/dev/ixgbe/if_ix.c b/sys/dev/ixgbe/if_ix.c
index 9bb368ae8a90..4308033ad3c6 100644
--- a/sys/dev/ixgbe/if_ix.c
+++ b/sys/dev/ixgbe/if_ix.c
@@ -2435,7 +2435,9 @@ ixgbe_msix_link(void *arg)
 		} else
 			if (eicr & IXGBE_EICR_ECC) {
 				device_printf(iflib_get_dev(sc->ctx),
-				   "\nCRITICAL: ECC ERROR!! Please Reboot!!\n");
+				   "Received ECC Err, initiating reset\n");
+				hw->mac.flags |= ~IXGBE_FLAGS_DOUBLE_RESET_REQUIRED;
+				ixgbe_reset_hw(hw);
 				IXGBE_WRITE_REG(hw, IXGBE_EICR, IXGBE_EICR_ECC);
 			}