net/mlx5: Don't maintain a case of del_sw_func being null
Add del_sw_func cb for root ns. Now there is no need to
maintain a case of del_sw_func being null when freeing the node.
Fixes: 2cc43b494a
("net/mlx5_core: Managing root flow table")
Signed-off-by: Roi Dayan <roid@mellanox.com>
Reviewed-by: Mark Bloch <markb@mellanox.com>
Reviewed-by: Paul Blakey <paulb@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
This commit is contained in:
parent
aee37f3d94
commit
6eb7a268a9
@ -346,14 +346,10 @@ static void tree_put_node(struct fs_node *node, bool locked)
|
|||||||
if (parent_node) {
|
if (parent_node) {
|
||||||
down_write_ref_node(parent_node, locked);
|
down_write_ref_node(parent_node, locked);
|
||||||
list_del_init(&node->list);
|
list_del_init(&node->list);
|
||||||
if (node->del_sw_func)
|
|
||||||
node->del_sw_func(node);
|
|
||||||
up_write_ref_node(parent_node, locked);
|
|
||||||
} else if (node->del_sw_func) {
|
|
||||||
node->del_sw_func(node);
|
|
||||||
} else {
|
|
||||||
kfree(node);
|
|
||||||
}
|
}
|
||||||
|
node->del_sw_func(node);
|
||||||
|
if (parent_node)
|
||||||
|
up_write_ref_node(parent_node, locked);
|
||||||
node = NULL;
|
node = NULL;
|
||||||
}
|
}
|
||||||
if (!node && parent_node)
|
if (!node && parent_node)
|
||||||
@ -2352,6 +2348,11 @@ static int init_root_tree(struct mlx5_flow_steering *steering,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void del_sw_root_ns(struct fs_node *node)
|
||||||
|
{
|
||||||
|
kfree(node);
|
||||||
|
}
|
||||||
|
|
||||||
static struct mlx5_flow_root_namespace
|
static struct mlx5_flow_root_namespace
|
||||||
*create_root_ns(struct mlx5_flow_steering *steering,
|
*create_root_ns(struct mlx5_flow_steering *steering,
|
||||||
enum fs_flow_table_type table_type)
|
enum fs_flow_table_type table_type)
|
||||||
@ -2378,7 +2379,7 @@ static struct mlx5_flow_root_namespace
|
|||||||
ns = &root_ns->ns;
|
ns = &root_ns->ns;
|
||||||
fs_init_namespace(ns);
|
fs_init_namespace(ns);
|
||||||
mutex_init(&root_ns->chain_lock);
|
mutex_init(&root_ns->chain_lock);
|
||||||
tree_init_node(&ns->node, NULL, NULL);
|
tree_init_node(&ns->node, NULL, del_sw_root_ns);
|
||||||
tree_add_node(&ns->node, NULL);
|
tree_add_node(&ns->node, NULL);
|
||||||
|
|
||||||
return root_ns;
|
return root_ns;
|
||||||
|
Loading…
Reference in New Issue
Block a user