Skip to content

Commit 7369ca8

Browse files
mawilli1Jeff Kirsher
authored andcommitted
i40e: Make VF resets more reliable
Clear the VFLR bit immediately after triggering a reset instead of waiting until after cleanup is complete. Make sure to trigger a reset every time, not just if the PF is up. These changes fix a problem where VF resets would get lost by the PF, preventing the VF driver from initializing. Change-ID: I5945cf2884095b7b0554867c64df8617e71d9d29 Signed-off-by: Mitch Williams <[email protected]> Tested-by: Andrew Bowers <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
1 parent d6bf58c commit 7369ca8

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

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

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -937,6 +937,10 @@ void i40e_reset_vf(struct i40e_vf *vf, bool flr)
937937
wr32(hw, I40E_VPGEN_VFRTRIG(vf->vf_id), reg);
938938
i40e_flush(hw);
939939
}
940+
/* clear the VFLR bit in GLGEN_VFLRSTAT */
941+
reg_idx = (hw->func_caps.vf_base_id + vf->vf_id) / 32;
942+
bit_idx = (hw->func_caps.vf_base_id + vf->vf_id) % 32;
943+
wr32(hw, I40E_GLGEN_VFLRSTAT(reg_idx), BIT(bit_idx));
940944

941945
if (i40e_quiesce_vf_pci(vf))
942946
dev_err(&pf->pdev->dev, "VF %d PCI transactions stuck\n",
@@ -989,10 +993,6 @@ void i40e_reset_vf(struct i40e_vf *vf, bool flr)
989993
/* tell the VF the reset is done */
990994
wr32(hw, I40E_VFGEN_RSTAT1(vf->vf_id), I40E_VFR_VFACTIVE);
991995

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));
996996
i40e_flush(hw);
997997
clear_bit(__I40E_VF_DISABLE, &pf->state);
998998
}
@@ -2296,11 +2296,9 @@ int i40e_vc_process_vflr_event(struct i40e_pf *pf)
22962296
/* read GLGEN_VFLRSTAT register to find out the flr VFs */
22972297
vf = &pf->vf[vf_id];
22982298
reg = rd32(hw, I40E_GLGEN_VFLRSTAT(reg_idx));
2299-
if (reg & BIT(bit_idx)) {
2299+
if (reg & BIT(bit_idx))
23002300
/* i40e_reset_vf will clear the bit in GLGEN_VFLRSTAT */
2301-
if (!test_bit(__I40E_DOWN, &pf->state))
2302-
i40e_reset_vf(vf, true);
2303-
}
2301+
i40e_reset_vf(vf, true);
23042302
}
23052303

23062304
return 0;

0 commit comments

Comments
 (0)