Skip to content

Commit 8ec40e3

Browse files
PatrisiousHaddadkuba-moo
authored andcommitted
net/mlx5: Fix return value when searching for existing flow group
When attempting to add a rule to an existing flow group, if a matching flow group exists but is not active, the error code returned should be EAGAIN, so that the rule can be added to the matching flow group once it is active, rather than ENOENT, which indicates that no matching flow group was found. Fixes: bd71b08 ("net/mlx5: Support multiple updates of steering rules in parallel") Signed-off-by: Gavi Teitz <[email protected]> Signed-off-by: Roi Dayan <[email protected]> Signed-off-by: Patrisious Haddad <[email protected]> Reviewed-by: Tariq Toukan <[email protected]> Signed-off-by: Mark Bloch <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 687560d commit 8ec40e3

File tree

1 file changed

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

1 file changed

+4
-1
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2228,6 +2228,7 @@ try_add_to_existing_fg(struct mlx5_flow_table *ft,
22282228
struct mlx5_flow_handle *rule;
22292229
struct match_list *iter;
22302230
bool take_write = false;
2231+
bool try_again = false;
22312232
struct fs_fte *fte;
22322233
u64 version = 0;
22332234
int err;
@@ -2292,6 +2293,7 @@ try_add_to_existing_fg(struct mlx5_flow_table *ft,
22922293
nested_down_write_ref_node(&g->node, FS_LOCK_PARENT);
22932294

22942295
if (!g->node.active) {
2296+
try_again = true;
22952297
up_write_ref_node(&g->node, false);
22962298
continue;
22972299
}
@@ -2313,7 +2315,8 @@ try_add_to_existing_fg(struct mlx5_flow_table *ft,
23132315
tree_put_node(&fte->node, false);
23142316
return rule;
23152317
}
2316-
rule = ERR_PTR(-ENOENT);
2318+
err = try_again ? -EAGAIN : -ENOENT;
2319+
rule = ERR_PTR(err);
23172320
out:
23182321
kmem_cache_free(steering->ftes_cache, fte);
23192322
return rule;

0 commit comments

Comments
 (0)