Lines Matching refs:rulei
68 struct mlxsw_sp_acl_rule_info *rulei; member
440 struct mlxsw_sp_acl_rule_info *rulei; in mlxsw_sp_acl_rulei_create() local
443 rulei = kzalloc(sizeof(*rulei), GFP_KERNEL); in mlxsw_sp_acl_rulei_create()
444 if (!rulei) in mlxsw_sp_acl_rulei_create()
448 rulei->act_block = afa_block; in mlxsw_sp_acl_rulei_create()
449 return rulei; in mlxsw_sp_acl_rulei_create()
452 rulei->act_block = mlxsw_afa_block_create(acl->mlxsw_sp->afa); in mlxsw_sp_acl_rulei_create()
453 if (IS_ERR(rulei->act_block)) { in mlxsw_sp_acl_rulei_create()
454 err = PTR_ERR(rulei->act_block); in mlxsw_sp_acl_rulei_create()
457 rulei->action_created = 1; in mlxsw_sp_acl_rulei_create()
458 return rulei; in mlxsw_sp_acl_rulei_create()
461 kfree(rulei); in mlxsw_sp_acl_rulei_create()
465 void mlxsw_sp_acl_rulei_destroy(struct mlxsw_sp_acl_rule_info *rulei) in mlxsw_sp_acl_rulei_destroy() argument
467 if (rulei->action_created) in mlxsw_sp_acl_rulei_destroy()
468 mlxsw_afa_block_destroy(rulei->act_block); in mlxsw_sp_acl_rulei_destroy()
469 kfree(rulei); in mlxsw_sp_acl_rulei_destroy()
472 int mlxsw_sp_acl_rulei_commit(struct mlxsw_sp_acl_rule_info *rulei) in mlxsw_sp_acl_rulei_commit() argument
474 return mlxsw_afa_block_commit(rulei->act_block); in mlxsw_sp_acl_rulei_commit()
477 void mlxsw_sp_acl_rulei_priority(struct mlxsw_sp_acl_rule_info *rulei, in mlxsw_sp_acl_rulei_priority() argument
480 rulei->priority = priority; in mlxsw_sp_acl_rulei_priority()
483 void mlxsw_sp_acl_rulei_keymask_u32(struct mlxsw_sp_acl_rule_info *rulei, in mlxsw_sp_acl_rulei_keymask_u32() argument
487 mlxsw_afk_values_add_u32(&rulei->values, element, in mlxsw_sp_acl_rulei_keymask_u32()
491 void mlxsw_sp_acl_rulei_keymask_buf(struct mlxsw_sp_acl_rule_info *rulei, in mlxsw_sp_acl_rulei_keymask_buf() argument
496 mlxsw_afk_values_add_buf(&rulei->values, element, in mlxsw_sp_acl_rulei_keymask_buf()
500 int mlxsw_sp_acl_rulei_act_continue(struct mlxsw_sp_acl_rule_info *rulei) in mlxsw_sp_acl_rulei_act_continue() argument
502 return mlxsw_afa_block_continue(rulei->act_block); in mlxsw_sp_acl_rulei_act_continue()
505 int mlxsw_sp_acl_rulei_act_jump(struct mlxsw_sp_acl_rule_info *rulei, in mlxsw_sp_acl_rulei_act_jump() argument
508 return mlxsw_afa_block_jump(rulei->act_block, group_id); in mlxsw_sp_acl_rulei_act_jump()
511 int mlxsw_sp_acl_rulei_act_terminate(struct mlxsw_sp_acl_rule_info *rulei) in mlxsw_sp_acl_rulei_act_terminate() argument
513 return mlxsw_afa_block_terminate(rulei->act_block); in mlxsw_sp_acl_rulei_act_terminate()
516 int mlxsw_sp_acl_rulei_act_drop(struct mlxsw_sp_acl_rule_info *rulei) in mlxsw_sp_acl_rulei_act_drop() argument
518 return mlxsw_afa_block_append_drop(rulei->act_block); in mlxsw_sp_acl_rulei_act_drop()
521 int mlxsw_sp_acl_rulei_act_trap(struct mlxsw_sp_acl_rule_info *rulei) in mlxsw_sp_acl_rulei_act_trap() argument
523 return mlxsw_afa_block_append_trap(rulei->act_block, in mlxsw_sp_acl_rulei_act_trap()
528 struct mlxsw_sp_acl_rule_info *rulei, in mlxsw_sp_acl_rulei_act_fwd() argument
555 return mlxsw_afa_block_append_fwd(rulei->act_block, in mlxsw_sp_acl_rulei_act_fwd()
560 struct mlxsw_sp_acl_rule_info *rulei, in mlxsw_sp_acl_rulei_act_mirror() argument
576 return mlxsw_afa_block_append_mirror(rulei->act_block, in mlxsw_sp_acl_rulei_act_mirror()
584 struct mlxsw_sp_acl_rule_info *rulei, in mlxsw_sp_acl_rulei_act_vlan() argument
605 return mlxsw_afa_block_append_vlan_modify(rulei->act_block, in mlxsw_sp_acl_rulei_act_vlan()
616 struct mlxsw_sp_acl_rule_info *rulei, in mlxsw_sp_acl_rulei_act_count() argument
619 return mlxsw_afa_block_append_counter(rulei->act_block, in mlxsw_sp_acl_rulei_act_count()
620 &rulei->counter_index, extack); in mlxsw_sp_acl_rulei_act_count()
624 struct mlxsw_sp_acl_rule_info *rulei, in mlxsw_sp_acl_rulei_act_fid_set() argument
627 return mlxsw_afa_block_append_fid_set(rulei->act_block, fid, extack); in mlxsw_sp_acl_rulei_act_fid_set()
651 rule->rulei = mlxsw_sp_acl_rulei_create(mlxsw_sp->acl, afa_block); in mlxsw_sp_acl_rule_create()
652 if (IS_ERR(rule->rulei)) { in mlxsw_sp_acl_rule_create()
653 err = PTR_ERR(rule->rulei); in mlxsw_sp_acl_rule_create()
671 mlxsw_sp_acl_rulei_destroy(rule->rulei); in mlxsw_sp_acl_rule_destroy()
684 err = ops->rule_add(mlxsw_sp, ruleset->priv, rule->priv, rule->rulei); in mlxsw_sp_acl_rule_add()
706 block->egress_blocker_rule_count += rule->rulei->egress_bind_blocker; in mlxsw_sp_acl_rule_add()
724 block->egress_blocker_rule_count -= rule->rulei->egress_bind_blocker; in mlxsw_sp_acl_rule_del()
742 struct mlxsw_sp_acl_rule_info *rulei; in mlxsw_sp_acl_rule_action_replace() local
744 rulei = mlxsw_sp_acl_rule_rulei(rule); in mlxsw_sp_acl_rule_action_replace()
745 rulei->act_block = afa_block; in mlxsw_sp_acl_rule_action_replace()
747 return ops->rule_action_replace(mlxsw_sp, rule->priv, rule->rulei); in mlxsw_sp_acl_rule_action_replace()
762 return rule->rulei; in mlxsw_sp_acl_rule_rulei()
828 struct mlxsw_sp_acl_rule_info *rulei; in mlxsw_sp_acl_rule_get_stats() local
833 rulei = mlxsw_sp_acl_rule_rulei(rule); in mlxsw_sp_acl_rule_get_stats()
834 err = mlxsw_sp_flow_counter_get(mlxsw_sp, rulei->counter_index, in mlxsw_sp_acl_rule_get_stats()