summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.h
diff options
context:
space:
mode:
authorNir Dotan <nird@mellanox.com>2018-12-16 08:49:28 +0000
committerDavid S. Miller <davem@davemloft.net>2018-12-16 15:20:34 -0800
commit7585cacdb978a0cd8d47bff9e5dcecdc9d903add (patch)
treefce0fbd6dc8609e4d77505b2c58cd7978590f45e /drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.h
parent0487cfba866a7f985c51ce7553d37439e10e71c1 (diff)
mlxsw: spectrum_acl: Add Bloom filter handling
Spectrum-2 HW uses Bloom filter in order to skip lookups on specific eRPs. It uses crc-16-Msbit-first calculation over a specific layout of a rule's key fields combined with eRP ID as well as region ID. Per potential lookup, iff the Bloom filter entry of the calculated index is empty, then the lookup can be skipped. Hence, the mlxsw driver should update the Bloom filter entry per each rule insertion or deletion when rules are part of an eRP. Add functions for adding and deleting entries in the Bloom filter. In order to do so also add crc-16 computation based on the specific Spectrum-2 polynomial and a function for encoding the crc-16 input in the manner dictated by HW implementation. 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>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.h')
-rw-r--r--drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.h b/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.h
index c65c902cb56a..30ac4d0132de 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.h
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.h
@@ -260,6 +260,18 @@ void mlxsw_sp_acl_erps_fini(struct mlxsw_sp *mlxsw_sp,
struct mlxsw_sp_acl_bf;
+int
+mlxsw_sp_acl_bf_entry_add(struct mlxsw_sp *mlxsw_sp,
+ struct mlxsw_sp_acl_bf *bf,
+ struct mlxsw_sp_acl_atcam_region *aregion,
+ unsigned int erp_bank,
+ struct mlxsw_sp_acl_atcam_entry *aentry);
+void
+mlxsw_sp_acl_bf_entry_del(struct mlxsw_sp *mlxsw_sp,
+ struct mlxsw_sp_acl_bf *bf,
+ struct mlxsw_sp_acl_atcam_region *aregion,
+ unsigned int erp_bank,
+ struct mlxsw_sp_acl_atcam_entry *aentry);
struct mlxsw_sp_acl_bf *
mlxsw_sp_acl_bf_init(struct mlxsw_sp *mlxsw_sp, unsigned int num_erp_banks);
void mlxsw_sp_acl_bf_fini(struct mlxsw_sp_acl_bf *bf);