From 653b285ff11380c44c96a92bedf08fe1614a2fdc Mon Sep 17 00:00:00 2001 From: Ivan Malov Date: Sun, 3 Nov 2019 13:33:09 +0300 Subject: [PATCH] net/sfc: fix adapter lock usage on rule creation The point is that adapter lock has to be held on list accesses, as well as when talking to the HW. Fixes: a9825ccf5bb8 ("net/sfc: support flow API filters") Cc: stable@dpdk.org Signed-off-by: Ivan Malov Signed-off-by: Andrew Rybchenko --- drivers/net/sfc/sfc_flow.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/sfc/sfc_flow.c b/drivers/net/sfc/sfc_flow.c index e4a9ba0ff9..8d636f6923 100644 --- a/drivers/net/sfc/sfc_flow.c +++ b/drivers/net/sfc/sfc_flow.c @@ -2315,10 +2315,10 @@ sfc_flow_create(struct rte_eth_dev *dev, if (rc != 0) goto fail_bad_value; - TAILQ_INSERT_TAIL(&sa->filter.flow_list, flow, entries); - sfc_adapter_lock(sa); + TAILQ_INSERT_TAIL(&sa->filter.flow_list, flow, entries); + if (sa->state == SFC_ADAPTER_STARTED) { rc = sfc_flow_filter_insert(sa, flow); if (rc != 0) { -- 2.20.1