summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/mellanox/mlxsw/spectrum2_acl_tcam.c
diff options
context:
space:
mode:
authorIdo Schimmel2018-07-25 08:24:00 +0200
committerDavid S. Miller2018-07-26 01:46:01 +0200
commit174c0adb69a56bf098d9eb50cd3a78ec14657817 (patch)
tree0fa436b26ad498a3c49c3f85c8887842f8d7bf83 /drivers/net/ethernet/mellanox/mlxsw/spectrum2_acl_tcam.c
parentmlxsw: spectrum_acl: Allow encoding a partial key (diff)
downloadkernel-qcow2-linux-174c0adb69a56bf098d9eb50cd3a78ec14657817.tar.gz
kernel-qcow2-linux-174c0adb69a56bf098d9eb50cd3a78ec14657817.tar.xz
kernel-qcow2-linux-174c0adb69a56bf098d9eb50cd3a78ec14657817.zip
mlxsw: spectrum_acl: Add A-TCAM initialization
Initialize the A-TCAM as part of the driver's initialization routine. Specifically, initialize the eRP tables so that A-TCAM regions will be able to perform allocations of eRP tables upon rule insertion in subsequent patches. 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/spectrum2_acl_tcam.c')
-rw-r--r--drivers/net/ethernet/mellanox/mlxsw/spectrum2_acl_tcam.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum2_acl_tcam.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum2_acl_tcam.c
index 33787b154e74..2442decd0652 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum2_acl_tcam.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum2_acl_tcam.c
@@ -39,6 +39,7 @@
#include "core_acl_flex_actions.h"
struct mlxsw_sp2_acl_tcam {
+ struct mlxsw_sp_acl_atcam atcam;
u32 kvdl_index;
unsigned int kvdl_count;
};
@@ -100,9 +101,14 @@ static int mlxsw_sp2_acl_tcam_init(struct mlxsw_sp *mlxsw_sp, void *priv,
if (err)
goto err_pgcr_write;
+ err = mlxsw_sp_acl_atcam_init(mlxsw_sp, &tcam->atcam);
+ if (err)
+ goto err_atcam_init;
+
mlxsw_afa_block_destroy(afa_block);
return 0;
+err_atcam_init:
err_pgcr_write:
err_pefa_write:
err_afa_block_continue:
@@ -117,6 +123,7 @@ static void mlxsw_sp2_acl_tcam_fini(struct mlxsw_sp *mlxsw_sp, void *priv)
{
struct mlxsw_sp2_acl_tcam *tcam = priv;
+ mlxsw_sp_acl_atcam_fini(mlxsw_sp, &tcam->atcam);
mlxsw_sp_kvdl_free(mlxsw_sp, MLXSW_SP_KVDL_ENTRY_TYPE_ACTSET,
tcam->kvdl_count, tcam->kvdl_index);
}