Module Name: src
Committed By: msaitoh
Date: Mon Nov 30 07:53:42 UTC 2020
Modified Files:
src/sys/dev/pci/ixgbe: ixgbe.c
Log Message:
Apply ixgbe.c rev. 1.204 which was for ixgbe_msix_admin() to
ixgbe_legacy_irq(), too.
> An interrupt might not arrive when a module is inserted. When an link
> status change interrupt occurred and the driver still regard SFP as
> unplugged, issue the module softint before issuing LSC interrupt.
TODO: Reduce duplicated code.
To generate a diff of this commit:
cvs rdiff -u -r1.260 -r1.261 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.260 src/sys/dev/pci/ixgbe/ixgbe.c:1.261
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.260 Tue Nov 17 04:50:29 2020
+++ src/sys/dev/pci/ixgbe/ixgbe.c Mon Nov 30 07:53:42 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.c,v 1.260 2020/11/17 04:50:29 knakahara Exp $ */
+/* $NetBSD: ixgbe.c,v 1.261 2020/11/30 07:53:42 msaitoh Exp $ */
/******************************************************************************
@@ -5220,10 +5220,6 @@ ixgbe_legacy_irq(void *arg)
IXGBE_WRITE_REG(hw, IXGBE_EIMS, IXGBE_EICR_GPI_SDP1_BY_MAC(hw));
}
- /* Link status change */
- if (eicr & IXGBE_EICR_LSC)
- task_requests |= IXGBE_REQUEST_TASK_LSC;
-
if (ixgbe_is_sfp(hw)) {
/* Pluggable optics-related interrupt */
if (hw->mac.type >= ixgbe_mac_X540)
@@ -5231,7 +5227,15 @@ ixgbe_legacy_irq(void *arg)
else
eicr_mask = IXGBE_EICR_GPI_SDP2_BY_MAC(hw);
- if (eicr & eicr_mask) {
+ /*
+ * An interrupt might not arrive when a module is inserted.
+ * When an link status change interrupt occurred and the driver
+ * still regard SFP as unplugged, issue the module softint
+ * and then issue LSC interrupt.
+ */
+ if ((eicr & eicr_mask)
+ || ((hw->phy.sfp_type == ixgbe_sfp_type_not_present)
+ && (eicr & IXGBE_EICR_LSC))) {
IXGBE_WRITE_REG(hw, IXGBE_EICR, eicr_mask);
task_requests |= IXGBE_REQUEST_TASK_MOD;
}
@@ -5244,6 +5248,10 @@ ixgbe_legacy_irq(void *arg)
}
}
+ /* Link status change */
+ if (eicr & IXGBE_EICR_LSC)
+ task_requests |= IXGBE_REQUEST_TASK_LSC;
+
/* External PHY interrupt */
if ((hw->phy.type == ixgbe_phy_x550em_ext_t) &&
(eicr & IXGBE_EICR_GPI_SDP0_X540))