summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_erp.c
diff options
context:
space:
mode:
authorIdo Schimmel <idosch@mellanox.com>2018-07-25 09:24:05 +0300
committerDavid S. Miller <davem@davemloft.net>2018-07-25 16:46:02 -0700
commita8758b67bf37ceb50e5b8c2b9138231c76461d20 (patch)
treefa05dd7bb8de1ad5b911802b0da9a5788cc2037c /drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_erp.c
parenta20ff8eb3f15c8adcae60fc467697b442f6267eb (diff)
downloadlinux-a8758b67bf37ceb50e5b8c2b9138231c76461d20.tar.bz2
mlxsw: spectrum_acl: Add A-TCAM rule insertion and deletion
Implement rule insertion and deletion into the A-TCAM before we flip the driver to start using the A-TCAM. Rule insertion into the A-TCAM is very similar to C-TCAM, but there are subtle differences between regions of different sizes (i.e., different number of key blocks). Specifically, as explained in "mlxsw: spectrum_acl: Allow encoding a partial key", in 12 key blocks regions a rule is split into two and the two halves of the rule are linked using a "large entry key ID". Such differences are abstracted away by using different region operations per region type. Signed-off-by: Ido Schimmel <idosch@mellanox.com> Reviewed-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_erp.c')
-rw-r--r--drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_erp.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_erp.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_erp.c
index e26efa451d4a..bb07723a0577 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_erp.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_erp.c
@@ -150,6 +150,11 @@ static const struct mlxsw_sp_acl_erp_table_ops erp_no_mask_ops = {
.erp_destroy = mlxsw_sp_acl_erp_no_mask_destroy,
};
+bool mlxsw_sp_acl_erp_is_ctcam_erp(const struct mlxsw_sp_acl_erp *erp)
+{
+ return erp->key.ctcam;
+}
+
u8 mlxsw_sp_acl_erp_id(const struct mlxsw_sp_acl_erp *erp)
{
return erp->id;