bool vregion_rehash_enabled;
};
+struct mlxsw_sp_acl_tcam_rehash_ctx {
+ void *hints_priv;
+};
+
struct mlxsw_sp_acl_tcam_vregion {
struct mutex lock; /* Protects consistency of region, region2 pointers
* and vchunk_list.
struct mlxsw_sp_acl_tcam_vgroup *vgroup;
struct {
struct delayed_work dw;
+ struct mlxsw_sp_acl_tcam_rehash_ctx ctx;
} rehash;
struct mlxsw_sp *mlxsw_sp;
bool failed_rollback; /* Indicates failed rollback during migration */
static int
mlxsw_sp_acl_tcam_vregion_migrate(struct mlxsw_sp *mlxsw_sp,
struct mlxsw_sp_acl_tcam_vregion *vregion,
- void *hints_priv)
+ struct mlxsw_sp_acl_tcam_rehash_ctx *ctx)
{
unsigned int priority = mlxsw_sp_acl_tcam_vregion_prio(vregion);
struct mlxsw_sp_acl_tcam_region *region2, *unused_region;
trace_mlxsw_sp_acl_tcam_vregion_migrate(mlxsw_sp, vregion);
region2 = mlxsw_sp_acl_tcam_region_create(mlxsw_sp, vregion->tcam,
- vregion, hints_priv);
+ vregion, ctx->hints_priv);
if (IS_ERR(region2)) {
err = PTR_ERR(region2);
goto out;
struct mlxsw_sp_acl_tcam_vregion *vregion)
{
const struct mlxsw_sp_acl_tcam_ops *ops = mlxsw_sp->acl_tcam_ops;
+ struct mlxsw_sp_acl_tcam_rehash_ctx *ctx = &vregion->rehash.ctx;
void *hints_priv;
int err;
dev_err(mlxsw_sp->bus_info->dev, "Failed get rehash hints\n");
return err;
}
+ ctx->hints_priv = hints_priv;
- err = mlxsw_sp_acl_tcam_vregion_migrate(mlxsw_sp, vregion, hints_priv);
+ err = mlxsw_sp_acl_tcam_vregion_migrate(mlxsw_sp, vregion, ctx);
if (err) {
dev_err(mlxsw_sp->bus_info->dev, "Failed to migrate vregion\n");
if (vregion->failed_rollback) {
}
}
- ops->region_rehash_hints_put(hints_priv);
+ ops->region_rehash_hints_put(ctx->hints_priv);
+ ctx->hints_priv = NULL;
return err;
}