Lines Matching full:rule

61 	struct rhash_head ht_node; /* Member of rule HT */
799 struct mlxsw_sp_acl_rule *rule; in mlxsw_sp_acl_rule_create() local
803 rule = kzalloc(sizeof(*rule) + ops->rule_priv_size, in mlxsw_sp_acl_rule_create()
805 if (!rule) { in mlxsw_sp_acl_rule_create()
809 rule->cookie = cookie; in mlxsw_sp_acl_rule_create()
810 rule->ruleset = ruleset; in mlxsw_sp_acl_rule_create()
812 rule->rulei = mlxsw_sp_acl_rulei_create(mlxsw_sp->acl, afa_block); in mlxsw_sp_acl_rule_create()
813 if (IS_ERR(rule->rulei)) { in mlxsw_sp_acl_rule_create()
814 err = PTR_ERR(rule->rulei); in mlxsw_sp_acl_rule_create()
818 return rule; in mlxsw_sp_acl_rule_create()
821 kfree(rule); in mlxsw_sp_acl_rule_create()
828 struct mlxsw_sp_acl_rule *rule) in mlxsw_sp_acl_rule_destroy() argument
830 struct mlxsw_sp_acl_ruleset *ruleset = rule->ruleset; in mlxsw_sp_acl_rule_destroy()
832 mlxsw_sp_acl_rulei_destroy(rule->rulei); in mlxsw_sp_acl_rule_destroy()
833 kfree(rule); in mlxsw_sp_acl_rule_destroy()
838 struct mlxsw_sp_acl_rule *rule) in mlxsw_sp_acl_rule_add() argument
840 struct mlxsw_sp_acl_ruleset *ruleset = rule->ruleset; in mlxsw_sp_acl_rule_add()
845 err = ops->rule_add(mlxsw_sp, ruleset->priv, rule->priv, rule->rulei); in mlxsw_sp_acl_rule_add()
849 err = rhashtable_insert_fast(&ruleset->rule_ht, &rule->ht_node, in mlxsw_sp_acl_rule_add()
866 list_add_tail(&rule->list, &mlxsw_sp->acl->rules); in mlxsw_sp_acl_rule_add()
869 block->ingress_blocker_rule_count += rule->rulei->ingress_bind_blocker; in mlxsw_sp_acl_rule_add()
870 block->egress_blocker_rule_count += rule->rulei->egress_bind_blocker; in mlxsw_sp_acl_rule_add()
874 rhashtable_remove_fast(&ruleset->rule_ht, &rule->ht_node, in mlxsw_sp_acl_rule_add()
877 ops->rule_del(mlxsw_sp, rule->priv); in mlxsw_sp_acl_rule_add()
882 struct mlxsw_sp_acl_rule *rule) in mlxsw_sp_acl_rule_del() argument
884 struct mlxsw_sp_acl_ruleset *ruleset = rule->ruleset; in mlxsw_sp_acl_rule_del()
888 block->egress_blocker_rule_count -= rule->rulei->egress_bind_blocker; in mlxsw_sp_acl_rule_del()
889 block->ingress_blocker_rule_count -= rule->rulei->ingress_bind_blocker; in mlxsw_sp_acl_rule_del()
892 list_del(&rule->list); in mlxsw_sp_acl_rule_del()
897 rhashtable_remove_fast(&ruleset->rule_ht, &rule->ht_node, in mlxsw_sp_acl_rule_del()
899 ops->rule_del(mlxsw_sp, rule->priv); in mlxsw_sp_acl_rule_del()
903 struct mlxsw_sp_acl_rule *rule, in mlxsw_sp_acl_rule_action_replace() argument
906 struct mlxsw_sp_acl_ruleset *ruleset = rule->ruleset; in mlxsw_sp_acl_rule_action_replace()
910 rulei = mlxsw_sp_acl_rule_rulei(rule); in mlxsw_sp_acl_rule_action_replace()
913 return ops->rule_action_replace(mlxsw_sp, rule->priv, rule->rulei); in mlxsw_sp_acl_rule_action_replace()
926 mlxsw_sp_acl_rule_rulei(struct mlxsw_sp_acl_rule *rule) in mlxsw_sp_acl_rule_rulei() argument
928 return rule->rulei; in mlxsw_sp_acl_rule_rulei()
932 struct mlxsw_sp_acl_rule *rule) in mlxsw_sp_acl_rule_activity_update() argument
934 struct mlxsw_sp_acl_ruleset *ruleset = rule->ruleset; in mlxsw_sp_acl_rule_activity_update()
939 err = ops->rule_activity_get(mlxsw_sp, rule->priv, &active); in mlxsw_sp_acl_rule_activity_update()
943 rule->last_used = jiffies; in mlxsw_sp_acl_rule_activity_update()
949 struct mlxsw_sp_acl_rule *rule; in mlxsw_sp_acl_rules_activity_update() local
953 list_for_each_entry(rule, &acl->rules, list) { in mlxsw_sp_acl_rules_activity_update()
955 rule); in mlxsw_sp_acl_rules_activity_update()
989 struct mlxsw_sp_acl_rule *rule, in mlxsw_sp_acl_rule_get_stats() argument
1002 rulei = mlxsw_sp_acl_rule_rulei(rule); in mlxsw_sp_acl_rule_get_stats()
1018 *packets = current_packets - rule->last_packets; in mlxsw_sp_acl_rule_get_stats()
1019 *bytes = current_bytes - rule->last_bytes; in mlxsw_sp_acl_rule_get_stats()
1020 *drops = current_drops - rule->last_drops; in mlxsw_sp_acl_rule_get_stats()
1021 *last_use = rule->last_used; in mlxsw_sp_acl_rule_get_stats()
1023 rule->last_bytes = current_bytes; in mlxsw_sp_acl_rule_get_stats()
1024 rule->last_packets = current_packets; in mlxsw_sp_acl_rule_get_stats()
1025 rule->last_drops = current_drops; in mlxsw_sp_acl_rule_get_stats()
1069 /* Create the delayed work for the rule activity_update */ in mlxsw_sp_acl_init()