Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/pci/ixgbe Disable some interrupt in ixgbe_{legacy_ir...



details:   https://anonhg.NetBSD.org/src/rev/74e698ded58e
branches:  trunk
changeset: 948312:74e698ded58e
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Sat Dec 26 06:10:17 2020 +0000

description:
Disable some interrupt in ixgbe_{legacy_irq,msix_admin}() to prevent log spam.

diffstat:

 sys/dev/pci/ixgbe/ixgbe.c      |  31 +++++++++++++++++++++++++------
 sys/dev/pci/ixgbe/ixgbe_type.h |   4 ++--
 2 files changed, 27 insertions(+), 8 deletions(-)

diffs (120 lines):

diff -r 5107bb7cddae -r 74e698ded58e sys/dev/pci/ixgbe/ixgbe.c
--- a/sys/dev/pci/ixgbe/ixgbe.c Sat Dec 26 06:07:16 2020 +0000
+++ b/sys/dev/pci/ixgbe/ixgbe.c Sat Dec 26 06:10:17 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.c,v 1.273 2020/12/26 06:07:16 msaitoh Exp $ */
+/* $NetBSD: ixgbe.c,v 1.274 2020/12/26 06:10:17 msaitoh Exp $ */
 
 /******************************************************************************
 
@@ -175,7 +175,7 @@
 static void    ixgbe_ifstop(struct ifnet *, int);
 static void    ixgbe_stop_locked(void *);
 static void    ixgbe_init_device_features(struct adapter *);
-static void    ixgbe_check_fan_failure(struct adapter *, u32, bool);
+static int     ixgbe_check_fan_failure(struct adapter *, u32, bool);
 static void    ixgbe_add_media_types(struct adapter *);
 static void    ixgbe_media_status(struct ifnet *, struct ifmediareq *);
 static int     ixgbe_media_change(struct ifnet *);
@@ -3162,6 +3162,8 @@
                if (eicr & IXGBE_EICR_ECC) {
                        device_printf(adapter->dev,
                            "CRITICAL: ECC ERROR!! Please Reboot!!\n");
+                       /* Disable interrupt to prevent log spam */
+                       eims_disable |= IXGBE_EICR_ECC;
                }
 
                /* Check for over temp condition */
@@ -3170,6 +3172,8 @@
                        case ixgbe_mac_X550EM_a:
                                if (!(eicr & IXGBE_EICR_GPI_SDP0_X550EM_a))
                                        break;
+                               /* Disable interrupt to prevent log spam */
+                               eims_disable |= IXGBE_EICR_GPI_SDP0_X550EM_a;
 
                                retval = hw->phy.ops.check_overtemp(hw);
                                if (retval != IXGBE_ERR_OVERTEMP)
@@ -3180,6 +3184,8 @@
                        default:
                                if (!(eicr & IXGBE_EICR_TS))
                                        break;
+                               /* Disable interrupt to prevent log spam */
+                               eims_disable |= IXGBE_EIMS_TS;
 
                                retval = hw->phy.ops.check_overtemp(hw);
                                if (retval != IXGBE_ERR_OVERTEMP)
@@ -3200,7 +3206,11 @@
 
        /* Check for fan failure */
        if (adapter->feat_en & IXGBE_FEATURE_FAN_FAIL) {
-               ixgbe_check_fan_failure(adapter, eicr, true);
+               retval = ixgbe_check_fan_failure(adapter, eicr, true);
+               if (retval == IXGBE_ERR_FAN_FAILURE) {
+                       /* Disable interrupt to prevent log spam */
+                       eims_disable |= IXGBE_EIMS_GPI_SDP1_BY_MAC(hw);
+               }
        }
 
        /* External PHY interrupt */
@@ -5185,6 +5195,7 @@
        u32             eims_enable = 0;
        u32             eims_disable = 0;
        u32             task_requests = 0;
+       s32             retval;
 
        eims_orig = IXGBE_READ_REG(hw, IXGBE_EIMS);
        /*
@@ -5264,7 +5275,11 @@
 
        /* Check for fan failure */
        if (adapter->feat_en & IXGBE_FEATURE_FAN_FAIL) {
-               ixgbe_check_fan_failure(adapter, eicr, true);
+               retval = ixgbe_check_fan_failure(adapter, eicr, true);
+               if (retval == IXGBE_ERR_FAN_FAILURE) {
+                       /* Disable interrupt to prevent log spam */
+                       eims_disable |= IXGBE_EIMS_GPI_SDP1_BY_MAC(hw);
+               }
        }
 
        /* External PHY interrupt */
@@ -6539,7 +6554,7 @@
 /************************************************************************
  * ixgbe_check_fan_failure
  ************************************************************************/
-static void
+static int
 ixgbe_check_fan_failure(struct adapter *adapter, u32 reg, bool in_interrupt)
 {
        u32 mask;
@@ -6547,8 +6562,12 @@
        mask = (in_interrupt) ? IXGBE_EICR_GPI_SDP1_BY_MAC(&adapter->hw) :
            IXGBE_ESDP_SDP1;
 
-       if (reg & mask)
+       if (reg & mask) {
                device_printf(adapter->dev, "\nCRITICAL: FAN FAILURE!! REPLACE IMMEDIATELY!!\n");
+               return IXGBE_ERR_FAN_FAILURE;
+       }
+
+       return IXGBE_SUCCESS;
 } /* ixgbe_check_fan_failure */
 
 /************************************************************************
diff -r 5107bb7cddae -r 74e698ded58e sys/dev/pci/ixgbe/ixgbe_type.h
--- a/sys/dev/pci/ixgbe/ixgbe_type.h    Sat Dec 26 06:07:16 2020 +0000
+++ b/sys/dev/pci/ixgbe/ixgbe_type.h    Sat Dec 26 06:10:17 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe_type.h,v 1.47 2020/12/26 06:07:16 msaitoh Exp $ */
+/* $NetBSD: ixgbe_type.h,v 1.48 2020/12/26 06:10:17 msaitoh Exp $ */
 
 /******************************************************************************
   SPDX-License-Identifier: BSD-3-Clause
@@ -4324,7 +4324,7 @@
 
 #define IXGBE_ERR_NOT_TRUSTED                  -50 /* XXX NetBSD */
 #define IXGBE_ERR_NOT_IN_PROMISC               -51 /* XXX NetBSD */
-
+#define IXGBE_ERR_FAN_FAILURE                  -52 /* XXX NetBSD */
 #define IXGBE_NOT_IMPLEMENTED                  0x7FFFFFFF
 
 



Home | Main Index | Thread Index | Old Index