aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/mellanox/mlxsw/spectrum2_acl_tcam.c
diff options
context:
space:
mode:
authorIdo Schimmel <idosch@mellanox.com>2018-07-25 09:24:02 +0300
committerDavid S. Miller <davem@davemloft.net>2018-07-25 16:46:01 -0700
commitf58df510f899e4560c4e2d397f05a53f0d343fc0 (patch)
treeb10ba910a5488b6c9995e01ee53b87ef1556b95e /drivers/net/ethernet/mellanox/mlxsw/spectrum2_acl_tcam.c
parentmlxsw: spectrum_acl: Encapsulate C-TCAM region in A-TCAM region (diff)
downloadlinux-dev-f58df510f899e4560c4e2d397f05a53f0d343fc0.tar.xz
linux-dev-f58df510f899e4560c4e2d397f05a53f0d343fc0.zip
mlxsw: spectrum_acl: Make global TCAM resources available to regions
Each TCAM region currently uses its own resources and there is no sharing between the different regions. This is going to change with A-TCAM as each region will need to allocate an eRP table from the global eRP tables array. Make the global TCAM resources available to each region by passing the TCAM private data to the region initialization routine. 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.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum2_acl_tcam.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum2_acl_tcam.c
index 7e392529a896..bef2329bb233 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum2_acl_tcam.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum2_acl_tcam.c
@@ -130,14 +130,16 @@ static void mlxsw_sp2_acl_tcam_fini(struct mlxsw_sp *mlxsw_sp, void *priv)
static int
mlxsw_sp2_acl_tcam_region_init(struct mlxsw_sp *mlxsw_sp, void *region_priv,
+ void *tcam_priv,
struct mlxsw_sp_acl_tcam_region *_region)
{
struct mlxsw_sp2_acl_tcam_region *region = region_priv;
+ struct mlxsw_sp2_acl_tcam *tcam = tcam_priv;
region->region = _region;
- return mlxsw_sp_acl_atcam_region_init(mlxsw_sp, &region->aregion,
- _region);
+ return mlxsw_sp_acl_atcam_region_init(mlxsw_sp, &tcam->atcam,
+ &region->aregion, _region);
}
static void