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 Apply ixgbe.c rev. 1.204 which was for ixg...



details:   https://anonhg.NetBSD.org/src/rev/175d2711fb2d
branches:  trunk
changeset: 946531:175d2711fb2d
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Mon Nov 30 07:53:42 2020 +0000

description:
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.

diffstat:

 sys/dev/pci/ixgbe/ixgbe.c |  20 ++++++++++++++------
 1 files changed, 14 insertions(+), 6 deletions(-)

diffs (48 lines):

diff -r 2eb6eafc5319 -r 175d2711fb2d sys/dev/pci/ixgbe/ixgbe.c
--- a/sys/dev/pci/ixgbe/ixgbe.c Mon Nov 30 05:30:56 2020 +0000
+++ b/sys/dev/pci/ixgbe/ixgbe.c Mon Nov 30 07:53:42 2020 +0000
@@ -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_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 @@
                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 @@
                }
        }
 
+       /* 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))



Home | Main Index | Thread Index | Old Index