DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] net/iavf: fix duplicate reset done check with large VF
@ 2023-06-21  7:51 Zhichao Zeng
  2023-06-30  6:06 ` [PATCH v2] " Zhichao Zeng
  0 siblings, 1 reply; 3+ messages in thread
From: Zhichao Zeng @ 2023-06-21  7:51 UTC (permalink / raw)
  To: dev; +Cc: qi.z.zhang, songx.jiale, Zhichao Zeng, Jingjing Wu, Beilei Xing

This patch fixes duplicate VF reset done check in dev_reset with large VF,
which cause some errors when starting testpmd with large VF.

Fixes: 7a93cd3575eb ("net/iavf: add VF reset check")
Signed-off-by: Zhichao Zeng <zhichaox.zeng@intel.com>
---
 drivers/net/iavf/iavf_ethdev.c | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c
index 00b963128b..d32f4f826f 100644
--- a/drivers/net/iavf/iavf_ethdev.c
+++ b/drivers/net/iavf/iavf_ethdev.c
@@ -2859,15 +2859,17 @@ iavf_dev_reset(struct rte_eth_dev *dev)
 	int ret;
 	struct iavf_hw *hw = IAVF_DEV_PRIVATE_TO_HW(dev->data->dev_private);
 
-	/*
-	 * Check whether the VF reset has been done and inform application,
-	 * to avoid calling the virtual channel command, which may cause
-	 * the device to be abnormal.
-	 */
-	ret = iavf_check_vf_reset_done(hw);
-	if (ret) {
-		PMD_DRV_LOG(ERR, "Wait too long for reset done!\n");
-		return ret;
+	if (dev->data->nb_rx_queues <= IAVF_MAX_NUM_QUEUES_DFLT) {
+		/*
+		 * Check whether the VF reset has been done and inform application,
+		 * to avoid calling the virtual channel command, which may cause
+		 * the device to be abnormal.
+		 */
+		ret = iavf_check_vf_reset_done(hw);
+		if (ret) {
+			PMD_DRV_LOG(ERR, "Wait too long for reset done!\n");
+			return ret;
+		}
 	}
 
 	PMD_DRV_LOG(DEBUG, "Start dev_reset ...\n");
-- 
2.34.1


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

* [PATCH v2] net/iavf: fix duplicate reset done check with large VF
  2023-06-21  7:51 [PATCH] net/iavf: fix duplicate reset done check with large VF Zhichao Zeng
@ 2023-06-30  6:06 ` Zhichao Zeng
  2023-06-30  8:04   ` Zhang, Qi Z
  0 siblings, 1 reply; 3+ messages in thread
From: Zhichao Zeng @ 2023-06-30  6:06 UTC (permalink / raw)
  To: dev; +Cc: qi.z.zhang, songx.jiale, Zhichao Zeng, Jingjing Wu, Beilei Xing

When starting with large vf, need to reset VF to request queues, the reset
process will execute VIRTCHNL commands to clean up resource.

VF reset done check and reset watchdog read the same global register,
resulting in the NIC not responding to the VIRTCHNL command.

This patch turns off the watchdog when request queues to avoid
the VIRTCHNL command timeout error when starting with large VF.

Fixes: af801b0374e3 ("net/iavf: add devargs to control watchdog")
Fixes: 7a93cd3575eb ("net/iavf: add VF reset check")
Signed-off-by: Zhichao Zeng <zhichaox.zeng@intel.com>
---
 drivers/net/iavf/iavf_ethdev.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c
index 00b963128b..ac7154d720 100644
--- a/drivers/net/iavf/iavf_ethdev.c
+++ b/drivers/net/iavf/iavf_ethdev.c
@@ -577,6 +577,7 @@ iavf_queues_req_reset(struct rte_eth_dev *dev, uint16_t num)
 	PMD_DRV_LOG(INFO, "change queue pairs from %u to %u",
 			vf->vsi_res->num_queue_pairs, num);
 
+	iavf_dev_watchdog_disable(ad);
 	ret = iavf_dev_reset(dev);
 	if (ret) {
 		PMD_DRV_LOG(ERR, "vf reset failed");
-- 
2.34.1


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

* RE: [PATCH v2] net/iavf: fix duplicate reset done check with large VF
  2023-06-30  6:06 ` [PATCH v2] " Zhichao Zeng
@ 2023-06-30  8:04   ` Zhang, Qi Z
  0 siblings, 0 replies; 3+ messages in thread
From: Zhang, Qi Z @ 2023-06-30  8:04 UTC (permalink / raw)
  To: Zeng, ZhichaoX, dev; +Cc: Jiale, SongX, Wu, Jingjing, Xing, Beilei



> -----Original Message-----
> From: Zeng, ZhichaoX <zhichaox.zeng@intel.com>
> Sent: Friday, June 30, 2023 2:06 PM
> To: dev@dpdk.org
> Cc: Zhang, Qi Z <qi.z.zhang@intel.com>; Jiale, SongX <songx.jiale@intel.com>;
> Zeng, ZhichaoX <zhichaox.zeng@intel.com>; Wu, Jingjing
> <jingjing.wu@intel.com>; Xing, Beilei <beilei.xing@intel.com>
> Subject: [PATCH v2] net/iavf: fix duplicate reset done check with large VF
> 
> When starting with large vf, need to reset VF to request queues, the reset
> process will execute VIRTCHNL commands to clean up resource.
> 
> VF reset done check and reset watchdog read the same global register,
> resulting in the NIC not responding to the VIRTCHNL command.
> 
> This patch turns off the watchdog when request queues to avoid the VIRTCHNL
> command timeout error when starting with large VF.
> 
> Fixes: af801b0374e3 ("net/iavf: add devargs to control watchdog")
> Fixes: 7a93cd3575eb ("net/iavf: add VF reset check")
> Signed-off-by: Zhichao Zeng <zhichaox.zeng@intel.com>

Acked-by: Qi Zhang <qi.z.zhang@intel.com>

Applied to dpdk-next-net-intel.

Thanks
Qi

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

end of thread, other threads:[~2023-06-30  8:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-21  7:51 [PATCH] net/iavf: fix duplicate reset done check with large VF Zhichao Zeng
2023-06-30  6:06 ` [PATCH v2] " Zhichao Zeng
2023-06-30  8:04   ` Zhang, Qi Z

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).