Skip to content

Commit 7e5a313

Browse files
mawilli1Jeff Kirsher
authored andcommitted
i40e: Added code to prevent double resets
Clear the VFLR bit after reset processing, instead of before. This prevents double resets on VF init. Signed-off-by: Mitch Williams <[email protected]> Tested-by: Andrew Bowers <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
1 parent d3ce573 commit 7e5a313

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -917,9 +917,9 @@ void i40e_reset_vf(struct i40e_vf *vf, bool flr)
917917
{
918918
struct i40e_pf *pf = vf->pf;
919919
struct i40e_hw *hw = &pf->hw;
920+
u32 reg, reg_idx, bit_idx;
920921
bool rsd = false;
921922
int i;
922-
u32 reg;
923923

924924
if (test_and_set_bit(__I40E_VF_DISABLE, &pf->state))
925925
return;
@@ -988,6 +988,11 @@ void i40e_reset_vf(struct i40e_vf *vf, bool flr)
988988
}
989989
/* tell the VF the reset is done */
990990
wr32(hw, I40E_VFGEN_RSTAT1(vf->vf_id), I40E_VFR_VFACTIVE);
991+
992+
/* clear the VFLR bit in GLGEN_VFLRSTAT */
993+
reg_idx = (hw->func_caps.vf_base_id + vf->vf_id) / 32;
994+
bit_idx = (hw->func_caps.vf_base_id + vf->vf_id) % 32;
995+
wr32(hw, I40E_GLGEN_VFLRSTAT(reg_idx), BIT(bit_idx));
991996
i40e_flush(hw);
992997
clear_bit(__I40E_VF_DISABLE, &pf->state);
993998
}
@@ -2293,9 +2298,7 @@ int i40e_vc_process_vflr_event(struct i40e_pf *pf)
22932298
vf = &pf->vf[vf_id];
22942299
reg = rd32(hw, I40E_GLGEN_VFLRSTAT(reg_idx));
22952300
if (reg & BIT(bit_idx)) {
2296-
/* clear the bit in GLGEN_VFLRSTAT */
2297-
wr32(hw, I40E_GLGEN_VFLRSTAT(reg_idx), BIT(bit_idx));
2298-
2301+
/* i40e_reset_vf will clear the bit in GLGEN_VFLRSTAT */
22992302
if (!test_bit(__I40E_DOWN, &pf->state))
23002303
i40e_reset_vf(vf, true);
23012304
}

0 commit comments

Comments
 (0)