Skip to contentSkip to conversation

net/ice: fix deadlock on flow redirect

PATCH Applied [email protected] 2 participants 2 messages Oct 11, 2021 – Oct 13, 2021 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/ice: fix deadlock on flow redirect

From: Dapeng Yu <[email protected]>

If flow redirect failed, the spinlock will not be unlocked. This patch fixes it.

Fixes bc9201388d56 ("net/ice: support flow redirect")
---
 drivers/net/ice/ice_generic_flow.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/ice/ice_generic_flow.c +3 -3
index 3e6ed7005b..02f854666a 100644
@@ -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;
 }
Signature · 1 line
2.27.0
Acked-by on v1 1/1 Applied
#1 lore raw
Quoted 12 lines

-----Original Message-----
From: Yu, DapengX <[email protected]>
Sent: Monday, October 11, 2021 3:39 PM
To: Yang, Qiming <[email protected]>; Zhang, Qi Z <[email protected]>
Cc: [email protected]; Yu, DapengX <[email protected]>; [email protected]
Subject: [PATCH] net/ice: fix deadlock on flow redirect

From: Dapeng Yu <[email protected]>

Quoted 7 lines

If flow redirect failed, the spinlock will not be unlocked. This patch fixes it.

Fixes bc9201388d56 ("net/ice: support flow redirect")

Applied to dpdk-next-net-intel.

Thanks
Qi