]> git.openfabrics.org - ~emulex/infiniband.git/commitdiff
ixgbe: Exit on error case in VF message processing
authorAlexander Duyck <alexander.h.duyck@intel.com>
Wed, 28 Mar 2012 08:03:38 +0000 (08:03 +0000)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Thu, 10 May 2012 05:02:05 +0000 (22:02 -0700)
Previously we would get a mailbox error and still process the message.
Instead we should exit on error.

In addition we should also be flushing the ACK of the message so that we
can guarantee that the other end is aware we have received the message
while we are processing it.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Tested-by: Sibai Li <sibai.li@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c

index 39856371acb1fda056d41be86767c98f6fce5587..b64f1fc8a397b7f341d9b40eb2b508c45d094599 100644 (file)
@@ -544,13 +544,18 @@ static int ixgbe_rcv_msg_from_vf(struct ixgbe_adapter *adapter, u32 vf)
 
        retval = ixgbe_read_mbx(hw, msgbuf, mbx_size, vf);
 
-       if (retval)
+       if (retval) {
                pr_err("Error receiving message from VF\n");
+               return retval;
+       }
 
        /* this is a message we already processed, do nothing */
        if (msgbuf[0] & (IXGBE_VT_MSGTYPE_ACK | IXGBE_VT_MSGTYPE_NACK))
                return retval;
 
+       /* flush the ack before we write any messages back */
+       IXGBE_WRITE_FLUSH(hw);
+
        /*
         * until the vf completes a virtual function reset it should not be
         * allowed to start any configuration.