Lines Matching refs:mlxsw_sp

24 	struct mlxsw_sp *mlxsw_sp;  member
88 struct mlxsw_sp_fid *mlxsw_sp_acl_dummy_fid(struct mlxsw_sp *mlxsw_sp) in mlxsw_sp_acl_dummy_fid() argument
90 return mlxsw_sp->acl->dummy_fid; in mlxsw_sp_acl_dummy_fid()
100 int mlxsw_sp_acl_ruleset_bind(struct mlxsw_sp *mlxsw_sp, in mlxsw_sp_acl_ruleset_bind() argument
107 return ops->ruleset_bind(mlxsw_sp, ruleset->priv, in mlxsw_sp_acl_ruleset_bind()
111 void mlxsw_sp_acl_ruleset_unbind(struct mlxsw_sp *mlxsw_sp, in mlxsw_sp_acl_ruleset_unbind() argument
118 ops->ruleset_unbind(mlxsw_sp, ruleset->priv, in mlxsw_sp_acl_ruleset_unbind()
123 mlxsw_sp_acl_ruleset_block_bind(struct mlxsw_sp *mlxsw_sp, in mlxsw_sp_acl_ruleset_block_bind() argument
132 err = mlxsw_sp_acl_ruleset_bind(mlxsw_sp, block, binding); in mlxsw_sp_acl_ruleset_block_bind()
141 mlxsw_sp_acl_ruleset_unbind(mlxsw_sp, block, binding); in mlxsw_sp_acl_ruleset_block_bind()
148 mlxsw_sp_acl_ruleset_block_unbind(struct mlxsw_sp *mlxsw_sp, in mlxsw_sp_acl_ruleset_block_unbind() argument
155 mlxsw_sp_acl_ruleset_unbind(mlxsw_sp, block, binding); in mlxsw_sp_acl_ruleset_block_unbind()
160 mlxsw_sp_acl_ruleset_create(struct mlxsw_sp *mlxsw_sp, in mlxsw_sp_acl_ruleset_create() argument
165 struct mlxsw_sp_acl *acl = mlxsw_sp->acl; in mlxsw_sp_acl_ruleset_create()
183 err = ops->ruleset_add(mlxsw_sp, &acl->tcam, ruleset->priv, in mlxsw_sp_acl_ruleset_create()
197 ops->ruleset_del(mlxsw_sp, ruleset->priv); in mlxsw_sp_acl_ruleset_create()
205 static void mlxsw_sp_acl_ruleset_destroy(struct mlxsw_sp *mlxsw_sp, in mlxsw_sp_acl_ruleset_destroy() argument
209 struct mlxsw_sp_acl *acl = mlxsw_sp->acl; in mlxsw_sp_acl_ruleset_destroy()
213 ops->ruleset_del(mlxsw_sp, ruleset->priv); in mlxsw_sp_acl_ruleset_destroy()
223 static void mlxsw_sp_acl_ruleset_ref_dec(struct mlxsw_sp *mlxsw_sp, in mlxsw_sp_acl_ruleset_ref_dec() argument
228 mlxsw_sp_acl_ruleset_destroy(mlxsw_sp, ruleset); in mlxsw_sp_acl_ruleset_ref_dec()
247 mlxsw_sp_acl_ruleset_lookup(struct mlxsw_sp *mlxsw_sp, in mlxsw_sp_acl_ruleset_lookup() argument
252 struct mlxsw_sp_acl *acl = mlxsw_sp->acl; in mlxsw_sp_acl_ruleset_lookup()
255 ops = mlxsw_sp_acl_tcam_profile_ops(mlxsw_sp, profile); in mlxsw_sp_acl_ruleset_lookup()
265 mlxsw_sp_acl_ruleset_get(struct mlxsw_sp *mlxsw_sp, in mlxsw_sp_acl_ruleset_get() argument
271 struct mlxsw_sp_acl *acl = mlxsw_sp->acl; in mlxsw_sp_acl_ruleset_get()
274 ops = mlxsw_sp_acl_tcam_profile_ops(mlxsw_sp, profile); in mlxsw_sp_acl_ruleset_get()
283 return mlxsw_sp_acl_ruleset_create(mlxsw_sp, block, chain_index, ops, in mlxsw_sp_acl_ruleset_get()
287 void mlxsw_sp_acl_ruleset_put(struct mlxsw_sp *mlxsw_sp, in mlxsw_sp_acl_ruleset_put() argument
290 mlxsw_sp_acl_ruleset_ref_dec(mlxsw_sp, ruleset); in mlxsw_sp_acl_ruleset_put()
324 rulei->act_block = mlxsw_afa_block_create(acl->mlxsw_sp->afa); in mlxsw_sp_acl_rulei_create()
403 int mlxsw_sp_acl_rulei_act_fwd(struct mlxsw_sp *mlxsw_sp, in mlxsw_sp_acl_rulei_act_fwd() argument
418 if (mlxsw_sp_port->mlxsw_sp != mlxsw_sp) { in mlxsw_sp_acl_rulei_act_fwd()
435 int mlxsw_sp_acl_rulei_act_mirror(struct mlxsw_sp *mlxsw_sp, in mlxsw_sp_acl_rulei_act_mirror() argument
459 int mlxsw_sp_acl_rulei_act_vlan(struct mlxsw_sp *mlxsw_sp, in mlxsw_sp_acl_rulei_act_vlan() argument
476 dev_err(mlxsw_sp->bus_info->dev, "Unsupported VLAN protocol %#04x\n", in mlxsw_sp_acl_rulei_act_vlan()
486 dev_err(mlxsw_sp->bus_info->dev, "Unsupported VLAN action\n"); in mlxsw_sp_acl_rulei_act_vlan()
491 int mlxsw_sp_acl_rulei_act_priority(struct mlxsw_sp *mlxsw_sp, in mlxsw_sp_acl_rulei_act_priority() argument
571 mlxsw_sp_acl_rulei_act_mangle_field(struct mlxsw_sp *mlxsw_sp, in mlxsw_sp_acl_rulei_act_mangle_field() argument
591 static int mlxsw_sp1_acl_rulei_act_mangle_field(struct mlxsw_sp *mlxsw_sp, in mlxsw_sp1_acl_rulei_act_mangle_field() argument
598 err = mlxsw_sp_acl_rulei_act_mangle_field(mlxsw_sp, rulei, mact, val, extack); in mlxsw_sp1_acl_rulei_act_mangle_field()
622 static int mlxsw_sp2_acl_rulei_act_mangle_field(struct mlxsw_sp *mlxsw_sp, in mlxsw_sp2_acl_rulei_act_mangle_field() argument
629 err = mlxsw_sp_acl_rulei_act_mangle_field(mlxsw_sp, rulei, mact, val, extack); in mlxsw_sp2_acl_rulei_act_mangle_field()
701 int mlxsw_sp_acl_rulei_act_mangle(struct mlxsw_sp *mlxsw_sp, in mlxsw_sp_acl_rulei_act_mangle() argument
707 const struct mlxsw_sp_acl_rulei_ops *acl_rulei_ops = mlxsw_sp->acl_rulei_ops; in mlxsw_sp_acl_rulei_act_mangle()
717 return acl_rulei_ops->act_mangle_field(mlxsw_sp, in mlxsw_sp_acl_rulei_act_mangle()
727 int mlxsw_sp_acl_rulei_act_police(struct mlxsw_sp *mlxsw_sp, in mlxsw_sp_acl_rulei_act_police() argument
745 int mlxsw_sp_acl_rulei_act_count(struct mlxsw_sp *mlxsw_sp, in mlxsw_sp_acl_rulei_act_count() argument
759 int mlxsw_sp_acl_rulei_act_fid_set(struct mlxsw_sp *mlxsw_sp, in mlxsw_sp_acl_rulei_act_fid_set() argument
766 int mlxsw_sp_acl_rulei_act_sample(struct mlxsw_sp *mlxsw_sp, in mlxsw_sp_acl_rulei_act_sample() argument
792 mlxsw_sp_acl_rule_create(struct mlxsw_sp *mlxsw_sp, in mlxsw_sp_acl_rule_create() argument
812 rule->rulei = mlxsw_sp_acl_rulei_create(mlxsw_sp->acl, afa_block); in mlxsw_sp_acl_rule_create()
823 mlxsw_sp_acl_ruleset_ref_dec(mlxsw_sp, ruleset); in mlxsw_sp_acl_rule_create()
827 void mlxsw_sp_acl_rule_destroy(struct mlxsw_sp *mlxsw_sp, in mlxsw_sp_acl_rule_destroy() argument
834 mlxsw_sp_acl_ruleset_ref_dec(mlxsw_sp, ruleset); in mlxsw_sp_acl_rule_destroy()
837 int mlxsw_sp_acl_rule_add(struct mlxsw_sp *mlxsw_sp, in mlxsw_sp_acl_rule_add() argument
845 err = ops->rule_add(mlxsw_sp, ruleset->priv, rule->priv, rule->rulei); in mlxsw_sp_acl_rule_add()
860 err = mlxsw_sp_acl_ruleset_block_bind(mlxsw_sp, ruleset, block); in mlxsw_sp_acl_rule_add()
865 mutex_lock(&mlxsw_sp->acl->rules_lock); in mlxsw_sp_acl_rule_add()
866 list_add_tail(&rule->list, &mlxsw_sp->acl->rules); in mlxsw_sp_acl_rule_add()
867 mutex_unlock(&mlxsw_sp->acl->rules_lock); in mlxsw_sp_acl_rule_add()
877 ops->rule_del(mlxsw_sp, rule->priv); in mlxsw_sp_acl_rule_add()
881 void mlxsw_sp_acl_rule_del(struct mlxsw_sp *mlxsw_sp, in mlxsw_sp_acl_rule_del() argument
891 mutex_lock(&mlxsw_sp->acl->rules_lock); in mlxsw_sp_acl_rule_del()
893 mutex_unlock(&mlxsw_sp->acl->rules_lock); in mlxsw_sp_acl_rule_del()
896 mlxsw_sp_acl_ruleset_block_unbind(mlxsw_sp, ruleset, block); in mlxsw_sp_acl_rule_del()
899 ops->rule_del(mlxsw_sp, rule->priv); in mlxsw_sp_acl_rule_del()
902 int mlxsw_sp_acl_rule_action_replace(struct mlxsw_sp *mlxsw_sp, in mlxsw_sp_acl_rule_action_replace() argument
913 return ops->rule_action_replace(mlxsw_sp, rule->priv, rule->rulei); in mlxsw_sp_acl_rule_action_replace()
917 mlxsw_sp_acl_rule_lookup(struct mlxsw_sp *mlxsw_sp, in mlxsw_sp_acl_rule_lookup() argument
931 static int mlxsw_sp_acl_rule_activity_update(struct mlxsw_sp *mlxsw_sp, in mlxsw_sp_acl_rule_activity_update() argument
939 err = ops->rule_activity_get(mlxsw_sp, rule->priv, &active); in mlxsw_sp_acl_rule_activity_update()
954 err = mlxsw_sp_acl_rule_activity_update(acl->mlxsw_sp, in mlxsw_sp_acl_rules_activity_update()
983 dev_err(acl->mlxsw_sp->bus_info->dev, "Could not update acl activity"); in mlxsw_sp_acl_rule_activity_update_work()
988 int mlxsw_sp_acl_rule_get_stats(struct mlxsw_sp *mlxsw_sp, in mlxsw_sp_acl_rule_get_stats() argument
1004 err = mlxsw_sp_flow_counter_get(mlxsw_sp, rulei->counter_index, in mlxsw_sp_acl_rule_get_stats()
1012 err = mlxsw_sp_policer_drops_counter_get(mlxsw_sp, type, in mlxsw_sp_acl_rule_get_stats()
1030 int mlxsw_sp_acl_init(struct mlxsw_sp *mlxsw_sp) in mlxsw_sp_acl_init() argument
1037 alloc_size = sizeof(*acl) + mlxsw_sp_acl_tcam_priv_size(mlxsw_sp); in mlxsw_sp_acl_init()
1041 mlxsw_sp->acl = acl; in mlxsw_sp_acl_init()
1042 acl->mlxsw_sp = mlxsw_sp; in mlxsw_sp_acl_init()
1043 acl->afk = mlxsw_afk_create(MLXSW_CORE_RES_GET(mlxsw_sp->core, in mlxsw_sp_acl_init()
1045 mlxsw_sp->afk_ops); in mlxsw_sp_acl_init()
1056 fid = mlxsw_sp_fid_dummy_get(mlxsw_sp); in mlxsw_sp_acl_init()
1065 err = mlxsw_sp_acl_tcam_init(mlxsw_sp, &acl->tcam); in mlxsw_sp_acl_init()
1088 void mlxsw_sp_acl_fini(struct mlxsw_sp *mlxsw_sp) in mlxsw_sp_acl_fini() argument
1090 struct mlxsw_sp_acl *acl = mlxsw_sp->acl; in mlxsw_sp_acl_fini()
1092 cancel_delayed_work_sync(&mlxsw_sp->acl->rule_activity_update.dw); in mlxsw_sp_acl_fini()
1093 mlxsw_sp_acl_tcam_fini(mlxsw_sp, &acl->tcam); in mlxsw_sp_acl_fini()
1102 u32 mlxsw_sp_acl_region_rehash_intrvl_get(struct mlxsw_sp *mlxsw_sp) in mlxsw_sp_acl_region_rehash_intrvl_get() argument
1104 struct mlxsw_sp_acl *acl = mlxsw_sp->acl; in mlxsw_sp_acl_region_rehash_intrvl_get()
1106 return mlxsw_sp_acl_tcam_vregion_rehash_intrvl_get(mlxsw_sp, in mlxsw_sp_acl_region_rehash_intrvl_get()
1110 int mlxsw_sp_acl_region_rehash_intrvl_set(struct mlxsw_sp *mlxsw_sp, u32 val) in mlxsw_sp_acl_region_rehash_intrvl_set() argument
1112 struct mlxsw_sp_acl *acl = mlxsw_sp->acl; in mlxsw_sp_acl_region_rehash_intrvl_set()
1114 return mlxsw_sp_acl_tcam_vregion_rehash_intrvl_set(mlxsw_sp, in mlxsw_sp_acl_region_rehash_intrvl_set()