mlxsw: spectrum_acl: Don't migrate already migrated entry
authorJiri Pirko <jiri@mellanox.com>
Thu, 28 Feb 2019 06:59:17 +0000 (06:59 +0000)
committerDavid S. Miller <davem@davemloft.net>
Sat, 2 Mar 2019 05:44:10 +0000 (21:44 -0800)
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>
drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c

index e2699373dfa75cab1fc5aa0fc4c2d41d41143924..30131ea2e3246a57bce6e33b45f75eadee30bdf4 100644 (file)
@@ -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);