Skip to contentSkip to conversation

net/iavf: fix fail to reset vf when using dcf

PATCH Applied Kaiwen Deng 3 participants 4 messages Mar 14, 2024 – Apr 4, 2024 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/iavf: fix fail to reset vf when using dcf

On the latest ice kernel driver, renegotiating VIRTCHNL_OP_GET_VF_RESOURCES will fail without hardware reset when using dcf.

This commit will send VIRTCHNL_OP_RESET_VF to pf before dpdk resets vf.

Fixes 7a93cd3575eb ("net/iavf: add VF reset check")
---
 drivers/net/iavf/iavf_ethdev.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
drivers/net/iavf/iavf_ethdev.c +10 -0
index 245b3cd854..1c2d23f80f 100644
@@ -3038,6 +3038,16 @@ iavf_dev_reset(struct rte_eth_dev *dev)
 	struct iavf_adapter *adapter =
 		IAVF_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);
 	struct iavf_hw *hw = IAVF_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+	struct iavf_info *vf = IAVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);
+
+	if (!vf->in_reset_recovery) {
+		ret = iavf_aq_send_msg_to_pf(hw, VIRTCHNL_OP_RESET_VF,
+						IAVF_SUCCESS, NULL, 0, NULL);
+		if (ret) {
+			PMD_DRV_LOG(ERR, "fail to send cmd VIRTCHNL_OP_RESET_VF");
+			return ret;
+		}
+	}
 
 	/*
 	 * Check whether the VF reset has been done and inform application,
Signature · 1 line
2.34.1
Tested-by on v1 1/1
#1 lore raw
Quoted 12 lines

-----Original Message-----
From: Kaiwen Deng <[email protected]>
Sent: Thursday, March 14, 2024 9:01 AM
To: [email protected]
Cc: [email protected]; Zhou, YidingX <[email protected]>; Deng, KaiwenX <[email protected]>; Wu, Jingjing <[email protected]>; Zeng, ZhichaoX <[email protected]>; Zhang, Qi Z <[email protected]>
Subject: [PATCH] net/iavf: fix fail to reset vf when using dcf

On the latest ice kernel driver, renegotiating VIRTCHNL_OP_GET_VF_RESOURCES will fail without hardware reset when using dcf.

Quoted 6 lines

This commit will send VIRTCHNL_OP_RESET_VF to pf before dpdk resets vf.

Fixes 7a93cd3575eb ("net/iavf: add VF reset check")
#2 lore raw
Quoted 12 lines · HongboX
Quoted 12 lines

-----Original Message-----
From: Kaiwen Deng <[email protected]>
Sent: Thursday, March 14, 2024 9:01 AM
To: [email protected]
Cc: [email protected]; Zhou, YidingX <[email protected]>; Deng, KaiwenX <[email protected]>; Wu, Jingjing <[email protected]>; Zeng, ZhichaoX <[email protected]>; Zhang, Qi Z <[email protected]>
Subject: [PATCH] net/iavf: fix fail to reset vf when using dcf

On the latest ice kernel driver, renegotiating VIRTCHNL_OP_GET_VF_RESOURCES will fail without hardware reset when using dcf.

Quoted 8 lines
Quoted 6 lines

This commit will send VIRTCHNL_OP_RESET_VF to pf before dpdk resets vf.

Fixes 7a93cd3575eb ("net/iavf: add VF reset check")

Applied to dpdk-next-net-intel.
thanks,
/Bruce

#3 lore raw
In reply to Kaiwen Deng
Quoted 6 lines · Kaiwen Deng

On the latest ice kernel driver, renegotiating VIRTCHNL_OP_GET_VF_RESOURCES will fail without hardware reset when using dcf.

This commit will send VIRTCHNL_OP_RESET_VF to pf before dpdk resets vf.

Fixes 7a93cd3575eb ("net/iavf: add VF reset check")

It could be argued that the offending commit could actually be earlier:

Fixes e74e1bb6280d ("net/iavf: enable port reset")

When applying, I'll add both commits as fixes lines.

Quoted 31 lines
---
 drivers/net/iavf/iavf_ethdev.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
drivers/net/iavf/iavf_ethdev.c +10 -0
index 245b3cd854..1c2d23f80f 100644
@@ -3038,6 +3038,16 @@ iavf_dev_reset(struct rte_eth_dev *dev)
 	struct iavf_adapter *adapter =
 		IAVF_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);
 	struct iavf_hw *hw = IAVF_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+	struct iavf_info *vf = IAVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);
+
+	if (!vf->in_reset_recovery) {
+		ret = iavf_aq_send_msg_to_pf(hw, VIRTCHNL_OP_RESET_VF,
+						IAVF_SUCCESS, NULL, 0, NULL);
+		if (ret) {
+			PMD_DRV_LOG(ERR, "fail to send cmd VIRTCHNL_OP_RESET_VF");
+			return ret;
+		}
+	}
 
 	/*
 	 * Check whether the VF reset has been done and inform application,
Signature · 1 line
2.34.1