]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
mlxsw: spectrum_acl: Set master RP index on transition to eRP
authorNir Dotan <nird@mellanox.com>
Sun, 16 Dec 2018 08:49:33 +0000 (08:49 +0000)
committerDavid S. Miller <davem@davemloft.net>
Sun, 16 Dec 2018 23:20:34 +0000 (15:20 -0800)
Bloom filter is updated on transitions from a single rule pattern,
also called master RP, to eRP table and vice versa. Since rules are
being written to or deleted from the Bloom filter on such transitions,
it is not required to keep the same eRP bank ID for the master RP.

Change master RP index assignment so it will be assigned with zero.
This is consistent with the assignment of the first available spot
that is used for allocating eRP's indices.

Signed-off-by: Nir Dotan <nird@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_erp.c

index 3326c930f3faaf0dde6fdcc420a89db742ba6549..1c19feefa5f20120468b2c104f6f1e375d3ee3e7 100644 (file)
@@ -583,10 +583,10 @@ mlxsw_sp_acl_erp_region_table_trans(struct mlxsw_sp_acl_erp_table *erp_table)
                goto err_table_master_rp;
        }
 
-       /* Maintain the same eRP bank for the master RP, so that we
-        * wouldn't need to update the bloom filter
+       /* Make sure the master RP is using a valid index, as
+        * only a single eRP row is currently allocated.
         */
-       master_rp->index = master_rp->index % erp_core->num_erp_banks;
+       master_rp->index = 0;
        __set_bit(master_rp->index, erp_table->erp_index_bitmap);
 
        err = mlxsw_sp_acl_erp_table_erp_add(erp_table, master_rp);