@@ -905,18 +905,17 @@ static struct mlx5_flow_table *find_closest_ft_recursive(struct fs_node *root,
905
905
return ft ;
906
906
}
907
907
908
- /* If reverse is false then return the first flow table in next priority of
909
- * prio in the tree, else return the last flow table in the previous priority
910
- * of prio in the tree.
908
+ /* If reverse is false then return the first flow table next to the passed node
909
+ * in the tree, else return the last flow table before the node in the tree.
911
910
*/
912
- static struct mlx5_flow_table * find_closest_ft (struct fs_prio * prio , bool reverse )
911
+ static struct mlx5_flow_table * find_closest_ft (struct fs_node * node , bool reverse )
913
912
{
914
913
struct mlx5_flow_table * ft = NULL ;
915
914
struct fs_node * curr_node ;
916
915
struct fs_node * parent ;
917
916
918
- parent = prio -> node . parent ;
919
- curr_node = & prio -> node ;
917
+ parent = node -> parent ;
918
+ curr_node = node ;
920
919
while (!ft && parent ) {
921
920
ft = find_closest_ft_recursive (parent , & curr_node -> list , reverse );
922
921
curr_node = parent ;
@@ -926,15 +925,15 @@ static struct mlx5_flow_table *find_closest_ft(struct fs_prio *prio, bool revers
926
925
}
927
926
928
927
/* Assuming all the tree is locked by mutex chain lock */
929
- static struct mlx5_flow_table * find_next_chained_ft (struct fs_prio * prio )
928
+ static struct mlx5_flow_table * find_next_chained_ft (struct fs_node * node )
930
929
{
931
- return find_closest_ft (prio , false);
930
+ return find_closest_ft (node , false);
932
931
}
933
932
934
933
/* Assuming all the tree is locked by mutex chain lock */
935
- static struct mlx5_flow_table * find_prev_chained_ft (struct fs_prio * prio )
934
+ static struct mlx5_flow_table * find_prev_chained_ft (struct fs_node * node )
936
935
{
937
- return find_closest_ft (prio , true);
936
+ return find_closest_ft (node , true);
938
937
}
939
938
940
939
static struct mlx5_flow_table * find_next_fwd_ft (struct mlx5_flow_table * ft ,
@@ -946,7 +945,7 @@ static struct mlx5_flow_table *find_next_fwd_ft(struct mlx5_flow_table *ft,
946
945
next_ns = flow_act -> action & MLX5_FLOW_CONTEXT_ACTION_FWD_NEXT_NS ;
947
946
fs_get_obj (prio , next_ns ? ft -> ns -> node .parent : ft -> node .parent );
948
947
949
- return find_next_chained_ft (prio );
948
+ return find_next_chained_ft (& prio -> node );
950
949
}
951
950
952
951
static int connect_fts_in_prio (struct mlx5_core_dev * dev ,
@@ -977,7 +976,7 @@ static int connect_prev_fts(struct mlx5_core_dev *dev,
977
976
{
978
977
struct mlx5_flow_table * prev_ft ;
979
978
980
- prev_ft = find_prev_chained_ft (prio );
979
+ prev_ft = find_prev_chained_ft (& prio -> node );
981
980
if (prev_ft ) {
982
981
struct fs_prio * prev_prio ;
983
982
@@ -1123,7 +1122,7 @@ static int connect_flow_table(struct mlx5_core_dev *dev, struct mlx5_flow_table
1123
1122
if (err )
1124
1123
return err ;
1125
1124
1126
- next_ft = first_ft ? first_ft : find_next_chained_ft (prio );
1125
+ next_ft = first_ft ? first_ft : find_next_chained_ft (& prio -> node );
1127
1126
err = connect_fwd_rules (dev , ft , next_ft );
1128
1127
if (err )
1129
1128
return err ;
@@ -1198,7 +1197,7 @@ static struct mlx5_flow_table *__mlx5_create_flow_table(struct mlx5_flow_namespa
1198
1197
1199
1198
tree_init_node (& ft -> node , del_hw_flow_table , del_sw_flow_table );
1200
1199
next_ft = unmanaged ? ft_attr -> next_ft :
1201
- find_next_chained_ft (fs_prio );
1200
+ find_next_chained_ft (& fs_prio -> node );
1202
1201
ft -> def_miss_action = ns -> def_miss_action ;
1203
1202
ft -> ns = ns ;
1204
1203
err = root -> cmds -> create_flow_table (root , ft , ft_attr , next_ft );
@@ -2201,7 +2200,7 @@ static struct mlx5_flow_table *find_next_ft(struct mlx5_flow_table *ft)
2201
2200
2202
2201
if (!list_is_last (& ft -> node .list , & prio -> node .children ))
2203
2202
return list_next_entry (ft , node .list );
2204
- return find_next_chained_ft (prio );
2203
+ return find_next_chained_ft (& prio -> node );
2205
2204
}
2206
2205
2207
2206
static int update_root_ft_destroy (struct mlx5_flow_table * ft )
0 commit comments