net/mlx5: Do not hold group lock while allocating FTE in software
FTE memory allocation using alloc_fte() doesn't have any dependency on the flow group. Hence, do not hold flow group lock while performing alloc_fte(). This helps to reduce contention of flow group lock. Signed-off-by: Parav Pandit <parav@mellanox.com> Reviewed-by: Daniel Jurgens <danielj@mellanox.com> Reviewed-by: Mark Bloch <markb@mellanox.com> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
This commit is contained in:
parent
ae2741e2b6
commit
84c7af6375
@ -1814,6 +1814,13 @@ search_again_locked:
|
||||
return rule;
|
||||
}
|
||||
|
||||
fte = alloc_fte(ft, spec, flow_act);
|
||||
if (IS_ERR(fte)) {
|
||||
up_write_ref_node(&ft->node, false);
|
||||
err = PTR_ERR(fte);
|
||||
goto err_alloc_fte;
|
||||
}
|
||||
|
||||
nested_down_write_ref_node(&g->node, FS_LOCK_PARENT);
|
||||
up_write_ref_node(&ft->node, false);
|
||||
|
||||
@ -1821,17 +1828,9 @@ search_again_locked:
|
||||
if (err)
|
||||
goto err_release_fg;
|
||||
|
||||
fte = alloc_fte(ft, spec, flow_act);
|
||||
if (IS_ERR(fte)) {
|
||||
err = PTR_ERR(fte);
|
||||
goto err_release_fg;
|
||||
}
|
||||
|
||||
err = insert_fte(g, fte);
|
||||
if (err) {
|
||||
kmem_cache_free(steering->ftes_cache, fte);
|
||||
if (err)
|
||||
goto err_release_fg;
|
||||
}
|
||||
|
||||
nested_down_write_ref_node(&fte->node, FS_LOCK_CHILD);
|
||||
up_write_ref_node(&g->node, false);
|
||||
@ -1843,6 +1842,8 @@ search_again_locked:
|
||||
|
||||
err_release_fg:
|
||||
up_write_ref_node(&g->node, false);
|
||||
kmem_cache_free(steering->ftes_cache, fte);
|
||||
err_alloc_fte:
|
||||
tree_put_node(&g->node, false);
|
||||
return ERR_PTR(err);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user