From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 83DABA034F; Mon, 11 Oct 2021 09:39:16 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 704B0410E1; Mon, 11 Oct 2021 09:39:16 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id 2019740E01; Mon, 11 Oct 2021 09:39:13 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10133"; a="207624552" X-IronPort-AV: E=Sophos;i="5.85,364,1624345200"; d="scan'208";a="207624552" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Oct 2021 00:38:58 -0700 X-IronPort-AV: E=Sophos;i="5.85,364,1624345200"; d="scan'208";a="440690597" Received: from unknown (HELO localhost.localdomain) ([10.240.183.93]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Oct 2021 00:38:56 -0700 From: dapengx.yu@intel.com To: Qiming Yang , Qi Zhang Cc: dev@dpdk.org, Dapeng Yu , stable@dpdk.org Date: Mon, 11 Oct 2021 15:38:49 +0800 Message-Id: <20211011073850.378080-1-dapengx.yu@intel.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH] net/ice: fix deadlock on flow redirect 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 If flow redirect failed, the spinlock will not be unlocked. This patch fixes it. Fixes: bc9201388d56 ("net/ice: support flow redirect") Cc: stable@dpdk.org Signed-off-by: Dapeng Yu --- drivers/net/ice/ice_generic_flow.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/ice/ice_generic_flow.c b/drivers/net/ice/ice_generic_flow.c index 3e6ed7005b..02f854666a 100644 --- a/drivers/net/ice/ice_generic_flow.c +++ b/drivers/net/ice/ice_generic_flow.c @@ -2542,7 +2542,7 @@ ice_flow_redirect(struct ice_adapter *ad, struct ice_pf *pf = &ad->pf; struct rte_flow *p_flow; void *temp; - int ret; + int ret = 0; rte_spinlock_lock(&pf->flow_ops_lock); @@ -2552,11 +2552,11 @@ ice_flow_redirect(struct ice_adapter *ad, ret = p_flow->engine->redirect(ad, p_flow, rd); if (ret) { PMD_DRV_LOG(ERR, "Failed to redirect flows"); - return ret; + break; } } rte_spinlock_unlock(&pf->flow_ops_lock); - return 0; + return ret; } -- 2.27.0