net/enic: remove flow locks
authorJohn Daley <johndale@cisco.com>
Thu, 6 Jun 2019 15:26:58 +0000 (08:26 -0700)
committerFerruh Yigit <ferruh.yigit@intel.com>
Thu, 13 Jun 2019 15:01:06 +0000 (00:01 +0900)
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
drivers/net/enic/enic_flow.c
drivers/net/enic/enic_main.c

index 859d018..5a92508 100644 (file)
@@ -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;
index f389677..0679620 100644 (file)
@@ -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;
 }
 
index 2d6761b..c68d388 100644 (file)
@@ -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 */