Add missing lock acquire.

Fixes: ff2d0c345c3b ("net/iavf: support generic flow API")
Cc: sta...@dpdk.org

Signed-off-by: David Marchand <david.march...@redhat.com>
---
 drivers/net/iavf/iavf_generic_flow.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/iavf/iavf_generic_flow.c 
b/drivers/net/iavf/iavf_generic_flow.c
index f33c764764..6f6e95fc45 100644
--- a/drivers/net/iavf/iavf_generic_flow.c
+++ b/drivers/net/iavf/iavf_generic_flow.c
@@ -2278,11 +2278,12 @@ iavf_flow_create(struct rte_eth_dev *dev,
        }
 
        flow->engine = engine;
+       rte_spinlock_lock(&vf->flow_ops_lock);
        TAILQ_INSERT_TAIL(&vf->flow_list, flow, node);
+       rte_spinlock_unlock(&vf->flow_ops_lock);
        PMD_DRV_LOG(INFO, "Succeeded to create (%d) flow", engine->type);
 
 free_flow:
-       rte_spinlock_unlock(&vf->flow_ops_lock);
        return flow;
 }
 
-- 
2.39.0

Reply via email to