OSDN Git Service

net/mlx5: Compare with old_dest param to modify rule destination
authorJianbo Liu <jianbol@nvidia.com>
Mon, 31 Jul 2023 11:28:20 +0000 (14:28 +0300)
committerJakub Kicinski <kuba@kernel.org>
Thu, 3 Aug 2023 01:37:30 +0000 (18:37 -0700)
The rule destination must be compared with the old_dest passed in.

Signed-off-by: Jianbo Liu <jianbol@nvidia.com>
Reviewed-by: Mark Bloch <mbloch@nvidia.com>
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
Link: https://lore.kernel.org/r/24adc60d05d7492359ba343c6da1ebbe9fe284f6.1690802064.git.leon@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/mellanox/mlx5/core/fs_core.c

index 830ff84..59df615 100644 (file)
@@ -1066,7 +1066,7 @@ int mlx5_modify_rule_destination(struct mlx5_flow_handle *handle,
        }
 
        for (i = 0; i < handle->num_rules; i++) {
-               if (mlx5_flow_dests_cmp(new_dest, &handle->rule[i]->dest_attr))
+               if (mlx5_flow_dests_cmp(old_dest, &handle->rule[i]->dest_attr))
                        return _mlx5_modify_rule_destination(handle->rule[i],
                                                             new_dest);
        }