net/iavf: fix duplicate reset done check with large VF

Message ID 20230621075156.2997087-1-zhichaox.zeng@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Qi Zhang
Headers
Series net/iavf: fix duplicate reset done check with large VF |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/github-robot: build success github build: passed
ci/intel-Functional success Functional PASS
ci/iol-aarch-unit-testing success Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-unit-testing success Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS

Commit Message

Zeng, ZhichaoX June 21, 2023, 7:51 a.m. UTC
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(-)
  

Patch

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");