Commit 8c81b743 authored by Nir Dotan's avatar Nir Dotan Committed by David S. Miller

mlxsw: spectrum_acl: Set A-TCAM rules in Bloom filter

Add calls to eRP module for updating Bloom filter when a rule is
added or removed from the A-TCAM. eRP module will update the Bloom
filter only for cases in which the region has an active eRP table.
Signed-off-by: default avatarNir Dotan <nird@mellanox.com>
Signed-off-by: default avatarIdo Schimmel <idosch@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent f5a2852e
...@@ -508,6 +508,13 @@ __mlxsw_sp_acl_atcam_entry_add(struct mlxsw_sp *mlxsw_sp, ...@@ -508,6 +508,13 @@ __mlxsw_sp_acl_atcam_entry_add(struct mlxsw_sp *mlxsw_sp,
if (err) if (err)
goto err_rhashtable_insert; goto err_rhashtable_insert;
/* Bloom filter must be updated here, before inserting the rule into
* the A-TCAM.
*/
err = mlxsw_sp_acl_erp_bf_insert(mlxsw_sp, aregion, erp_mask, aentry);
if (err)
goto err_bf_insert;
err = mlxsw_sp_acl_atcam_region_entry_insert(mlxsw_sp, aregion, aentry, err = mlxsw_sp_acl_atcam_region_entry_insert(mlxsw_sp, aregion, aentry,
rulei); rulei);
if (err) if (err)
...@@ -516,6 +523,8 @@ __mlxsw_sp_acl_atcam_entry_add(struct mlxsw_sp *mlxsw_sp, ...@@ -516,6 +523,8 @@ __mlxsw_sp_acl_atcam_entry_add(struct mlxsw_sp *mlxsw_sp,
return 0; return 0;
err_rule_insert: err_rule_insert:
mlxsw_sp_acl_erp_bf_remove(mlxsw_sp, aregion, erp_mask, aentry);
err_bf_insert:
rhashtable_remove_fast(&aregion->entries_ht, &aentry->ht_node, rhashtable_remove_fast(&aregion->entries_ht, &aentry->ht_node,
mlxsw_sp_acl_atcam_entries_ht_params); mlxsw_sp_acl_atcam_entries_ht_params);
err_rhashtable_insert: err_rhashtable_insert:
...@@ -529,6 +538,7 @@ __mlxsw_sp_acl_atcam_entry_del(struct mlxsw_sp *mlxsw_sp, ...@@ -529,6 +538,7 @@ __mlxsw_sp_acl_atcam_entry_del(struct mlxsw_sp *mlxsw_sp,
struct mlxsw_sp_acl_atcam_entry *aentry) struct mlxsw_sp_acl_atcam_entry *aentry)
{ {
mlxsw_sp_acl_atcam_region_entry_remove(mlxsw_sp, aregion, aentry); mlxsw_sp_acl_atcam_region_entry_remove(mlxsw_sp, aregion, aentry);
mlxsw_sp_acl_erp_bf_remove(mlxsw_sp, aregion, aentry->erp_mask, aentry);
rhashtable_remove_fast(&aregion->entries_ht, &aentry->ht_node, rhashtable_remove_fast(&aregion->entries_ht, &aentry->ht_node,
mlxsw_sp_acl_atcam_entries_ht_params); mlxsw_sp_acl_atcam_entries_ht_params);
mlxsw_sp_acl_erp_mask_put(aregion, aentry->erp_mask); mlxsw_sp_acl_erp_mask_put(aregion, aentry->erp_mask);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment