The branch stable/12 has been updated by kbowling (ports committer):

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

commit a6640bca4827036ad9374696381513da7d9df0f9
Author:     Kevin Bowling <[email protected]>
AuthorDate: 2021-09-27 16:17:48 +0000
Commit:     Kevin Bowling <[email protected]>
CommitDate: 2021-09-28 17:28:54 +0000

    e1000: Re-arm link changes
    
    A change to MSI-X link handler was somehow causing issues on
    MSI-based em(4) NICs.
    
    Revert the change based on user reports and testing.
    
    PR:             258551
    Reported by:    Franco Fichtner <[email protected]>, [email protected]
    Reviewed by:    markj, Franco Fichtner <[email protected]>
    Tested by:      [email protected]
    MFC after:      1 day
    
    (cherry picked from commit 450c3f8b3d259c7eb82488319aff45f1f6554aaf)
---
 sys/dev/e1000/if_em.c | 22 ++++++----------------
 1 file changed, 6 insertions(+), 16 deletions(-)

diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c
index c2c172f7ef2f..b7c241cddfc7 100644
--- a/sys/dev/e1000/if_em.c
+++ b/sys/dev/e1000/if_em.c
@@ -1497,7 +1497,6 @@ em_msix_link(void *arg)
 {
        struct e1000_softc *sc = arg;
        u32 reg_icr;
-       bool notlink = false;
 
        ++sc->link_irq;
        MPASS(sc->hw.back != NULL);
@@ -1508,17 +1507,14 @@ em_msix_link(void *arg)
 
        if (reg_icr & (E1000_ICR_RXSEQ | E1000_ICR_LSC))
                em_handle_link(sc->ctx);
-       else
-               notlink = true;
 
-       /* Re-arm for other/spurious interrupts */
-       if (notlink && sc->hw.mac.type >= igb_mac_min) {
+       /* Re-arm unconditionally */
+       if (sc->hw.mac.type >= igb_mac_min) {
                E1000_WRITE_REG(&sc->hw, E1000_IMS, E1000_IMS_LSC);
                E1000_WRITE_REG(&sc->hw, E1000_EIMS, sc->link_mask);
        } else if (sc->hw.mac.type == e1000_82574) {
-               if (notlink)
-                       E1000_WRITE_REG(&sc->hw, E1000_IMS, E1000_IMS_LSC |
-                           E1000_IMS_OTHER);
+               E1000_WRITE_REG(&sc->hw, E1000_IMS, E1000_IMS_LSC |
+                   E1000_IMS_OTHER);
                /*
                 * Because we must read the ICR for this interrupt it may
                 * clear other causes using autoclear, for this reason we
@@ -1526,7 +1522,8 @@ em_msix_link(void *arg)
                 */
                if (reg_icr)
                        E1000_WRITE_REG(&sc->hw, E1000_ICS, sc->ims);
-       }
+       } else
+               E1000_WRITE_REG(&sc->hw, E1000_IMS, E1000_IMS_LSC);
 
        return (FILTER_HANDLED);
 }
@@ -1862,13 +1859,6 @@ em_if_update_admin_status(if_ctx_t ctx)
 
        if (hw->mac.type < em_mac_min)
                lem_smartspeed(sc);
-       else if (hw->mac.type >= igb_mac_min &&
-           sc->intr_type == IFLIB_INTR_MSIX) {
-               E1000_WRITE_REG(&sc->hw, E1000_IMS, E1000_IMS_LSC);
-               E1000_WRITE_REG(&sc->hw, E1000_EIMS, sc->link_mask);
-       } else if (hw->mac.type == e1000_82574 &&
-           sc->intr_type == IFLIB_INTR_MSIX)
-               E1000_WRITE_REG(hw, E1000_IMS, E1000_IMS_LSC | E1000_IMS_OTHER);
 }
 
 static void
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to