DPDK patches and discussions
 help / color / mirror / Atom feed
From: Hyong Youb Kim <hyonkim@cisco.com>
To: Ferruh Yigit <ferruh.yigit@intel.com>
Cc: dev@dpdk.org, John Daley <johndale@cisco.com>, stable@dpdk.org
Subject: [dpdk-dev] [PATCH 4/4] net/enic: remove locks from rte flow code
Date: Thu,  6 Jun 2019 08:26:58 -0700	[thread overview]
Message-ID: <20190606152658.17311-5-hyonkim@cisco.com> (raw)
In-Reply-To: <20190606152658.17311-1-hyonkim@cisco.com>

From: John Daley <johndale@cisco.com>

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 <johndale@cisco.com>
Reviewed-by: Hyong Youb Kim <hyonkim@cisco.com>
---
 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


  parent reply	other threads:[~2019-06-06 15:28 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-06 15:26 [dpdk-dev] [PATCH 0/4] net/enic: minor updates Hyong Youb Kim
2019-06-06 15:26 ` [dpdk-dev] [PATCH 1/4] net/enic: set min and max MTU Hyong Youb Kim
2019-06-06 15:26 ` [dpdk-dev] [PATCH 2/4] net/enic: report speed capabilities Hyong Youb Kim
2019-06-06 15:26 ` [dpdk-dev] [PATCH 3/4] net/enic: remove support for flow count action Hyong Youb Kim
2019-06-06 15:26 ` Hyong Youb Kim [this message]
2019-06-12 13:28 ` [dpdk-dev] [PATCH 0/4] net/enic: minor updates Ferruh Yigit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190606152658.17311-5-hyonkim@cisco.com \
    --to=hyonkim@cisco.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=johndale@cisco.com \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).