Lines Matching full:rule

61 	struct rhash_head ht_node; /* Member of rule HT */
699 struct mlxsw_sp_acl_rule *rule; in mlxsw_sp_acl_rule_create() local
703 rule = kzalloc(sizeof(*rule) + ops->rule_priv_size, in mlxsw_sp_acl_rule_create()
705 if (!rule) { in mlxsw_sp_acl_rule_create()
709 rule->cookie = cookie; in mlxsw_sp_acl_rule_create()
710 rule->ruleset = ruleset; in mlxsw_sp_acl_rule_create()
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()
718 return rule; in mlxsw_sp_acl_rule_create()
721 kfree(rule); in mlxsw_sp_acl_rule_create()
728 struct mlxsw_sp_acl_rule *rule) in mlxsw_sp_acl_rule_destroy() argument
730 struct mlxsw_sp_acl_ruleset *ruleset = rule->ruleset; in mlxsw_sp_acl_rule_destroy()
732 mlxsw_sp_acl_rulei_destroy(rule->rulei); in mlxsw_sp_acl_rule_destroy()
733 kfree(rule); in mlxsw_sp_acl_rule_destroy()
738 struct mlxsw_sp_acl_rule *rule) in mlxsw_sp_acl_rule_add() argument
740 struct mlxsw_sp_acl_ruleset *ruleset = rule->ruleset; in mlxsw_sp_acl_rule_add()
745 err = ops->rule_add(mlxsw_sp, ruleset->priv, rule->priv, rule->rulei); in mlxsw_sp_acl_rule_add()
749 err = rhashtable_insert_fast(&ruleset->rule_ht, &rule->ht_node, in mlxsw_sp_acl_rule_add()
766 list_add_tail(&rule->list, &mlxsw_sp->acl->rules); 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()
774 rhashtable_remove_fast(&ruleset->rule_ht, &rule->ht_node, in mlxsw_sp_acl_rule_add()
777 ops->rule_del(mlxsw_sp, rule->priv); in mlxsw_sp_acl_rule_add()
782 struct mlxsw_sp_acl_rule *rule) in mlxsw_sp_acl_rule_del() argument
784 struct mlxsw_sp_acl_ruleset *ruleset = rule->ruleset; in mlxsw_sp_acl_rule_del()
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()
792 list_del(&rule->list); in mlxsw_sp_acl_rule_del()
797 rhashtable_remove_fast(&ruleset->rule_ht, &rule->ht_node, in mlxsw_sp_acl_rule_del()
799 ops->rule_del(mlxsw_sp, rule->priv); in mlxsw_sp_acl_rule_del()
803 struct mlxsw_sp_acl_rule *rule, in mlxsw_sp_acl_rule_action_replace() argument
806 struct mlxsw_sp_acl_ruleset *ruleset = rule->ruleset; in mlxsw_sp_acl_rule_action_replace()
810 rulei = mlxsw_sp_acl_rule_rulei(rule); 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()
826 mlxsw_sp_acl_rule_rulei(struct mlxsw_sp_acl_rule *rule) in mlxsw_sp_acl_rule_rulei() argument
828 return rule->rulei; in mlxsw_sp_acl_rule_rulei()
832 struct mlxsw_sp_acl_rule *rule) in mlxsw_sp_acl_rule_activity_update() argument
834 struct mlxsw_sp_acl_ruleset *ruleset = rule->ruleset; in mlxsw_sp_acl_rule_activity_update()
839 err = ops->rule_activity_get(mlxsw_sp, rule->priv, &active); in mlxsw_sp_acl_rule_activity_update()
843 rule->last_used = jiffies; in mlxsw_sp_acl_rule_activity_update()
849 struct mlxsw_sp_acl_rule *rule; in mlxsw_sp_acl_rules_activity_update() local
853 list_for_each_entry(rule, &acl->rules, list) { in mlxsw_sp_acl_rules_activity_update()
855 rule); in mlxsw_sp_acl_rules_activity_update()
889 struct mlxsw_sp_acl_rule *rule, in mlxsw_sp_acl_rule_get_stats() argument
902 rulei = mlxsw_sp_acl_rule_rulei(rule); in mlxsw_sp_acl_rule_get_stats()
918 *packets = current_packets - rule->last_packets; in mlxsw_sp_acl_rule_get_stats()
919 *bytes = current_bytes - rule->last_bytes; in mlxsw_sp_acl_rule_get_stats()
920 *drops = current_drops - rule->last_drops; in mlxsw_sp_acl_rule_get_stats()
921 *last_use = rule->last_used; in mlxsw_sp_acl_rule_get_stats()
923 rule->last_bytes = current_bytes; in mlxsw_sp_acl_rule_get_stats()
924 rule->last_packets = current_packets; in mlxsw_sp_acl_rule_get_stats()
925 rule->last_drops = current_drops; in mlxsw_sp_acl_rule_get_stats()
969 /* Create the delayed work for the rule activity_update */ in mlxsw_sp_acl_init()