From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 86912A0096 for ; Thu, 6 Jun 2019 17:28:07 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 703F41B9CB; Thu, 6 Jun 2019 17:27:58 +0200 (CEST) Received: from rcdn-iport-8.cisco.com (rcdn-iport-8.cisco.com [173.37.86.79]) by dpdk.org (Postfix) with ESMTP id BB3C71B9AF; Thu, 6 Jun 2019 17:27:55 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=2602; q=dns/txt; s=iport; t=1559834876; x=1561044476; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=UstlSHdFZ7XMInm0YjKQ+Y0sFbv+gB3t5W/9BTnBZUQ=; b=Nu71ZaCYYuL09xdq0uQOEjnIfI4zRcOjDm8Qn+uW66liHgRIsPfhlcpi tCFxsvBbLr6ipcQUN/6y/0+/jDErbnti/cyefeZRXlgu9HvFt1yUnN6os dhw63Gjynxnbfjisah0zb6kJMJUf2mfahIunMZKxOo1WM8OcP9RzchQ4u 0=; X-IronPort-AV: E=Sophos;i="5.63,559,1557187200"; d="scan'208";a="568781441" Received: from rcdn-core-4.cisco.com ([173.37.93.155]) by rcdn-iport-8.cisco.com with ESMTP/TLS/DHE-RSA-SEED-SHA; 06 Jun 2019 15:27:54 +0000 Received: from cisco.com (savbu-usnic-a.cisco.com [10.193.184.48]) by rcdn-core-4.cisco.com (8.15.2/8.15.2) with ESMTP id x56FRs9e026314; Thu, 6 Jun 2019 15:27:54 GMT Received: by cisco.com (Postfix, from userid 508933) id 962FD20F2001; Thu, 6 Jun 2019 08:27:54 -0700 (PDT) From: Hyong Youb Kim To: Ferruh Yigit Cc: dev@dpdk.org, John Daley , stable@dpdk.org Date: Thu, 6 Jun 2019 08:26:58 -0700 Message-Id: <20190606152658.17311-5-hyonkim@cisco.com> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20190606152658.17311-1-hyonkim@cisco.com> References: <20190606152658.17311-1-hyonkim@cisco.com> X-Outbound-SMTP-Client: 10.193.184.48, savbu-usnic-a.cisco.com X-Outbound-Node: rcdn-core-4.cisco.com Subject: [dpdk-dev] [PATCH 4/4] net/enic: remove locks from rte flow code 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" From: John Daley There is no requirement for thread safety in the flow PMD code and no need for the locks. Fixes: 6ced137607d0 ("net/enic: flow API for NICs with advanced filters enabled") Cc: stable@dpdk.org Signed-off-by: John Daley Reviewed-by: Hyong Youb Kim --- drivers/net/enic/enic.h | 1 - drivers/net/enic/enic_flow.c | 6 ------ drivers/net/enic/enic_main.c | 1 - 3 files changed, 8 deletions(-) diff --git a/drivers/net/enic/enic.h b/drivers/net/enic/enic.h index fb48a0452..a919aad7d 100644 --- a/drivers/net/enic/enic.h +++ b/drivers/net/enic/enic.h @@ -169,7 +169,6 @@ struct enic { rte_spinlock_t mtu_lock; LIST_HEAD(enic_flows, rte_flow) flows; - rte_spinlock_t flows_lock; /* RSS */ uint16_t reta_size; diff --git a/drivers/net/enic/enic_flow.c b/drivers/net/enic/enic_flow.c index f389677c0..06796201d 100644 --- a/drivers/net/enic/enic_flow.c +++ b/drivers/net/enic/enic_flow.c @@ -1737,12 +1737,10 @@ enic_flow_create(struct rte_eth_dev *dev, if (ret < 0) return NULL; - rte_spinlock_lock(&enic->flows_lock); flow = enic_flow_add_filter(enic, &enic_filter, &enic_action, error); if (flow) LIST_INSERT_HEAD(&enic->flows, flow, next); - rte_spinlock_unlock(&enic->flows_lock); return flow; } @@ -1761,10 +1759,8 @@ enic_flow_destroy(struct rte_eth_dev *dev, struct rte_flow *flow, FLOW_TRACE(); - rte_spinlock_lock(&enic->flows_lock); enic_flow_del_filter(enic, flow, error); LIST_REMOVE(flow, next); - rte_spinlock_unlock(&enic->flows_lock); rte_free(flow); return 0; } @@ -1783,7 +1779,6 @@ enic_flow_flush(struct rte_eth_dev *dev, struct rte_flow_error *error) FLOW_TRACE(); - rte_spinlock_lock(&enic->flows_lock); while (!LIST_EMPTY(&enic->flows)) { flow = LIST_FIRST(&enic->flows); @@ -1791,7 +1786,6 @@ enic_flow_flush(struct rte_eth_dev *dev, struct rte_flow_error *error) LIST_REMOVE(flow, next); rte_free(flow); } - rte_spinlock_unlock(&enic->flows_lock); return 0; } diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c index 2d6761bdd..c68d388dc 100644 --- a/drivers/net/enic/enic_main.c +++ b/drivers/net/enic/enic_main.c @@ -1679,7 +1679,6 @@ static int enic_dev_init(struct enic *enic) vnic_dev_set_reset_flag(enic->vdev, 0); LIST_INIT(&enic->flows); - rte_spinlock_init(&enic->flows_lock); /* set up link status checking */ vnic_dev_notify_set(enic->vdev, -1); /* No Intr for notify */ -- 2.16.2