Lines Matching refs:block
27 struct prestera_flow_block *block; member
81 struct prestera_flow_block *block; in prestera_acl_block_create() local
83 block = kzalloc(sizeof(*block), GFP_KERNEL); in prestera_acl_block_create()
84 if (!block) in prestera_acl_block_create()
86 INIT_LIST_HEAD(&block->binding_list); in prestera_acl_block_create()
87 block->net = net; in prestera_acl_block_create()
88 block->sw = sw; in prestera_acl_block_create()
90 block->ruleset = prestera_acl_ruleset_create(sw); in prestera_acl_block_create()
91 if (IS_ERR(block->ruleset)) { in prestera_acl_block_create()
92 kfree(block); in prestera_acl_block_create()
96 return block; in prestera_acl_block_create()
99 void prestera_acl_block_destroy(struct prestera_flow_block *block) in prestera_acl_block_destroy() argument
101 prestera_acl_ruleset_destroy(block->ruleset); in prestera_acl_block_destroy()
102 WARN_ON(!list_empty(&block->binding_list)); in prestera_acl_block_destroy()
103 kfree(block); in prestera_acl_block_destroy()
107 prestera_acl_block_lookup(struct prestera_flow_block *block, in prestera_acl_block_lookup() argument
112 list_for_each_entry(binding, &block->binding_list, list) in prestera_acl_block_lookup()
119 int prestera_acl_block_bind(struct prestera_flow_block *block, in prestera_acl_block_bind() argument
125 if (WARN_ON(prestera_acl_block_lookup(block, port))) in prestera_acl_block_bind()
134 err = prestera_hw_acl_port_bind(port, block->ruleset->id); in prestera_acl_block_bind()
138 list_add(&binding->list, &block->binding_list); in prestera_acl_block_bind()
146 int prestera_acl_block_unbind(struct prestera_flow_block *block, in prestera_acl_block_unbind() argument
151 binding = prestera_acl_block_lookup(block, port); in prestera_acl_block_unbind()
157 prestera_hw_acl_port_unbind(port, block->ruleset->id); in prestera_acl_block_unbind()
164 prestera_acl_block_ruleset_get(struct prestera_flow_block *block) in prestera_acl_block_ruleset_get() argument
166 return block->ruleset; in prestera_acl_block_ruleset_get()
171 return rule->block->ruleset->id; in prestera_acl_rule_ruleset_id_get()
174 struct net *prestera_acl_block_net(struct prestera_flow_block *block) in prestera_acl_block_net() argument
176 return block->net; in prestera_acl_block_net()
179 struct prestera_switch *prestera_acl_block_sw(struct prestera_flow_block *block) in prestera_acl_block_sw() argument
181 return block->sw; in prestera_acl_block_sw()
193 prestera_acl_rule_create(struct prestera_flow_block *block, in prestera_acl_rule_create() argument
205 rule->block = block; in prestera_acl_rule_create()
303 err = rhashtable_insert_fast(&rule->block->ruleset->rule_ht, in prestera_acl_rule_add()
321 rhashtable_remove_fast(&rule->block->ruleset->rule_ht, &rule->ht_node, in prestera_acl_rule_add()
329 rhashtable_remove_fast(&rule->block->ruleset->rule_ht, &rule->ht_node, in prestera_acl_rule_del()