[4/4] net/enic: remove locks from rte flow code
diff mbox series

Message ID 20190606152658.17311-5-hyonkim@cisco.com
State Accepted, archived
Delegated to: Ferruh Yigit
Headers show
Series
  • net/enic: minor updates
Related show

Checks

Context Check Description
ci/Intel-compilation fail Compilation issues
ci/checkpatch success coding style OK

Commit Message

Hyong Youb Kim June 6, 2019, 3:26 p.m. UTC
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(-)

Patch
diff mbox series

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 */