Skip to contentSkip to conversation

net/iavf: fix issue of VF resetting

PATCH Applied Yiding Zhou 2 participants 2 messages Jun 27, 2022 – Jun 28, 2022 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/iavf: fix issue of VF resetting

When the VF is in closed state, the vf_reset flag can not be reverted if the VF is reset asynchronously. This prevents all virtchnl commands from executing, causing subsequent calls to iavf_dev_reset() to fail.

So the vf_reset flag needs to be reverted even when VF is in closed state.

Fixes 676d986b4b86 ("net/iavf: fix crash after VF reset failure")
---
 drivers/net/iavf/iavf_ethdev.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/net/iavf/iavf_ethdev.c +5 -2
index 7df0bf8118..506fcff6e3 100644
@@ -2702,8 +2702,10 @@ iavf_dev_close(struct rte_eth_dev *dev)
 	if (rte_eal_process_type() != RTE_PROC_PRIMARY)
 		return 0;
 
-	if (adapter->closed)
-		return 0;
+	if (adapter->closed) {
+		ret = 0;
+		goto out;
+	}
 
 	ret = iavf_dev_stop(dev);
 	adapter->closed = true;
@@ -2763,6 +2765,7 @@ iavf_dev_close(struct rte_eth_dev *dev)
 	 * the bus master bit will not be disabled, and this call will have no
 	 * effect.
 	 */
+out:
 	if (vf->vf_reset && !rte_pci_set_bus_master(pci_dev, true))
 		vf->vf_reset = false;
 
Signature · 1 line
2.34.1
Acked-by on v1 1/1 Applied
#1 lore raw
Quoted 15 lines

-----Original Message-----
From: Zhou, YidingX <[email protected]>
Sent: Monday, June 27, 2022 3:23 PM
To: [email protected]
Cc: [email protected]; Zhou, YidingX <[email protected]>; Wu, Jingjing <[email protected]>; Xing, Beilei <[email protected]>; Zhang, Qi Z <[email protected]>
Subject: [PATCH] net/iavf: fix issue of VF resetting

When the VF is in closed state, the vf_reset flag can not be reverted if the VF is reset asynchronously. This prevents all virtchnl commands from executing, causing subsequent calls to iavf_dev_reset() to fail.

Quoted 6 lines

So the vf_reset flag needs to be reverted even when VF is in closed state.

Fixes 676d986b4b86 ("net/iavf: fix crash after VF reset failure")

Applied to dpdk-next-net-intel.

Thanks
Qi