net/enic: remove flow locks
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>
This commit is contained in:
parent
d74111a9a1
commit
889dcfd571
@ -169,7 +169,6 @@ struct enic {
|
|||||||
rte_spinlock_t mtu_lock;
|
rte_spinlock_t mtu_lock;
|
||||||
|
|
||||||
LIST_HEAD(enic_flows, rte_flow) flows;
|
LIST_HEAD(enic_flows, rte_flow) flows;
|
||||||
rte_spinlock_t flows_lock;
|
|
||||||
|
|
||||||
/* RSS */
|
/* RSS */
|
||||||
uint16_t reta_size;
|
uint16_t reta_size;
|
||||||
|
@ -1737,12 +1737,10 @@ enic_flow_create(struct rte_eth_dev *dev,
|
|||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
rte_spinlock_lock(&enic->flows_lock);
|
|
||||||
flow = enic_flow_add_filter(enic, &enic_filter, &enic_action,
|
flow = enic_flow_add_filter(enic, &enic_filter, &enic_action,
|
||||||
error);
|
error);
|
||||||
if (flow)
|
if (flow)
|
||||||
LIST_INSERT_HEAD(&enic->flows, flow, next);
|
LIST_INSERT_HEAD(&enic->flows, flow, next);
|
||||||
rte_spinlock_unlock(&enic->flows_lock);
|
|
||||||
|
|
||||||
return flow;
|
return flow;
|
||||||
}
|
}
|
||||||
@ -1761,10 +1759,8 @@ enic_flow_destroy(struct rte_eth_dev *dev, struct rte_flow *flow,
|
|||||||
|
|
||||||
FLOW_TRACE();
|
FLOW_TRACE();
|
||||||
|
|
||||||
rte_spinlock_lock(&enic->flows_lock);
|
|
||||||
enic_flow_del_filter(enic, flow, error);
|
enic_flow_del_filter(enic, flow, error);
|
||||||
LIST_REMOVE(flow, next);
|
LIST_REMOVE(flow, next);
|
||||||
rte_spinlock_unlock(&enic->flows_lock);
|
|
||||||
rte_free(flow);
|
rte_free(flow);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -1783,7 +1779,6 @@ enic_flow_flush(struct rte_eth_dev *dev, struct rte_flow_error *error)
|
|||||||
|
|
||||||
FLOW_TRACE();
|
FLOW_TRACE();
|
||||||
|
|
||||||
rte_spinlock_lock(&enic->flows_lock);
|
|
||||||
|
|
||||||
while (!LIST_EMPTY(&enic->flows)) {
|
while (!LIST_EMPTY(&enic->flows)) {
|
||||||
flow = LIST_FIRST(&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);
|
LIST_REMOVE(flow, next);
|
||||||
rte_free(flow);
|
rte_free(flow);
|
||||||
}
|
}
|
||||||
rte_spinlock_unlock(&enic->flows_lock);
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1679,7 +1679,6 @@ static int enic_dev_init(struct enic *enic)
|
|||||||
vnic_dev_set_reset_flag(enic->vdev, 0);
|
vnic_dev_set_reset_flag(enic->vdev, 0);
|
||||||
|
|
||||||
LIST_INIT(&enic->flows);
|
LIST_INIT(&enic->flows);
|
||||||
rte_spinlock_init(&enic->flows_lock);
|
|
||||||
|
|
||||||
/* set up link status checking */
|
/* set up link status checking */
|
||||||
vnic_dev_notify_set(enic->vdev, -1); /* No Intr for notify */
|
vnic_dev_notify_set(enic->vdev, -1); /* No Intr for notify */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user