From patchwork Thu May 25 02:17:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhichao Zeng X-Patchwork-Id: 127356 X-Patchwork-Delegate: qi.z.zhang@intel.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id AF52142B94; Thu, 25 May 2023 04:11:52 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4419E40DDB; Thu, 25 May 2023 04:11:52 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id 057F240A82 for ; Thu, 25 May 2023 04:11:50 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1684980711; x=1716516711; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=WQq3ifEaDhCRaXyzeDspa153WwKuQ44zHoLtwv2m5KY=; b=Svpq0q6TMuyf1WCs36rCscCPOFG3cEDj9lMKL7/bVWKz2/2xEeMBo1cM yRyeXjK02yWhKvuFKghO/jO+8oTELgRMQVprs80A1aCkAyZuFtIltww0e ElK+lhrnMqGunLJloJKdc5Ow5rUNVZs/eH3+WCd7pG5n9kvxBRXzXP4tV bimAgt64+Zk2lgcNEPOCkC4ClHmlbp16VOnZBxxaDpnG2V0zxx9skain4 b/G1500e1hyed8742Y8qr3ZuIcqys4l2kw8/tFpHDBDNL2MgZ8jZApZiA xmc6QFcdAcOJk0IQWkM4iWSU6oepwB78G3nyFpXaRZZ4v0JenrW2A6Ps0 Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10720"; a="334104834" X-IronPort-AV: E=Sophos;i="6.00,190,1681196400"; d="scan'208";a="334104834" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 May 2023 19:11:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10720"; a="707800567" X-IronPort-AV: E=Sophos;i="6.00,190,1681196400"; d="scan'208";a="707800567" Received: from unknown (HELO zhichao-dpdk..) ([10.239.252.103]) by fmsmga007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 May 2023 19:11:48 -0700 From: Zhichao Zeng To: dev@dpdk.org Cc: qi.z.zhang@intel.com, Zhichao Zeng , Jingjing Wu , Beilei Xing Subject: [PATCH] net/iavf: add VF reset check Date: Thu, 25 May 2023 10:17:37 +0800 Message-Id: <20230525021737.1921818-1-zhichaox.zeng@intel.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org This commit adds a VF reset check before the dev_reset, so that the application can check if the iavf device comes out of reset when calling the rte_eth_dev_reset. Signed-off-by: Zhichao Zeng --- drivers/net/iavf/iavf_ethdev.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c index e6cf897293..1cc4540c9d 100644 --- a/drivers/net/iavf/iavf_ethdev.c +++ b/drivers/net/iavf/iavf_ethdev.c @@ -2855,6 +2855,15 @@ static int iavf_dev_reset(struct rte_eth_dev *dev) { int ret; + struct iavf_hw *hw = IAVF_DEV_PRIVATE_TO_HW(dev->data->dev_private); + + 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"); ret = iavf_dev_uninit(dev); if (ret)