From patchwork Tue Sep 14 03:08:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yu, DapengX" X-Patchwork-Id: 98822 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 51F0CA0C45; Tue, 14 Sep 2021 05:09:12 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0E1974068F; Tue, 14 Sep 2021 05:09:12 +0200 (CEST) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mails.dpdk.org (Postfix) with ESMTP id 4CA6B40151; Tue, 14 Sep 2021 05:09:10 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10106"; a="219983225" X-IronPort-AV: E=Sophos;i="5.85,291,1624345200"; d="scan'208";a="219983225" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Sep 2021 20:09:05 -0700 X-IronPort-AV: E=Sophos;i="5.85,291,1624345200"; d="scan'208";a="552082859" Received: from unknown (HELO localhost.localdomain) ([10.240.183.93]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Sep 2021 20:09:02 -0700 From: dapengx.yu@intel.com To: Qiming Yang , Qi Zhang Cc: dev@dpdk.org, haiyue.wang@intel.com, Dapeng Yu , stable@dpdk.org Date: Tue, 14 Sep 2021 11:08:58 +0800 Message-Id: <20210914030858.202578-1-dapengx.yu@intel.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH] net/ice: retry getting VF VSI map after it fails 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 Sender: "dev" From: Dapeng Yu The request of getting VF VSI map request may fail when DCF is busy, this patch adds retry mechanism to make it able to succeed. Fixes: b09d34ac8584 ("net/ice: fix flow redirector") Cc: stable@dpdk.org Signed-off-by: Dapeng Yu --- drivers/net/ice/ice_dcf.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/drivers/net/ice/ice_dcf.c b/drivers/net/ice/ice_dcf.c index 38e9a84698..043bd48192 100644 --- a/drivers/net/ice/ice_dcf.c +++ b/drivers/net/ice/ice_dcf.c @@ -534,6 +534,7 @@ int ice_dcf_handle_vsi_update_event(struct ice_dcf_hw *hw) { struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(hw->eth_dev); + int i = 0; int err = 0; rte_spinlock_lock(&hw->vc_cmd_send_lock); @@ -541,8 +542,18 @@ ice_dcf_handle_vsi_update_event(struct ice_dcf_hw *hw) rte_intr_disable(&pci_dev->intr_handle); ice_dcf_disable_irq0(hw); - if (ice_dcf_get_vf_resource(hw) || ice_dcf_get_vf_vsi_map(hw) < 0) - err = -1; + do { + if (ice_dcf_get_vf_resource(hw) || + ice_dcf_get_vf_vsi_map(hw) < 0) { + err = -1; + goto again; + } else { + err = 0; + break; + } +again: + rte_delay_ms(ICE_DCF_ARQ_CHECK_TIME); + } while (i++ < ICE_DCF_ARQ_MAX_RETRIES); rte_intr_enable(&pci_dev->intr_handle); ice_dcf_enable_irq0(hw);