ixgbe: fix vf irq storm when running on Xen Dom0.
authorBruce Richardson <bruce.richardson@intel.com>
Mon, 17 Feb 2014 18:57:55 +0000 (19:57 +0100)
committerDavid Marchand <david.marchand@6wind.com>
Wed, 26 Feb 2014 09:22:33 +0000 (10:22 +0100)
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Signed-off-by: David Marchand <david.marchand@6wind.com>
lib/librte_pmd_ixgbe/ixgbe_ethdev.c
lib/librte_pmd_ixgbe/ixgbe_pf.c

index 2276104..d413792 100644 (file)
@@ -1394,6 +1394,9 @@ ixgbe_dev_stop(struct rte_eth_dev *dev)
        struct rte_eth_link link;
        struct ixgbe_hw *hw =
                IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+       struct ixgbe_vf_info *vfinfo = 
+               *IXGBE_DEV_PRIVATE_TO_P_VFDATA(dev->data->dev_private);
+       int vf;
 
        PMD_INIT_FUNC_TRACE();
 
@@ -1407,6 +1410,10 @@ ixgbe_dev_stop(struct rte_eth_dev *dev)
        /* stop adapter */
        ixgbe_stop_adapter(hw);
 
+       for (vf = 0; vfinfo != NULL && 
+                    vf < dev->pci_dev->max_vfs; vf++)
+               vfinfo[vf].clear_to_send = false;
+
        /* Turn off the laser */
        ixgbe_disable_tx_laser(hw);
 
index 07202d4..1ae1a4a 100644 (file)
@@ -473,6 +473,8 @@ ixgbe_rcv_msg_from_vf(struct rte_eth_dev *dev, uint16_t vf)
        uint32_t msgbuf[IXGBE_VFMAILBOX_SIZE];
        int32_t retval;
        struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+       struct ixgbe_vf_info *vfinfo = 
+               *IXGBE_DEV_PRIVATE_TO_P_VFDATA(dev->data->dev_private);
 
        retval = ixgbe_read_mbx(hw, msgbuf, mbx_size, vf);
        if (retval) {
@@ -489,7 +491,9 @@ ixgbe_rcv_msg_from_vf(struct rte_eth_dev *dev, uint16_t vf)
 
        /* perform VF reset */
        if (msgbuf[0] == IXGBE_VF_RESET) {
-               return ixgbe_vf_reset(dev, vf, msgbuf);
+               int ret = ixgbe_vf_reset(dev, vf, msgbuf);
+               vfinfo[vf].clear_to_send = true;
+               return ret;
        }
 
        /* check & process VF to PF mailbox message */
@@ -531,8 +535,11 @@ ixgbe_rcv_ack_from_vf(struct rte_eth_dev *dev, uint16_t vf)
        uint32_t msg = IXGBE_VT_MSGTYPE_NACK;
        struct ixgbe_hw *hw = 
                IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+       struct ixgbe_vf_info *vfinfo = 
+               *IXGBE_DEV_PRIVATE_TO_P_VFDATA(dev->data->dev_private);
 
-       ixgbe_write_mbx(hw, &msg, 1, vf);
+       if (!vfinfo[vf].clear_to_send)
+               ixgbe_write_mbx(hw, &msg, 1, vf);
 }
 
 void ixgbe_pf_mbx_process(struct rte_eth_dev *eth_dev)