]> git.droids-corp.org - dpdk.git/commitdiff
net/i40e: fix VF reset flow
authorQi Zhang <qi.z.zhang@intel.com>
Tue, 17 Jan 2017 08:45:11 +0000 (16:45 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 17 Jan 2017 18:41:43 +0000 (19:41 +0100)
Add missing step during VF reset: PF should
set I40E_VFGEN_RSTAT to ACTIVE at end of the
VF reset operation or VF driver may not able
to detect that reset is already completed.
This patch also remove the unnecessary enum
for vfr state.

Fixes: 4861cde46116 ("i40e: new poll mode driver")
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Vincent Jardin <vincent.jardin@6wind.com>
drivers/net/i40e/i40e_pf.c
drivers/net/i40e/i40e_pf.h

index 5c584249178a298c7a2b16cb7f362de30efe1412..8a6733cc955480e8ac38095e4553385bb300ffed 100644 (file)
@@ -139,7 +139,7 @@ i40e_pf_host_vf_reset(struct i40e_pf_vf *vf, bool do_hw_reset)
        abs_vf_id = vf_id + hw->func_caps.vf_base_id;
 
        /* Notify VF that we are in VFR progress */
-       I40E_WRITE_REG(hw, I40E_VFGEN_RSTAT1(vf_id), I40E_PF_VFR_INPROGRESS);
+       I40E_WRITE_REG(hw, I40E_VFGEN_RSTAT1(vf_id), I40E_VFR_INPROGRESS);
 
        /*
         * If require a SW VF reset, a VFLR interrupt will be generated,
@@ -220,7 +220,7 @@ i40e_pf_host_vf_reset(struct i40e_pf_vf *vf, bool do_hw_reset)
        }
 
        /* Reset done, Set COMPLETE flag and clear reset bit */
-       I40E_WRITE_REG(hw, I40E_VFGEN_RSTAT1(vf_id), I40E_PF_VFR_COMPLETED);
+       I40E_WRITE_REG(hw, I40E_VFGEN_RSTAT1(vf_id), I40E_VFR_COMPLETED);
        val = I40E_READ_REG(hw, I40E_VPGEN_VFRTRIG(vf_id));
        val &= ~I40E_VPGEN_VFRTRIG_VFSWR_MASK;
        I40E_WRITE_REG(hw, I40E_VPGEN_VFRTRIG(vf_id), val);
@@ -248,6 +248,8 @@ i40e_pf_host_vf_reset(struct i40e_pf_vf *vf, bool do_hw_reset)
                return -EFAULT;
        }
 
+       I40E_WRITE_REG(hw, I40E_VFGEN_RSTAT1(vf_id), I40E_VFR_VFACTIVE);
+
        return ret;
 }
 
index 47a9c348f3395199e7bcdd8b54ff5c318464ac10..b4c2287693dfbf81ecc50bb89c23f2f7c285c1a5 100644 (file)
 
 #define I40E_DPDK_OFFSET  0x100
 
-enum i40e_pf_vfr_state {
-       I40E_PF_VFR_INPROGRESS = 0,
-       I40E_PF_VFR_COMPLETED = 1,
-};
-
 /* DPDK pf driver specific command to VF */
 enum i40e_virtchnl_ops_dpdk {
        /*