From: Nir Dotan Date: Sun, 16 Dec 2018 08:49:33 +0000 (+0000) Subject: mlxsw: spectrum_acl: Set master RP index on transition to eRP X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=dd97d85f1e4daaa86d7a2813d718b91e5261df57;p=openwrt%2Fstaging%2Fblogic.git mlxsw: spectrum_acl: Set master RP index on transition to eRP 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 Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller --- diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_erp.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_erp.c index 3326c930f3fa..1c19feefa5f2 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_erp.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_erp.c @@ -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);