ixgbevf: Cache PF ack bit in interrupt
authorGreg Rose <gregory.v.rose@intel.com>
Wed, 5 May 2010 19:57:49 +0000 (19:57 +0000)
committerDavid S. Miller <davem@davemloft.net>
Thu, 6 May 2010 07:31:45 +0000 (00:31 -0700)
When the PF acks a message from the VF the VF gets an interrupt.  It
must cache the ack bit so that polling SW will not miss the ack.  Also
avoid reading the message buffer on acks because that also will clear
the ack bit.

Signed-off-by: Greg Rose <gregory.v.rose@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ixgbevf/ixgbevf_main.c

index 0870740..460c37f 100644 (file)
@@ -961,12 +961,28 @@ static irqreturn_t ixgbevf_msix_mbx(int irq, void *data)
        eicr = IXGBE_READ_REG(hw, IXGBE_VTEICS);
        IXGBE_WRITE_REG(hw, IXGBE_VTEICR, eicr);
 
+       if (!hw->mbx.ops.check_for_ack(hw)) {
+               /*
+                * checking for the ack clears the PFACK bit.  Place
+                * it back in the v2p_mailbox cache so that anyone
+                * polling for an ack will not miss it.  Also
+                * avoid the read below because the code to read
+                * the mailbox will also clear the ack bit.  This was
+                * causing lost acks.  Just cache the bit and exit
+                * the IRQ handler.
+                */
+               hw->mbx.v2p_mailbox |= IXGBE_VFMAILBOX_PFACK;
+               goto out;
+       }
+
+       /* Not an ack interrupt, go ahead and read the message */
        hw->mbx.ops.read(hw, &msg, 1);
 
        if ((msg & IXGBE_MBVFICR_VFREQ_MASK) == IXGBE_PF_CONTROL_MSG)
                mod_timer(&adapter->watchdog_timer,
                          round_jiffies(jiffies + 1));
 
+out:
        return IRQ_HANDLED;
 }