From 4074a5d80679517158628c8d65be151cc11bcc2a Mon Sep 17 00:00:00 2001 From: Bruce Richardson Date: Mon, 17 Feb 2014 19:57:55 +0100 Subject: [PATCH] ixgbe: fix vf irq storm when running on Xen Dom0. Signed-off-by: Bruce Richardson Signed-off-by: David Marchand --- lib/librte_pmd_ixgbe/ixgbe_ethdev.c | 7 +++++++ lib/librte_pmd_ixgbe/ixgbe_pf.c | 11 +++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/lib/librte_pmd_ixgbe/ixgbe_ethdev.c b/lib/librte_pmd_ixgbe/ixgbe_ethdev.c index 22761046dd..d413792df0 100644 --- a/lib/librte_pmd_ixgbe/ixgbe_ethdev.c +++ b/lib/librte_pmd_ixgbe/ixgbe_ethdev.c @@ -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); diff --git a/lib/librte_pmd_ixgbe/ixgbe_pf.c b/lib/librte_pmd_ixgbe/ixgbe_pf.c index 07202d4c38..1ae1a4ad88 100644 --- a/lib/librte_pmd_ixgbe/ixgbe_pf.c +++ b/lib/librte_pmd_ixgbe/ixgbe_pf.c @@ -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)