Lines Matching refs:mlxsw_sp
23 struct mlxsw_sp *mlxsw_sp; member
51 struct mlxsw_sp *mlxsw_sp; member
98 struct mlxsw_sp_fid *mlxsw_sp_acl_dummy_fid(struct mlxsw_sp *mlxsw_sp) in mlxsw_sp_acl_dummy_fid() argument
100 return mlxsw_sp->acl->dummy_fid; in mlxsw_sp_acl_dummy_fid()
103 struct mlxsw_sp *mlxsw_sp_acl_block_mlxsw_sp(struct mlxsw_sp_acl_block *block) in mlxsw_sp_acl_block_mlxsw_sp()
105 return block->mlxsw_sp; in mlxsw_sp_acl_block_mlxsw_sp()
149 mlxsw_sp_acl_ruleset_bind(struct mlxsw_sp *mlxsw_sp, in mlxsw_sp_acl_ruleset_bind() argument
156 return ops->ruleset_bind(mlxsw_sp, ruleset->priv, in mlxsw_sp_acl_ruleset_bind()
161 mlxsw_sp_acl_ruleset_unbind(struct mlxsw_sp *mlxsw_sp, in mlxsw_sp_acl_ruleset_unbind() argument
168 ops->ruleset_unbind(mlxsw_sp, ruleset->priv, in mlxsw_sp_acl_ruleset_unbind()
178 mlxsw_sp_acl_ruleset_block_bind(struct mlxsw_sp *mlxsw_sp, in mlxsw_sp_acl_ruleset_block_bind() argument
187 err = mlxsw_sp_acl_ruleset_bind(mlxsw_sp, block, binding); in mlxsw_sp_acl_ruleset_block_bind()
196 mlxsw_sp_acl_ruleset_unbind(mlxsw_sp, block, binding); in mlxsw_sp_acl_ruleset_block_bind()
203 mlxsw_sp_acl_ruleset_block_unbind(struct mlxsw_sp *mlxsw_sp, in mlxsw_sp_acl_ruleset_block_unbind() argument
210 mlxsw_sp_acl_ruleset_unbind(mlxsw_sp, block, binding); in mlxsw_sp_acl_ruleset_block_unbind()
214 struct mlxsw_sp_acl_block *mlxsw_sp_acl_block_create(struct mlxsw_sp *mlxsw_sp, in mlxsw_sp_acl_block_create() argument
223 block->mlxsw_sp = mlxsw_sp; in mlxsw_sp_acl_block_create()
246 int mlxsw_sp_acl_block_bind(struct mlxsw_sp *mlxsw_sp, in mlxsw_sp_acl_block_bind() argument
264 err = mlxsw_sp_acl_ruleset_bind(mlxsw_sp, block, binding); in mlxsw_sp_acl_block_bind()
277 int mlxsw_sp_acl_block_unbind(struct mlxsw_sp *mlxsw_sp, in mlxsw_sp_acl_block_unbind() argument
291 mlxsw_sp_acl_ruleset_unbind(mlxsw_sp, block, binding); in mlxsw_sp_acl_block_unbind()
298 mlxsw_sp_acl_ruleset_create(struct mlxsw_sp *mlxsw_sp, in mlxsw_sp_acl_ruleset_create() argument
303 struct mlxsw_sp_acl *acl = mlxsw_sp->acl; in mlxsw_sp_acl_ruleset_create()
321 err = ops->ruleset_add(mlxsw_sp, &acl->tcam, ruleset->priv, in mlxsw_sp_acl_ruleset_create()
334 ops->ruleset_del(mlxsw_sp, ruleset->priv); in mlxsw_sp_acl_ruleset_create()
342 static void mlxsw_sp_acl_ruleset_destroy(struct mlxsw_sp *mlxsw_sp, in mlxsw_sp_acl_ruleset_destroy() argument
346 struct mlxsw_sp_acl *acl = mlxsw_sp->acl; in mlxsw_sp_acl_ruleset_destroy()
350 ops->ruleset_del(mlxsw_sp, ruleset->priv); in mlxsw_sp_acl_ruleset_destroy()
360 static void mlxsw_sp_acl_ruleset_ref_dec(struct mlxsw_sp *mlxsw_sp, in mlxsw_sp_acl_ruleset_ref_dec() argument
365 mlxsw_sp_acl_ruleset_destroy(mlxsw_sp, ruleset); in mlxsw_sp_acl_ruleset_ref_dec()
384 mlxsw_sp_acl_ruleset_lookup(struct mlxsw_sp *mlxsw_sp, in mlxsw_sp_acl_ruleset_lookup() argument
389 struct mlxsw_sp_acl *acl = mlxsw_sp->acl; in mlxsw_sp_acl_ruleset_lookup()
392 ops = mlxsw_sp_acl_tcam_profile_ops(mlxsw_sp, profile); in mlxsw_sp_acl_ruleset_lookup()
402 mlxsw_sp_acl_ruleset_get(struct mlxsw_sp *mlxsw_sp, in mlxsw_sp_acl_ruleset_get() argument
408 struct mlxsw_sp_acl *acl = mlxsw_sp->acl; in mlxsw_sp_acl_ruleset_get()
411 ops = mlxsw_sp_acl_tcam_profile_ops(mlxsw_sp, profile); in mlxsw_sp_acl_ruleset_get()
420 return mlxsw_sp_acl_ruleset_create(mlxsw_sp, block, chain_index, ops, in mlxsw_sp_acl_ruleset_get()
424 void mlxsw_sp_acl_ruleset_put(struct mlxsw_sp *mlxsw_sp, in mlxsw_sp_acl_ruleset_put() argument
427 mlxsw_sp_acl_ruleset_ref_dec(mlxsw_sp, ruleset); in mlxsw_sp_acl_ruleset_put()
446 rulei->act_block = mlxsw_afa_block_create(acl->mlxsw_sp->afa); in mlxsw_sp_acl_rulei_create()
519 int mlxsw_sp_acl_rulei_act_fwd(struct mlxsw_sp *mlxsw_sp, in mlxsw_sp_acl_rulei_act_fwd() argument
534 if (mlxsw_sp_port->mlxsw_sp != mlxsw_sp) { in mlxsw_sp_acl_rulei_act_fwd()
551 int mlxsw_sp_acl_rulei_act_mirror(struct mlxsw_sp *mlxsw_sp, in mlxsw_sp_acl_rulei_act_mirror() argument
575 int mlxsw_sp_acl_rulei_act_vlan(struct mlxsw_sp *mlxsw_sp, in mlxsw_sp_acl_rulei_act_vlan() argument
592 dev_err(mlxsw_sp->bus_info->dev, "Unsupported VLAN protocol %#04x\n", in mlxsw_sp_acl_rulei_act_vlan()
602 dev_err(mlxsw_sp->bus_info->dev, "Unsupported VLAN action\n"); in mlxsw_sp_acl_rulei_act_vlan()
607 int mlxsw_sp_acl_rulei_act_count(struct mlxsw_sp *mlxsw_sp, in mlxsw_sp_acl_rulei_act_count() argument
615 int mlxsw_sp_acl_rulei_act_fid_set(struct mlxsw_sp *mlxsw_sp, in mlxsw_sp_acl_rulei_act_fid_set() argument
623 mlxsw_sp_acl_rule_create(struct mlxsw_sp *mlxsw_sp, in mlxsw_sp_acl_rule_create() argument
633 rule = kzalloc(sizeof(*rule) + ops->rule_priv_size(mlxsw_sp), in mlxsw_sp_acl_rule_create()
642 rule->rulei = mlxsw_sp_acl_rulei_create(mlxsw_sp->acl); in mlxsw_sp_acl_rule_create()
653 mlxsw_sp_acl_ruleset_ref_dec(mlxsw_sp, ruleset); in mlxsw_sp_acl_rule_create()
657 void mlxsw_sp_acl_rule_destroy(struct mlxsw_sp *mlxsw_sp, in mlxsw_sp_acl_rule_destroy() argument
664 mlxsw_sp_acl_ruleset_ref_dec(mlxsw_sp, ruleset); in mlxsw_sp_acl_rule_destroy()
667 int mlxsw_sp_acl_rule_add(struct mlxsw_sp *mlxsw_sp, in mlxsw_sp_acl_rule_add() argument
674 err = ops->rule_add(mlxsw_sp, ruleset->priv, rule->priv, rule->rulei); in mlxsw_sp_acl_rule_add()
689 err = mlxsw_sp_acl_ruleset_block_bind(mlxsw_sp, ruleset, in mlxsw_sp_acl_rule_add()
695 list_add_tail(&rule->list, &mlxsw_sp->acl->rules); in mlxsw_sp_acl_rule_add()
703 ops->rule_del(mlxsw_sp, rule->priv); in mlxsw_sp_acl_rule_add()
707 void mlxsw_sp_acl_rule_del(struct mlxsw_sp *mlxsw_sp, in mlxsw_sp_acl_rule_del() argument
717 mlxsw_sp_acl_ruleset_block_unbind(mlxsw_sp, ruleset, in mlxsw_sp_acl_rule_del()
721 ops->rule_del(mlxsw_sp, rule->priv); in mlxsw_sp_acl_rule_del()
725 mlxsw_sp_acl_rule_lookup(struct mlxsw_sp *mlxsw_sp, in mlxsw_sp_acl_rule_lookup() argument
739 static int mlxsw_sp_acl_rule_activity_update(struct mlxsw_sp *mlxsw_sp, in mlxsw_sp_acl_rule_activity_update() argument
747 err = ops->rule_activity_get(mlxsw_sp, rule->priv, &active); in mlxsw_sp_acl_rule_activity_update()
763 err = mlxsw_sp_acl_rule_activity_update(acl->mlxsw_sp, in mlxsw_sp_acl_rules_activity_update()
792 dev_err(acl->mlxsw_sp->bus_info->dev, "Could not update acl activity"); in mlxsw_sp_acl_rul_activity_update_work()
797 int mlxsw_sp_acl_rule_get_stats(struct mlxsw_sp *mlxsw_sp, in mlxsw_sp_acl_rule_get_stats() argument
808 err = mlxsw_sp_flow_counter_get(mlxsw_sp, rulei->counter_index, in mlxsw_sp_acl_rule_get_stats()
823 int mlxsw_sp_acl_init(struct mlxsw_sp *mlxsw_sp) in mlxsw_sp_acl_init() argument
830 alloc_size = sizeof(*acl) + mlxsw_sp_acl_tcam_priv_size(mlxsw_sp); in mlxsw_sp_acl_init()
834 mlxsw_sp->acl = acl; in mlxsw_sp_acl_init()
835 acl->mlxsw_sp = mlxsw_sp; in mlxsw_sp_acl_init()
836 acl->afk = mlxsw_afk_create(MLXSW_CORE_RES_GET(mlxsw_sp->core, in mlxsw_sp_acl_init()
838 mlxsw_sp->afk_ops); in mlxsw_sp_acl_init()
849 fid = mlxsw_sp_fid_dummy_get(mlxsw_sp); in mlxsw_sp_acl_init()
857 err = mlxsw_sp_acl_tcam_init(mlxsw_sp, &acl->tcam); in mlxsw_sp_acl_init()
879 void mlxsw_sp_acl_fini(struct mlxsw_sp *mlxsw_sp) in mlxsw_sp_acl_fini() argument
881 struct mlxsw_sp_acl *acl = mlxsw_sp->acl; in mlxsw_sp_acl_fini()
883 cancel_delayed_work_sync(&mlxsw_sp->acl->rule_activity_update.dw); in mlxsw_sp_acl_fini()
884 mlxsw_sp_acl_tcam_fini(mlxsw_sp, &acl->tcam); in mlxsw_sp_acl_fini()