From patchwork Thu Jan 5 13:57:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 121625 X-Patchwork-Delegate: qi.z.zhang@intel.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id B5405A00C2; Thu, 5 Jan 2023 14:57:53 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A70C542D20; Thu, 5 Jan 2023 14:57:53 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 9304442D23 for ; Thu, 5 Jan 2023 14:57:51 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1672927071; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5wnmTS5LNfe2a+qmDEZbkRq2JvtdJZHbGzaj0DgUARI=; b=QWzBe1l1tOkLjRLVpwT/exwGafzE5eWIvwfPFkQZU256HBHoouACdOuKOa9PXhX1LJx6KX LDK+OjXCZtE8zyoNXB6Wh1oxo2EPeLgyWD2/tj+D8mhrTBlb44mov0AKqP8vPgEisVj4g3 pZ9x8X4sjyQ1KYO8/f5UjknS685sFPA= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-395-RRT9c0blO0WfAfTGgimRMg-1; Thu, 05 Jan 2023 08:57:47 -0500 X-MC-Unique: RRT9c0blO0WfAfTGgimRMg-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B019F858F0E; Thu, 5 Jan 2023 13:57:46 +0000 (UTC) Received: from dmarchan.redhat.com (ovpn-193-12.brq.redhat.com [10.40.193.12]) by smtp.corp.redhat.com (Postfix) with ESMTP id 68DDCC15BA0; Thu, 5 Jan 2023 13:57:45 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: stable@dpdk.org, Jingjing Wu , Beilei Xing , Qi Zhang , Qiming Yang Subject: [PATCH] net/iavf: protect insertion in flow list Date: Thu, 5 Jan 2023 14:57:43 +0100 Message-Id: <20230105135743.4162991-1-david.marchand@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Add missing lock acquire. Fixes: ff2d0c345c3b ("net/iavf: support generic flow API") Cc: stable@dpdk.org Signed-off-by: David Marchand Acked-by: Qi Zhang --- 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; }