Lines Matching refs:rule

724 	struct mlxsw_sp_acl_rule *rule;  in mlxsw_sp_acl_rule_create()  local
728 rule = kzalloc(sizeof(*rule) + ops->rule_priv_size, in mlxsw_sp_acl_rule_create()
730 if (!rule) { in mlxsw_sp_acl_rule_create()
734 rule->cookie = cookie; in mlxsw_sp_acl_rule_create()
735 rule->ruleset = ruleset; in mlxsw_sp_acl_rule_create()
737 rule->rulei = mlxsw_sp_acl_rulei_create(mlxsw_sp->acl, afa_block); in mlxsw_sp_acl_rule_create()
738 if (IS_ERR(rule->rulei)) { in mlxsw_sp_acl_rule_create()
739 err = PTR_ERR(rule->rulei); in mlxsw_sp_acl_rule_create()
743 return rule; in mlxsw_sp_acl_rule_create()
746 kfree(rule); in mlxsw_sp_acl_rule_create()
753 struct mlxsw_sp_acl_rule *rule) in mlxsw_sp_acl_rule_destroy() argument
755 struct mlxsw_sp_acl_ruleset *ruleset = rule->ruleset; in mlxsw_sp_acl_rule_destroy()
757 mlxsw_sp_acl_rulei_destroy(rule->rulei); in mlxsw_sp_acl_rule_destroy()
758 kfree(rule); in mlxsw_sp_acl_rule_destroy()
763 struct mlxsw_sp_acl_rule *rule) in mlxsw_sp_acl_rule_add() argument
765 struct mlxsw_sp_acl_ruleset *ruleset = rule->ruleset; in mlxsw_sp_acl_rule_add()
770 err = ops->rule_add(mlxsw_sp, ruleset->priv, rule->priv, rule->rulei); in mlxsw_sp_acl_rule_add()
774 err = rhashtable_insert_fast(&ruleset->rule_ht, &rule->ht_node, in mlxsw_sp_acl_rule_add()
791 list_add_tail(&rule->list, &mlxsw_sp->acl->rules); in mlxsw_sp_acl_rule_add()
794 block->ingress_blocker_rule_count += rule->rulei->ingress_bind_blocker; in mlxsw_sp_acl_rule_add()
795 block->egress_blocker_rule_count += rule->rulei->egress_bind_blocker; in mlxsw_sp_acl_rule_add()
799 rhashtable_remove_fast(&ruleset->rule_ht, &rule->ht_node, in mlxsw_sp_acl_rule_add()
802 ops->rule_del(mlxsw_sp, rule->priv); in mlxsw_sp_acl_rule_add()
807 struct mlxsw_sp_acl_rule *rule) in mlxsw_sp_acl_rule_del() argument
809 struct mlxsw_sp_acl_ruleset *ruleset = rule->ruleset; in mlxsw_sp_acl_rule_del()
813 block->egress_blocker_rule_count -= rule->rulei->egress_bind_blocker; in mlxsw_sp_acl_rule_del()
814 block->ingress_blocker_rule_count -= rule->rulei->ingress_bind_blocker; in mlxsw_sp_acl_rule_del()
817 list_del(&rule->list); in mlxsw_sp_acl_rule_del()
822 rhashtable_remove_fast(&ruleset->rule_ht, &rule->ht_node, in mlxsw_sp_acl_rule_del()
824 ops->rule_del(mlxsw_sp, rule->priv); in mlxsw_sp_acl_rule_del()
828 struct mlxsw_sp_acl_rule *rule, in mlxsw_sp_acl_rule_action_replace() argument
831 struct mlxsw_sp_acl_ruleset *ruleset = rule->ruleset; in mlxsw_sp_acl_rule_action_replace()
835 rulei = mlxsw_sp_acl_rule_rulei(rule); in mlxsw_sp_acl_rule_action_replace()
838 return ops->rule_action_replace(mlxsw_sp, rule->priv, rule->rulei); in mlxsw_sp_acl_rule_action_replace()
851 mlxsw_sp_acl_rule_rulei(struct mlxsw_sp_acl_rule *rule) in mlxsw_sp_acl_rule_rulei() argument
853 return rule->rulei; in mlxsw_sp_acl_rule_rulei()
857 struct mlxsw_sp_acl_rule *rule) in mlxsw_sp_acl_rule_activity_update() argument
859 struct mlxsw_sp_acl_ruleset *ruleset = rule->ruleset; in mlxsw_sp_acl_rule_activity_update()
864 err = ops->rule_activity_get(mlxsw_sp, rule->priv, &active); in mlxsw_sp_acl_rule_activity_update()
868 rule->last_used = jiffies; in mlxsw_sp_acl_rule_activity_update()
874 struct mlxsw_sp_acl_rule *rule; in mlxsw_sp_acl_rules_activity_update() local
878 list_for_each_entry(rule, &acl->rules, list) { in mlxsw_sp_acl_rules_activity_update()
880 rule); in mlxsw_sp_acl_rules_activity_update()
914 struct mlxsw_sp_acl_rule *rule, in mlxsw_sp_acl_rule_get_stats() argument
927 rulei = mlxsw_sp_acl_rule_rulei(rule); in mlxsw_sp_acl_rule_get_stats()
943 *packets = current_packets - rule->last_packets; in mlxsw_sp_acl_rule_get_stats()
944 *bytes = current_bytes - rule->last_bytes; in mlxsw_sp_acl_rule_get_stats()
945 *drops = current_drops - rule->last_drops; in mlxsw_sp_acl_rule_get_stats()
946 *last_use = rule->last_used; in mlxsw_sp_acl_rule_get_stats()
948 rule->last_bytes = current_bytes; in mlxsw_sp_acl_rule_get_stats()
949 rule->last_packets = current_packets; in mlxsw_sp_acl_rule_get_stats()
950 rule->last_drops = current_drops; in mlxsw_sp_acl_rule_get_stats()