From: Dapeng Yu Date: Mon, 11 Oct 2021 07:38:49 +0000 (+0800) Subject: net/ice: fix deadlock on flow redirect X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=cc2f82b96a64789cc72beeb775a3a3543b5f2064;p=dpdk.git net/ice: fix deadlock on flow redirect 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 Acked-by: Qi Zhang --- 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; }