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>
rte_spinlock_t mtu_lock;
LIST_HEAD(enic_flows, rte_flow) flows;
rte_spinlock_t mtu_lock;
LIST_HEAD(enic_flows, rte_flow) flows;
- rte_spinlock_t flows_lock;
/* RSS */
uint16_t reta_size;
/* RSS */
uint16_t reta_size;
if (ret < 0)
return NULL;
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);
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);
- rte_spinlock_lock(&enic->flows_lock);
enic_flow_del_filter(enic, flow, error);
LIST_REMOVE(flow, next);
enic_flow_del_filter(enic, flow, error);
LIST_REMOVE(flow, next);
- rte_spinlock_unlock(&enic->flows_lock);
rte_free(flow);
return 0;
}
rte_free(flow);
return 0;
}
- rte_spinlock_lock(&enic->flows_lock);
while (!LIST_EMPTY(&enic->flows)) {
flow = LIST_FIRST(&enic->flows);
while (!LIST_EMPTY(&enic->flows)) {
flow = LIST_FIRST(&enic->flows);
LIST_REMOVE(flow, next);
rte_free(flow);
}
LIST_REMOVE(flow, next);
rte_free(flow);
}
- rte_spinlock_unlock(&enic->flows_lock);
vnic_dev_set_reset_flag(enic->vdev, 0);
LIST_INIT(&enic->flows);
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 */
/* set up link status checking */
vnic_dev_notify_set(enic->vdev, -1); /* No Intr for notify */