summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiri Pirko <jiri@mellanox.com>2019-02-28 09:59:17 +0300
committerDavid S. Miller <davem@davemloft.net>2019-03-02 08:44:10 +0300
commit6ca219e7de9fb54b4eac9c3f14a0cdf2b39d723d (patch)
tree6e93f6a60fb6cc801bccfa0da4b80ec4f15771fd
parentf9b274ce014421899b62cb0e41e5e7b72773782b (diff)
downloadlinux-6ca219e7de9fb54b4eac9c3f14a0cdf2b39d723d.tar.xz
mlxsw: spectrum_acl: Don't migrate already migrated entry
Check if the entry is already in a chunk where we want it to be. In that case, skip migration. This is preparation for "per parts" migration where this situation may occur. Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c
index e2699373dfa7..30131ea2e324 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c
@@ -1174,6 +1174,10 @@ mlxsw_sp_acl_tcam_ventry_migrate(struct mlxsw_sp *mlxsw_sp,
{
struct mlxsw_sp_acl_tcam_entry *entry2;
+ /* First check if the entry is not already where we want it to be. */
+ if (ventry->entry->chunk == chunk2)
+ return 0;
+
entry2 = mlxsw_sp_acl_tcam_entry_create(mlxsw_sp, ventry, chunk2);
if (IS_ERR(entry2))
return PTR_ERR(entry2);