From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 30E49A0352; Sun, 3 Nov 2019 11:33:30 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 70F371D447; Sun, 3 Nov 2019 11:33:29 +0100 (CET) Received: from shelob.oktetlabs.ru (shelob.oktetlabs.ru [84.52.114.115]) by dpdk.org (Postfix) with ESMTP id 90CD01D440; Sun, 3 Nov 2019 11:33:28 +0100 (CET) Received: from localhost.localdomain (unknown [188.242.7.54]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by shelob.oktetlabs.ru (Postfix) with ESMTPSA id F41867F50E; Sun, 3 Nov 2019 13:33:27 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 shelob.oktetlabs.ru F41867F50E DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=oktetlabs.ru; s=default; t=1572777208; bh=N+2nqPbZmaHyGzo4Y0/G4tjoLjbeqwIR+b93bOz7iE0=; h=From:To:Cc:Subject:Date; b=R8p/7akTNxqWlz+6CzioiaStHgmLUCzax2Exb0tyI0ab5G50k/NVaF/4+TnUNZkKN YhK78RwY3vRQbPEIDJwiXqy6SaWyXJk5uVTpimk1hDIfRn0B69Ickh6SBvpc0IzMkO jvum1pCW8vd+EWdrDou/HMDXcPQd9o3klJ4oQnlc= From: Ivan Malov To: dev@dpdk.org Cc: stable@dpdk.org, Andrew Rybchenko Date: Sun, 3 Nov 2019 13:33:09 +0300 Message-Id: <20191103103309.10813-1-ivan.malov@oktetlabs.ru> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH] net/sfc: fix adapter lock usage on rule creation X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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" 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 e4a9ba0ff..8d636f692 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