Some re(4) variants now use msi.  Unfortunately the interrupt handler
isn't careful enough, and we might miss an interrupt.  The diff below
seems to fix that by disabling the interrupts while processing an
interrupt.  This is what FreeBSD & Linux seem to do.

Needs testing on a wide variety of re(4), especially on thoe that
don't use msi yet.


Index: re.c
===================================================================
RCS file: /cvs/src/sys/dev/ic/re.c,v
retrieving revision 1.143
diff -u -p -r1.143 re.c
--- re.c        7 Aug 2013 01:06:30 -0000       1.143
+++ re.c        21 Aug 2013 19:50:39 -0000
@@ -1650,6 +1650,9 @@ re_intr(void *arg)
        if (!(ifp->if_flags & IFF_RUNNING))
                return (0);
 
+       /* Disable interrupts. */
+       CSR_WRITE_2(sc, RL_IMR, 0);
+
        rx = tx = 0;
        status = CSR_READ_2(sc, RL_ISR);
        /* If the card has gone away the read returns 0xffff. */
@@ -1715,6 +1718,8 @@ re_intr(void *arg)
 
        if (tx && !IFQ_IS_EMPTY(&ifp->if_snd))
                re_start(ifp);
+
+       CSR_WRITE_2(sc, RL_IMR, sc->rl_intrs);
 
        return (claimed);
 }

Reply via email to