ixgbevf: reset unused mailbox data registers
[dpdk.git] / lib / librte_pmd_ixgbe / ixgbe / ixgbe_mbx.c
index 309870d..1ced423 100644 (file)
@@ -431,6 +431,17 @@ STATIC s32 ixgbe_write_mbx_vf(struct ixgbe_hw *hw, u32 *msg, u16 size,
        for (i = 0; i < size; i++)
                IXGBE_WRITE_REG_ARRAY(hw, IXGBE_VFMBMEM, i, msg[i]);
 
+       /*
+        * Complete the remaining mailbox data registers with zero to reset
+        * the data sent in a previous exchange (in either side) with the PF,
+        * including exchanges performed by another Guest OS to which that VF
+        * was previously assigned.
+        */
+       while (i < hw->mbx.size) {
+               IXGBE_WRITE_REG_ARRAY(hw, IXGBE_VFMBMEM, i, 0);
+               i++;
+       }
+
        /* update stats */
        hw->mbx.stats.msgs_tx++;
 
@@ -661,6 +672,17 @@ STATIC s32 ixgbe_write_mbx_pf(struct ixgbe_hw *hw, u32 *msg, u16 size,
        for (i = 0; i < size; i++)
                IXGBE_WRITE_REG_ARRAY(hw, IXGBE_PFMBMEM(vf_number), i, msg[i]);
 
+       /*
+        * Complete the remaining mailbox data registers with zero to reset
+        * the data sent in a previous exchange (in either side) with the VF,
+        * including exchanges performed by another Guest OS to which that VF
+        * was previously assigned.
+        */
+       while (i < hw->mbx.size) {
+               IXGBE_WRITE_REG_ARRAY(hw, IXGBE_PFMBMEM(vf_number), i, 0);
+               i++;
+       }
+
        /* Interrupt VF to tell it a message has been sent and release buffer*/
        IXGBE_WRITE_REG(hw, IXGBE_PFMAILBOX(vf_number), IXGBE_PFMAILBOX_STS);