Lines Matching refs:rulei
65 struct mlxsw_sp_acl_rule_info *rulei; member
312 struct mlxsw_sp_acl_rule_info *rulei; in mlxsw_sp_acl_rulei_create() local
315 rulei = kzalloc(sizeof(*rulei), GFP_KERNEL); in mlxsw_sp_acl_rulei_create()
316 if (!rulei) in mlxsw_sp_acl_rulei_create()
320 rulei->act_block = afa_block; in mlxsw_sp_acl_rulei_create()
321 return rulei; in mlxsw_sp_acl_rulei_create()
324 rulei->act_block = mlxsw_afa_block_create(acl->mlxsw_sp->afa); in mlxsw_sp_acl_rulei_create()
325 if (IS_ERR(rulei->act_block)) { in mlxsw_sp_acl_rulei_create()
326 err = PTR_ERR(rulei->act_block); in mlxsw_sp_acl_rulei_create()
329 rulei->action_created = 1; in mlxsw_sp_acl_rulei_create()
330 return rulei; in mlxsw_sp_acl_rulei_create()
333 kfree(rulei); in mlxsw_sp_acl_rulei_create()
337 void mlxsw_sp_acl_rulei_destroy(struct mlxsw_sp_acl_rule_info *rulei) in mlxsw_sp_acl_rulei_destroy() argument
339 if (rulei->action_created) in mlxsw_sp_acl_rulei_destroy()
340 mlxsw_afa_block_destroy(rulei->act_block); in mlxsw_sp_acl_rulei_destroy()
341 kfree(rulei); in mlxsw_sp_acl_rulei_destroy()
344 int mlxsw_sp_acl_rulei_commit(struct mlxsw_sp_acl_rule_info *rulei) in mlxsw_sp_acl_rulei_commit() argument
346 return mlxsw_afa_block_commit(rulei->act_block); in mlxsw_sp_acl_rulei_commit()
349 void mlxsw_sp_acl_rulei_priority(struct mlxsw_sp_acl_rule_info *rulei, in mlxsw_sp_acl_rulei_priority() argument
352 rulei->priority = priority; in mlxsw_sp_acl_rulei_priority()
355 void mlxsw_sp_acl_rulei_keymask_u32(struct mlxsw_sp_acl_rule_info *rulei, in mlxsw_sp_acl_rulei_keymask_u32() argument
359 mlxsw_afk_values_add_u32(&rulei->values, element, in mlxsw_sp_acl_rulei_keymask_u32()
363 void mlxsw_sp_acl_rulei_keymask_buf(struct mlxsw_sp_acl_rule_info *rulei, in mlxsw_sp_acl_rulei_keymask_buf() argument
368 mlxsw_afk_values_add_buf(&rulei->values, element, in mlxsw_sp_acl_rulei_keymask_buf()
372 int mlxsw_sp_acl_rulei_act_continue(struct mlxsw_sp_acl_rule_info *rulei) in mlxsw_sp_acl_rulei_act_continue() argument
374 return mlxsw_afa_block_continue(rulei->act_block); in mlxsw_sp_acl_rulei_act_continue()
377 int mlxsw_sp_acl_rulei_act_jump(struct mlxsw_sp_acl_rule_info *rulei, in mlxsw_sp_acl_rulei_act_jump() argument
380 return mlxsw_afa_block_jump(rulei->act_block, group_id); in mlxsw_sp_acl_rulei_act_jump()
383 int mlxsw_sp_acl_rulei_act_terminate(struct mlxsw_sp_acl_rule_info *rulei) in mlxsw_sp_acl_rulei_act_terminate() argument
385 return mlxsw_afa_block_terminate(rulei->act_block); in mlxsw_sp_acl_rulei_act_terminate()
388 int mlxsw_sp_acl_rulei_act_drop(struct mlxsw_sp_acl_rule_info *rulei, in mlxsw_sp_acl_rulei_act_drop() argument
393 return mlxsw_afa_block_append_drop(rulei->act_block, ingress, in mlxsw_sp_acl_rulei_act_drop()
397 int mlxsw_sp_acl_rulei_act_trap(struct mlxsw_sp_acl_rule_info *rulei) in mlxsw_sp_acl_rulei_act_trap() argument
399 return mlxsw_afa_block_append_trap(rulei->act_block, in mlxsw_sp_acl_rulei_act_trap()
404 struct mlxsw_sp_acl_rule_info *rulei, in mlxsw_sp_acl_rulei_act_fwd() argument
431 return mlxsw_afa_block_append_fwd(rulei->act_block, in mlxsw_sp_acl_rulei_act_fwd()
436 struct mlxsw_sp_acl_rule_info *rulei, in mlxsw_sp_acl_rulei_act_mirror() argument
452 return mlxsw_afa_block_append_mirror(rulei->act_block, in mlxsw_sp_acl_rulei_act_mirror()
460 struct mlxsw_sp_acl_rule_info *rulei, in mlxsw_sp_acl_rulei_act_vlan() argument
481 return mlxsw_afa_block_append_vlan_modify(rulei->act_block, in mlxsw_sp_acl_rulei_act_vlan()
492 struct mlxsw_sp_acl_rule_info *rulei, in mlxsw_sp_acl_rulei_act_priority() argument
504 return mlxsw_afa_block_append_qos_switch_prio(rulei->act_block, prio, in mlxsw_sp_acl_rulei_act_priority()
568 struct mlxsw_sp_acl_rule_info *rulei, in mlxsw_sp_acl_rulei_act_mangle_field() argument
574 return mlxsw_afa_block_append_qos_dsfield(rulei->act_block, in mlxsw_sp_acl_rulei_act_mangle_field()
577 return mlxsw_afa_block_append_qos_dscp(rulei->act_block, in mlxsw_sp_acl_rulei_act_mangle_field()
580 return mlxsw_afa_block_append_qos_ecn(rulei->act_block, in mlxsw_sp_acl_rulei_act_mangle_field()
588 struct mlxsw_sp_acl_rule_info *rulei, in mlxsw_sp1_acl_rulei_act_mangle_field() argument
594 err = mlxsw_sp_acl_rulei_act_mangle_field(mlxsw_sp, rulei, mact, val, extack); in mlxsw_sp1_acl_rulei_act_mangle_field()
603 struct mlxsw_sp_acl_rule_info *rulei, in mlxsw_sp2_acl_rulei_act_mangle_field() argument
609 err = mlxsw_sp_acl_rulei_act_mangle_field(mlxsw_sp, rulei, mact, val, extack); in mlxsw_sp2_acl_rulei_act_mangle_field()
615 return mlxsw_afa_block_append_l4port(rulei->act_block, false, val, extack); in mlxsw_sp2_acl_rulei_act_mangle_field()
617 return mlxsw_afa_block_append_l4port(rulei->act_block, true, val, extack); in mlxsw_sp2_acl_rulei_act_mangle_field()
627 struct mlxsw_sp_acl_rule_info *rulei, in mlxsw_sp_acl_rulei_act_mangle() argument
643 rulei, mact, in mlxsw_sp_acl_rulei_act_mangle()
653 struct mlxsw_sp_acl_rule_info *rulei, in mlxsw_sp_acl_rulei_act_police() argument
659 err = mlxsw_afa_block_append_police(rulei->act_block, index, in mlxsw_sp_acl_rulei_act_police()
661 &rulei->policer_index, extack); in mlxsw_sp_acl_rulei_act_police()
665 rulei->policer_index_valid = true; in mlxsw_sp_acl_rulei_act_police()
671 struct mlxsw_sp_acl_rule_info *rulei, in mlxsw_sp_acl_rulei_act_count() argument
676 err = mlxsw_afa_block_append_counter(rulei->act_block, in mlxsw_sp_acl_rulei_act_count()
677 &rulei->counter_index, extack); in mlxsw_sp_acl_rulei_act_count()
680 rulei->counter_valid = true; in mlxsw_sp_acl_rulei_act_count()
685 struct mlxsw_sp_acl_rule_info *rulei, in mlxsw_sp_acl_rulei_act_fid_set() argument
688 return mlxsw_afa_block_append_fid_set(rulei->act_block, fid, extack); in mlxsw_sp_acl_rulei_act_fid_set()
712 rule->rulei = mlxsw_sp_acl_rulei_create(mlxsw_sp->acl, afa_block); in mlxsw_sp_acl_rule_create()
713 if (IS_ERR(rule->rulei)) { in mlxsw_sp_acl_rule_create()
714 err = PTR_ERR(rule->rulei); in mlxsw_sp_acl_rule_create()
732 mlxsw_sp_acl_rulei_destroy(rule->rulei); in mlxsw_sp_acl_rule_destroy()
745 err = ops->rule_add(mlxsw_sp, ruleset->priv, rule->priv, rule->rulei); in mlxsw_sp_acl_rule_add()
769 block->ingress_blocker_rule_count += rule->rulei->ingress_bind_blocker; in mlxsw_sp_acl_rule_add()
770 block->egress_blocker_rule_count += rule->rulei->egress_bind_blocker; in mlxsw_sp_acl_rule_add()
788 block->egress_blocker_rule_count -= rule->rulei->egress_bind_blocker; in mlxsw_sp_acl_rule_del()
789 block->ingress_blocker_rule_count -= rule->rulei->ingress_bind_blocker; in mlxsw_sp_acl_rule_del()
808 struct mlxsw_sp_acl_rule_info *rulei; in mlxsw_sp_acl_rule_action_replace() local
810 rulei = mlxsw_sp_acl_rule_rulei(rule); in mlxsw_sp_acl_rule_action_replace()
811 rulei->act_block = afa_block; in mlxsw_sp_acl_rule_action_replace()
813 return ops->rule_action_replace(mlxsw_sp, rule->priv, rule->rulei); in mlxsw_sp_acl_rule_action_replace()
828 return rule->rulei; in mlxsw_sp_acl_rule_rulei()
896 struct mlxsw_sp_acl_rule_info *rulei; in mlxsw_sp_acl_rule_get_stats() local
902 rulei = mlxsw_sp_acl_rule_rulei(rule); in mlxsw_sp_acl_rule_get_stats()
903 if (rulei->counter_valid) { in mlxsw_sp_acl_rule_get_stats()
904 err = mlxsw_sp_flow_counter_get(mlxsw_sp, rulei->counter_index, in mlxsw_sp_acl_rule_get_stats()
911 if (rulei->policer_index_valid) { in mlxsw_sp_acl_rule_get_stats()
913 rulei->policer_index, in mlxsw_sp_acl_rule_get_stats()