summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuanhan Liu <yliu@fridaylinux.org>2017-08-30 10:40:36 +0800
committerYuanhan Liu <yliu@fridaylinux.org>2017-08-30 10:41:28 +0800
commit181038e178cf2170214f74ef33a17dcb326305d4 (patch)
treef6ecc249bad5ac833a893afebe80b7c23f021838
parent98d06d7f6e9066c370e90d7583db6eed1a61f2f6 (diff)
downloaddpdk-stable-181038e178cf2170214f74ef33a17dcb326305d4.zip
dpdk-stable-181038e178cf2170214f74ef33a17dcb326305d4.tar.gz
dpdk-stable-181038e178cf2170214f74ef33a17dcb326305d4.tar.xz
Revert "net/i40e: revert fix of PF notify when VF not up"
This reverts commit 849a7581b8426633617aa773d58b13c6b4150c03. Quote from Xiaoyun: Since the previous patch which will cause a big issue wasn't accepted in dpdk-stable. I think there is no need to include the revert patch. Signed-off-by: Yuanhan Liu <yliu@fridaylinux.org>
-rw-r--r--drivers/net/i40e/i40e_pf.c28
1 files changed, 16 insertions, 12 deletions
diff --git a/drivers/net/i40e/i40e_pf.c b/drivers/net/i40e/i40e_pf.c
index 2011461..65d93a8 100644
--- a/drivers/net/i40e/i40e_pf.c
+++ b/drivers/net/i40e/i40e_pf.c
@@ -152,20 +152,21 @@ i40e_pf_host_vf_reset(struct i40e_pf_vf *vf, bool do_hw_reset)
val |= I40E_VPGEN_VFRTRIG_VFSWR_MASK;
I40E_WRITE_REG(hw, I40E_VPGEN_VFRTRIG(vf_id), val);
I40E_WRITE_FLUSH(hw);
- }
#define VFRESET_MAX_WAIT_CNT 100
- /* Wait until VF reset is done */
- for (i = 0; i < VFRESET_MAX_WAIT_CNT; i++) {
- rte_delay_us(10);
- val = I40E_READ_REG(hw, I40E_VPGEN_VFRSTAT(vf_id));
- if (val & I40E_VPGEN_VFRSTAT_VFRD_MASK)
- break;
- }
+ /* Wait until VF reset is done */
+ for (i = 0; i < VFRESET_MAX_WAIT_CNT; i++) {
+ rte_delay_us(10);
+ val = I40E_READ_REG(hw, I40E_VPGEN_VFRSTAT(vf_id));
+ if (val & I40E_VPGEN_VFRSTAT_VFRD_MASK)
+ break;
+ }
- if (i >= VFRESET_MAX_WAIT_CNT) {
- PMD_DRV_LOG(ERR, "VF reset timeout");
- return -ETIMEDOUT;
+ if (i >= VFRESET_MAX_WAIT_CNT) {
+ PMD_DRV_LOG(ERR, "VF reset timeout");
+ return -ETIMEDOUT;
+ }
+ vf->state = I40E_VF_ACTIVE;
}
/* This is not first time to do reset, do cleanup job first */
if (vf->vsi) {
@@ -261,7 +262,10 @@ i40e_pf_host_send_msg_to_vf(struct i40e_pf_vf *vf,
{
struct i40e_hw *hw = I40E_PF_TO_HW(vf->pf);
uint16_t abs_vf_id = hw->func_caps.vf_base_id + vf->vf_idx;
- int ret;
+ int ret = I40E_ERR_ADMIN_QUEUE_ERROR;
+
+ if (vf->state == I40E_VF_INACTIVE)
+ return ret;
ret = i40e_aq_send_msg_to_vf(hw, abs_vf_id, opcode, retval,
msg, msglen, NULL);