summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/mellanox/mlxsw/spectrum2_acl_tcam.c
diff options
context:
space:
mode:
authorIdo Schimmel2018-07-25 08:24:05 +0200
committerDavid S. Miller2018-07-26 01:46:02 +0200
commita8758b67bf37ceb50e5b8c2b9138231c76461d20 (patch)
treefa05dd7bb8de1ad5b911802b0da9a5788cc2037c /drivers/net/ethernet/mellanox/mlxsw/spectrum2_acl_tcam.c
parentmlxsw: spectrum_acl: Pass C-TCAM region and entry to insert function (diff)
downloadkernel-qcow2-linux-a8758b67bf37ceb50e5b8c2b9138231c76461d20.tar.gz
kernel-qcow2-linux-a8758b67bf37ceb50e5b8c2b9138231c76461d20.tar.xz
kernel-qcow2-linux-a8758b67bf37ceb50e5b8c2b9138231c76461d20.zip
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/spectrum2_acl_tcam.c')
-rw-r--r--drivers/net/ethernet/mellanox/mlxsw/spectrum2_acl_tcam.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum2_acl_tcam.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum2_acl_tcam.c
index bef2329bb233..aef366148cc3 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum2_acl_tcam.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum2_acl_tcam.c
@@ -54,7 +54,7 @@ struct mlxsw_sp2_acl_tcam_chunk {
};
struct mlxsw_sp2_acl_tcam_entry {
- struct mlxsw_sp_acl_ctcam_entry centry;
+ struct mlxsw_sp_acl_atcam_entry aentry;
struct mlxsw_afa_block *act_block;
};
@@ -185,8 +185,8 @@ static int mlxsw_sp2_acl_tcam_entry_add(struct mlxsw_sp *mlxsw_sp,
entry->act_block = rulei->act_block;
return mlxsw_sp_acl_ctcam_entry_add(mlxsw_sp, &region->aregion.cregion,
- &chunk->cchunk, &entry->centry,
- rulei, true);
+ &chunk->cchunk,
+ &entry->aentry.centry, rulei, true);
}
static void mlxsw_sp2_acl_tcam_entry_del(struct mlxsw_sp *mlxsw_sp,
@@ -198,7 +198,7 @@ static void mlxsw_sp2_acl_tcam_entry_del(struct mlxsw_sp *mlxsw_sp,
struct mlxsw_sp2_acl_tcam_entry *entry = entry_priv;
mlxsw_sp_acl_ctcam_entry_del(mlxsw_sp, &region->aregion.cregion,
- &chunk->cchunk, &entry->centry);
+ &chunk->cchunk, &entry->aentry.centry);
}
static int