summaryrefslogtreecommitdiff
path: root/drivers/net/i40e/i40e_pf.c
diff options
context:
space:
mode:
authorXiaoyun Li <xiaoyun.li@intel.com>2017-08-15 15:39:36 +0800
committerFerruh Yigit <ferruh.yigit@intel.com>2017-10-06 02:49:47 +0200
commit16048c4cb70386512917073c1661d743f5a78806 (patch)
tree16b77e9ed67960b528cb01e2603a407114d4e297 /drivers/net/i40e/i40e_pf.c
parent7dcb19d78f27ec6f6241ebc7779d5c61a9d569e1 (diff)
downloaddpdk-16048c4cb70386512917073c1661d743f5a78806.zip
dpdk-16048c4cb70386512917073c1661d743f5a78806.tar.gz
dpdk-16048c4cb70386512917073c1661d743f5a78806.tar.xz
net/i40e: fix PF notify issue when VF is not up
This patch stops PF from sending message to VF when VF's admin queue isn't enabled, namely VF isn't up. Fixes: 4861cde46116 ("i40e: new poll mode driver") Cc: stable@dpdk.org Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com> Acked-by: Beilei Xing <beilei.xing@intel.com>
Diffstat (limited to 'drivers/net/i40e/i40e_pf.c')
-rw-r--r--drivers/net/i40e/i40e_pf.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/drivers/net/i40e/i40e_pf.c b/drivers/net/i40e/i40e_pf.c
index 100f8dc..fe89027 100644
--- a/drivers/net/i40e/i40e_pf.c
+++ b/drivers/net/i40e/i40e_pf.c
@@ -1192,7 +1192,10 @@ send_msg:
void
i40e_notify_vf_link_status(struct rte_eth_dev *dev, struct i40e_pf_vf *vf)
{
+ struct i40e_hw *hw = I40E_PF_TO_HW(vf->pf);
struct virtchnl_pf_event event;
+ uint16_t vf_id = vf->vf_idx;
+ uint32_t tval, rval;
event.event = VIRTCHNL_EVENT_LINK_CHANGE;
event.event_data.link_event.link_status =
@@ -1224,8 +1227,15 @@ i40e_notify_vf_link_status(struct rte_eth_dev *dev, struct i40e_pf_vf *vf)
break;
}
- i40e_pf_host_send_msg_to_vf(vf, VIRTCHNL_OP_EVENT,
- I40E_SUCCESS, (uint8_t *)&event, sizeof(event));
+ tval = I40E_READ_REG(hw, I40E_VF_ATQLEN(vf_id));
+ rval = I40E_READ_REG(hw, I40E_VF_ARQLEN(vf_id));
+
+ if (tval & I40E_VF_ATQLEN_ATQLEN_MASK ||
+ tval & I40E_VF_ATQLEN_ATQENABLE_MASK ||
+ rval & I40E_VF_ARQLEN_ARQLEN_MASK ||
+ rval & I40E_VF_ARQLEN_ARQENABLE_MASK)
+ i40e_pf_host_send_msg_to_vf(vf, VIRTCHNL_OP_EVENT,
+ I40E_SUCCESS, (uint8_t *)&event, sizeof(event));
}
void