summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorMark Bloch <markb@mellanox.com>2016-09-11 12:54:50 +0000
committerLeon Romanovsky <leon@kernel.org>2016-10-30 15:43:15 +0200
commit0501fc477c2bed1cce02acbc22d79418bfa2c8c3 (patch)
tree1216f1579ed35a993b6443d527b080ba85dcedc7 /drivers
parent0fd758d6112f867b2cc6df0f6a856048ff99b211 (diff)
net/mlx5: Use fte status to decide on firmware command
An fte status becomes FS_FTE_STATUS_EXISTING only after it was created in HW. We can use this in order to simplify the logic on what firmware command to use. If the status isn't FS_FTE_STATUS_EXISTING we need to create the fte, otherwise we need only to update it. Signed-off-by: Mark Bloch <markb@mellanox.com> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com> Signed-off-by: Leon Romanovsky <leon@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/ethernet/mellanox/mlx5/core/fs_core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c
index a07ff305b44f..e2bab9d09acb 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c
@@ -946,7 +946,7 @@ static struct mlx5_flow_rule *add_rule_fte(struct fs_fte *fte,
BIT(MLX5_SET_FTE_MODIFY_ENABLE_MASK_DESTINATION_LIST);
}
- if (fte->dests_size == 1 || !dest)
+ if (!(fte->status & FS_FTE_STATUS_EXISTING))
err = mlx5_cmd_create_fte(get_dev(&ft->node),
ft, fg->id, fte);
else