Module Name:    src
Committed By:   msaitoh
Date:           Sat Dec 26 06:27:38 UTC 2020

Modified Files:
        src/sys/dev/pci/ixgbe: ixgbe.c

Log Message:
 Copy & paste some missing part (flow director, ECC and temp sensor) from
ixgbe_msix_admin() to ixgbe_legacy_irq(). Now it's ready to make a new
function to share the common part. It'll be done in near future.


To generate a diff of this commit:
cvs rdiff -u -r1.275 -r1.276 src/sys/dev/pci/ixgbe/ixgbe.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/ixgbe/ixgbe.c
diff -u src/sys/dev/pci/ixgbe/ixgbe.c:1.275 src/sys/dev/pci/ixgbe/ixgbe.c:1.276
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.275	Sat Dec 26 06:17:55 2020
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Sat Dec 26 06:27:38 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.c,v 1.275 2020/12/26 06:17:55 msaitoh Exp $ */
+/* $NetBSD: ixgbe.c,v 1.276 2020/12/26 06:27:38 msaitoh Exp $ */
 
 /******************************************************************************
 
@@ -5272,6 +5272,61 @@ ixgbe_legacy_irq(void *arg)
 		}
 	}
 
+	if (adapter->hw.mac.type != ixgbe_mac_82598EB) {
+		if ((adapter->feat_en & IXGBE_FEATURE_FDIR) &&
+		    (eicr & IXGBE_EICR_FLOW_DIR)) {
+			if (!atomic_cas_uint(&adapter->fdir_reinit, 0, 1)) {
+				task_requests |= IXGBE_REQUEST_TASK_FDIR;
+				/* Disable the interrupt */
+				eims_disable |= IXGBE_EIMS_FLOW_DIR;
+			}
+		}
+
+		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 */
+		if (adapter->feat_en & IXGBE_FEATURE_TEMP_SENSOR) {
+			switch (adapter->hw.mac.type) {
+			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)
+					break;
+				device_printf(adapter->dev, "CRITICAL: OVER TEMP!! PHY IS SHUT DOWN!!\n");
+				device_printf(adapter->dev, "System shutdown required!\n");
+				break;
+			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)
+					break;
+				device_printf(adapter->dev, "CRITICAL: OVER TEMP!! PHY IS SHUT DOWN!!\n");
+				device_printf(adapter->dev, "System shutdown required!\n");
+				break;
+			}
+		}
+
+		/* Check for VF message */
+		if ((adapter->feat_en & IXGBE_FEATURE_SRIOV) &&
+		    (eicr & IXGBE_EICR_MAILBOX)) {
+			task_requests |= IXGBE_REQUEST_TASK_MBX;
+			eims_disable |= IXGBE_EIMS_MAILBOX;
+		}
+	}
+
 	/* Check for fan failure */
 	if (adapter->feat_en & IXGBE_FEATURE_FAN_FAIL) {
 		retval = ixgbe_check_fan_failure(adapter, eicr, true);

Reply via email to