Lines Matching refs:block

160 dpaa2_switch_acl_entry_remove(struct dpaa2_switch_filter_block *block,  in dpaa2_switch_acl_entry_remove()  argument
165 struct ethsw_core *ethsw = block->ethsw; in dpaa2_switch_acl_entry_remove()
186 block->acl_id, acl_entry_cfg); in dpaa2_switch_acl_entry_remove()
202 dpaa2_switch_acl_entry_add_to_list(struct dpaa2_switch_filter_block *block, in dpaa2_switch_acl_entry_add_to_list() argument
209 if (list_empty(&block->acl_entries)) { in dpaa2_switch_acl_entry_add_to_list()
210 list_add(&entry->list, &block->acl_entries); in dpaa2_switch_acl_entry_add_to_list()
214 list_for_each_safe(pos, n, &block->acl_entries) { in dpaa2_switch_acl_entry_add_to_list()
225 dpaa2_switch_acl_entry_get_by_index(struct dpaa2_switch_filter_block *block, in dpaa2_switch_acl_entry_get_by_index() argument
231 list_for_each_entry(tmp, &block->acl_entries, list) { in dpaa2_switch_acl_entry_get_by_index()
241 dpaa2_switch_acl_entry_set_precedence(struct dpaa2_switch_filter_block *block, in dpaa2_switch_acl_entry_set_precedence() argument
247 err = dpaa2_switch_acl_entry_remove(block, entry); in dpaa2_switch_acl_entry_set_precedence()
252 return dpaa2_switch_acl_entry_add(block, entry); in dpaa2_switch_acl_entry_set_precedence()
256 dpaa2_switch_acl_tbl_add_entry(struct dpaa2_switch_filter_block *block, in dpaa2_switch_acl_tbl_add_entry() argument
263 index = dpaa2_switch_acl_entry_add_to_list(block, entry); in dpaa2_switch_acl_tbl_add_entry()
268 precedence = DPAA2_ETHSW_PORT_MAX_ACL_ENTRIES - block->num_acl_rules - 1; in dpaa2_switch_acl_tbl_add_entry()
270 tmp = dpaa2_switch_acl_entry_get_by_index(block, i); in dpaa2_switch_acl_tbl_add_entry()
272 err = dpaa2_switch_acl_entry_set_precedence(block, tmp, in dpaa2_switch_acl_tbl_add_entry()
282 err = dpaa2_switch_acl_entry_add(block, entry); in dpaa2_switch_acl_tbl_add_entry()
283 block->num_acl_rules++; in dpaa2_switch_acl_tbl_add_entry()
289 dpaa2_switch_acl_tbl_find_entry_by_cookie(struct dpaa2_switch_filter_block *block, in dpaa2_switch_acl_tbl_find_entry_by_cookie() argument
294 list_for_each_entry_safe(tmp, n, &block->acl_entries, list) { in dpaa2_switch_acl_tbl_find_entry_by_cookie()
302 dpaa2_switch_acl_entry_get_index(struct dpaa2_switch_filter_block *block, in dpaa2_switch_acl_entry_get_index() argument
308 list_for_each_entry_safe(tmp, n, &block->acl_entries, list) { in dpaa2_switch_acl_entry_get_index()
317 dpaa2_switch_mirror_find_entry_by_cookie(struct dpaa2_switch_filter_block *block, in dpaa2_switch_mirror_find_entry_by_cookie() argument
322 list_for_each_entry_safe(tmp, n, &block->mirror_entries, list) { in dpaa2_switch_mirror_find_entry_by_cookie()
330 dpaa2_switch_acl_tbl_remove_entry(struct dpaa2_switch_filter_block *block, in dpaa2_switch_acl_tbl_remove_entry() argument
336 index = dpaa2_switch_acl_entry_get_index(block, entry); in dpaa2_switch_acl_tbl_remove_entry()
339 err = dpaa2_switch_acl_entry_remove(block, entry); in dpaa2_switch_acl_tbl_remove_entry()
343 block->num_acl_rules--; in dpaa2_switch_acl_tbl_remove_entry()
351 tmp = dpaa2_switch_acl_entry_get_by_index(block, i); in dpaa2_switch_acl_tbl_remove_entry()
352 err = dpaa2_switch_acl_entry_set_precedence(block, tmp, in dpaa2_switch_acl_tbl_remove_entry()
401 dpaa2_switch_block_add_mirror(struct dpaa2_switch_filter_block *block, in dpaa2_switch_block_add_mirror() argument
405 unsigned long block_ports = block->ports; in dpaa2_switch_block_add_mirror()
406 struct ethsw_core *ethsw = block->ethsw; in dpaa2_switch_block_add_mirror()
449 list_add(&entry->list, &block->mirror_entries); in dpaa2_switch_block_add_mirror()
466 dpaa2_switch_block_remove_mirror(struct dpaa2_switch_filter_block *block, in dpaa2_switch_block_remove_mirror() argument
470 unsigned long block_ports = block->ports; in dpaa2_switch_block_remove_mirror()
471 struct ethsw_core *ethsw = block->ethsw; in dpaa2_switch_block_remove_mirror()
486 if (list_empty(&block->mirror_entries)) in dpaa2_switch_block_remove_mirror()
493 dpaa2_switch_cls_flower_replace_acl(struct dpaa2_switch_filter_block *block, in dpaa2_switch_cls_flower_replace_acl() argument
499 struct ethsw_core *ethsw = block->ethsw; in dpaa2_switch_cls_flower_replace_acl()
503 if (dpaa2_switch_acl_tbl_is_full(block)) { in dpaa2_switch_cls_flower_replace_acl()
525 err = dpaa2_switch_acl_tbl_add_entry(block, acl_entry); in dpaa2_switch_cls_flower_replace_acl()
583 dpaa2_switch_cls_flower_replace_mirror(struct dpaa2_switch_filter_block *block, in dpaa2_switch_cls_flower_replace_mirror() argument
588 struct ethsw_core *ethsw = block->ethsw; in dpaa2_switch_cls_flower_replace_mirror()
625 list_for_each_safe(pos, n, &block->mirror_entries) { in dpaa2_switch_cls_flower_replace_mirror()
644 return dpaa2_switch_block_add_mirror(block, mirror_entry, if_id, in dpaa2_switch_cls_flower_replace_mirror()
648 int dpaa2_switch_cls_flower_replace(struct dpaa2_switch_filter_block *block, in dpaa2_switch_cls_flower_replace() argument
665 return dpaa2_switch_cls_flower_replace_acl(block, cls); in dpaa2_switch_cls_flower_replace()
667 return dpaa2_switch_cls_flower_replace_mirror(block, cls); in dpaa2_switch_cls_flower_replace()
674 int dpaa2_switch_cls_flower_destroy(struct dpaa2_switch_filter_block *block, in dpaa2_switch_cls_flower_destroy() argument
681 acl_entry = dpaa2_switch_acl_tbl_find_entry_by_cookie(block, in dpaa2_switch_cls_flower_destroy()
684 return dpaa2_switch_acl_tbl_remove_entry(block, acl_entry); in dpaa2_switch_cls_flower_destroy()
687 mirror_entry = dpaa2_switch_mirror_find_entry_by_cookie(block, in dpaa2_switch_cls_flower_destroy()
690 return dpaa2_switch_block_remove_mirror(block, in dpaa2_switch_cls_flower_destroy()
697 dpaa2_switch_cls_matchall_replace_acl(struct dpaa2_switch_filter_block *block, in dpaa2_switch_cls_matchall_replace_acl() argument
701 struct ethsw_core *ethsw = block->ethsw; in dpaa2_switch_cls_matchall_replace_acl()
706 if (dpaa2_switch_acl_tbl_is_full(block)) { in dpaa2_switch_cls_matchall_replace_acl()
724 err = dpaa2_switch_acl_tbl_add_entry(block, acl_entry); in dpaa2_switch_cls_matchall_replace_acl()
737 dpaa2_switch_cls_matchall_replace_mirror(struct dpaa2_switch_filter_block *block, in dpaa2_switch_cls_matchall_replace_mirror() argument
742 struct ethsw_core *ethsw = block->ethsw; in dpaa2_switch_cls_matchall_replace_mirror()
773 list_for_each_safe(pos, n, &block->mirror_entries) { in dpaa2_switch_cls_matchall_replace_mirror()
790 return dpaa2_switch_block_add_mirror(block, mirror_entry, if_id, in dpaa2_switch_cls_matchall_replace_mirror()
794 int dpaa2_switch_cls_matchall_replace(struct dpaa2_switch_filter_block *block, in dpaa2_switch_cls_matchall_replace() argument
810 return dpaa2_switch_cls_matchall_replace_acl(block, cls); in dpaa2_switch_cls_matchall_replace()
812 return dpaa2_switch_cls_matchall_replace_mirror(block, cls); in dpaa2_switch_cls_matchall_replace()
819 int dpaa2_switch_block_offload_mirror(struct dpaa2_switch_filter_block *block, in dpaa2_switch_block_offload_mirror() argument
826 list_for_each_entry(tmp, &block->mirror_entries, list) { in dpaa2_switch_block_offload_mirror()
837 list_for_each_entry(tmp, &block->mirror_entries, list) in dpaa2_switch_block_offload_mirror()
845 int dpaa2_switch_block_unoffload_mirror(struct dpaa2_switch_filter_block *block, in dpaa2_switch_block_unoffload_mirror() argument
852 list_for_each_entry(tmp, &block->mirror_entries, list) { in dpaa2_switch_block_unoffload_mirror()
863 list_for_each_entry(tmp, &block->mirror_entries, list) in dpaa2_switch_block_unoffload_mirror()
870 int dpaa2_switch_cls_matchall_destroy(struct dpaa2_switch_filter_block *block, in dpaa2_switch_cls_matchall_destroy() argument
877 acl_entry = dpaa2_switch_acl_tbl_find_entry_by_cookie(block, in dpaa2_switch_cls_matchall_destroy()
880 return dpaa2_switch_acl_tbl_remove_entry(block, in dpaa2_switch_cls_matchall_destroy()
884 mirror_entry = dpaa2_switch_mirror_find_entry_by_cookie(block, in dpaa2_switch_cls_matchall_destroy()
887 return dpaa2_switch_block_remove_mirror(block, in dpaa2_switch_cls_matchall_destroy()