Skip to content

Commit b92af5a

Browse files
matanb10Saeed Mahameed
authored andcommitted
net/mlx5: Fix creating a new FTE when an existing but full FTE exists
Currently, when a flow steering rule is added, we look for a FTE with an identical value. If we find a match, we try to merge the required destinations with the existing ones. In a case where the existing destination list is full, the code should return an error to its consumer. However, the current code just tries to create another FTE. Fixing that by returning an error in this special scenario. Fixes: f478be79a22e ("net/mlx5: Add hash table for flow groups in flow table") Signed-off-by: Matan Barak <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]>
1 parent e19b205 commit b92af5a

File tree

1 file changed

+4
-2
lines changed
  • drivers/net/ethernet/mellanox/mlx5/core

1 file changed

+4
-2
lines changed

drivers/net/ethernet/mellanox/mlx5/core/fs_core.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1449,7 +1449,7 @@ try_add_to_existing_fg(struct mlx5_flow_table *ft,
14491449
int dest_num)
14501450
{
14511451
struct mlx5_flow_group *g;
1452-
struct mlx5_flow_handle *rule = ERR_PTR(-ENOENT);
1452+
struct mlx5_flow_handle *rule;
14531453
struct rhlist_head *tmp, *list;
14541454
struct match_list {
14551455
struct list_head list;
@@ -1513,6 +1513,8 @@ try_add_to_existing_fg(struct mlx5_flow_table *ft,
15131513
unlock_ref_node(&g->node);
15141514
}
15151515

1516+
rule = ERR_PTR(-ENOENT);
1517+
15161518
free_list:
15171519
if (!list_empty(&match_head)) {
15181520
struct match_list *match_tmp;
@@ -1553,7 +1555,7 @@ _mlx5_add_flow_rules(struct mlx5_flow_table *ft,
15531555

15541556
nested_lock_ref_node(&ft->node, FS_MUTEX_GRANDPARENT);
15551557
rule = try_add_to_existing_fg(ft, spec, flow_act, dest, dest_num);
1556-
if (!IS_ERR(rule))
1558+
if (!IS_ERR(rule) || PTR_ERR(rule) != -ENOENT)
15571559
goto unlock;
15581560

15591561
g = create_autogroup(ft, spec->match_criteria_enable,

0 commit comments

Comments
 (0)