Skip to content

Commit ec4bcb7

Browse files
PatrisiousHaddadgregkh
authored andcommitted
net/mlx5: Fix return value when searching for existing flow group
[ Upstream commit 8ec40e3 ] 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]> Signed-off-by: Sasha Levin <[email protected]>
1 parent 24db585 commit ec4bcb7

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
@@ -2207,6 +2207,7 @@ try_add_to_existing_fg(struct mlx5_flow_table *ft,
22072207
struct mlx5_flow_handle *rule;
22082208
struct match_list *iter;
22092209
bool take_write = false;
2210+
bool try_again = false;
22102211
struct fs_fte *fte;
22112212
u64 version = 0;
22122213
int err;
@@ -2271,6 +2272,7 @@ try_add_to_existing_fg(struct mlx5_flow_table *ft,
22712272
nested_down_write_ref_node(&g->node, FS_LOCK_PARENT);
22722273

22732274
if (!g->node.active) {
2275+
try_again = true;
22742276
up_write_ref_node(&g->node, false);
22752277
continue;
22762278
}
@@ -2292,7 +2294,8 @@ try_add_to_existing_fg(struct mlx5_flow_table *ft,
22922294
tree_put_node(&fte->node, false);
22932295
return rule;
22942296
}
2295-
rule = ERR_PTR(-ENOENT);
2297+
err = try_again ? -EAGAIN : -ENOENT;
2298+
rule = ERR_PTR(err);
22962299
out:
22972300
kmem_cache_free(steering->ftes_cache, fte);
22982301
return rule;

0 commit comments

Comments
 (0)