mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH net-next] i40e: i40e_reset_vf should return false if reset vf timeout
@ 2022-07-05  1:13 Zhengchao Shao
  2022-07-12  0:03 ` Laba, SlawomirX
  0 siblings, 1 reply; 2+ messages in thread
From: Zhengchao Shao @ 2022-07-05  1:13 UTC (permalink / raw)
  To: intel-wired-lan, netdev, linux-kernel, bpf, davem, edumazet,
	kuba, pabeni, jesse.brandeburg, anthony.l.nguyen, ast, daniel,
	hawk, john.fastabend
  Cc: weiyongjun1, yuehaibing, shaozhengchao

when trigger vf reset, but vf status is not ready, i40e_reset_vf
should not do other cleanup action. The current logic is always return
true. But it can't cover timeout scenary, and the looping in function
i40e_vc_reset_vf is useless. 
Waiting for 120ms will cover most normal scenary. And the caller 
function should try again when timeout or accept that resetting vf 
failed.

Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com>
---
 drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
index d01fb592778c..42262009a00c 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
@@ -1564,11 +1564,17 @@ bool i40e_reset_vf(struct i40e_vf *vf, bool flr)
 	if (flr)
 		usleep_range(10000, 20000);
 
-	if (!rsd)
-		dev_err(&pf->pdev->dev, "VF reset check timeout on VF %d\n",
-			vf->vf_id);
 	usleep_range(10000, 20000);
 
+	if (!rsd) {
+		reg = rd32(hw, I40E_VPGEN_VFRSTAT(vf->vf_id));
+		if (!(reg & I40E_VPGEN_VFRSTAT_VFRD_MASK)) {
+			dev_err(&pf->pdev->dev, "VF reset check timeout on VF %d\n",
+				vf->vf_id);
+			return false;
+		}
+	}
+
 	/* On initial reset, we don't have any queues to disable */
 	if (vf->lan_vsi_idx != 0)
 		i40e_vsi_stop_rings(pf->vsi[vf->lan_vsi_idx]);
-- 
2.17.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-07-12  0:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-05  1:13 [PATCH net-next] i40e: i40e_reset_vf should return false if reset vf timeout Zhengchao Shao
2022-07-12  0:03 ` Laba, SlawomirX

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®