From b8da4b79451aa9b5c132eddce9b00fa634726299 Mon Sep 17 00:00:00 2001 From: Eli Britstein Date: Tue, 19 Mar 2019 14:25:21 +0000 Subject: [PATCH] net/mlx5: Fix multiple updates of steering rules in parallel mainline inclusion from mainline-5.1-rc1 commit 6237634d8fcc category: bugfix bugzilla: 12601 CVE: NA ------------------------------------------------- There might be a condition where the fte found is not active yet. In this case we should not use it, but continue to search for another, or allocate a new one. Fixes: bd71b08ec2ee ("net/mlx5: Support multiple updates of steering rules in parallel") Signed-off-by: Eli Britstein Reviewed-by: Maor Gottlieb Signed-off-by: Saeed Mahameed Signed-off-by: Zhiqiang Liu Reviewed-by: Wenan Mao Reviewed-by: Wenan Mao Signed-off-by: Yang Yingliang --- drivers/net/ethernet/mellanox/mlx5/core/fs_core.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c index d181645fd968..4536ef76efc2 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c @@ -469,6 +469,7 @@ static void del_hw_fte(struct fs_node *node) mlx5_core_warn(dev, "flow steering can't delete fte in index %d of flow group id %d\n", fte->index, fg->id); + node->active = 0; } } @@ -1595,6 +1596,11 @@ lookup_fte_locked(struct mlx5_flow_group *g, fte_tmp = NULL; goto out; } + if (!fte_tmp->node.active) { + tree_put_node(&fte_tmp->node); + fte_tmp = NULL; + goto out; + } nested_down_write_ref_node(&fte_tmp->node, FS_LOCK_CHILD); out: -- GitLab