Lines Matching refs:block
15 struct mlxsw_sp_flow_block *block; in mlxsw_sp_flow_block_create() local
17 block = kzalloc(sizeof(*block), GFP_KERNEL); in mlxsw_sp_flow_block_create()
18 if (!block) in mlxsw_sp_flow_block_create()
20 INIT_LIST_HEAD(&block->binding_list); in mlxsw_sp_flow_block_create()
21 INIT_LIST_HEAD(&block->mall.list); in mlxsw_sp_flow_block_create()
22 block->mlxsw_sp = mlxsw_sp; in mlxsw_sp_flow_block_create()
23 block->net = net; in mlxsw_sp_flow_block_create()
24 return block; in mlxsw_sp_flow_block_create()
27 void mlxsw_sp_flow_block_destroy(struct mlxsw_sp_flow_block *block) in mlxsw_sp_flow_block_destroy() argument
29 WARN_ON(!list_empty(&block->binding_list)); in mlxsw_sp_flow_block_destroy()
30 kfree(block); in mlxsw_sp_flow_block_destroy()
34 mlxsw_sp_flow_block_lookup(struct mlxsw_sp_flow_block *block, in mlxsw_sp_flow_block_lookup() argument
39 list_for_each_entry(binding, &block->binding_list, list) in mlxsw_sp_flow_block_lookup()
47 mlxsw_sp_flow_block_ruleset_bound(const struct mlxsw_sp_flow_block *block) in mlxsw_sp_flow_block_ruleset_bound() argument
49 return block->ruleset_zero; in mlxsw_sp_flow_block_ruleset_bound()
53 struct mlxsw_sp_flow_block *block, in mlxsw_sp_flow_block_bind() argument
61 if (WARN_ON(mlxsw_sp_flow_block_lookup(block, mlxsw_sp_port, ingress))) in mlxsw_sp_flow_block_bind()
64 if (ingress && block->ingress_blocker_rule_count) { in mlxsw_sp_flow_block_bind()
69 if (!ingress && block->egress_blocker_rule_count) { in mlxsw_sp_flow_block_bind()
74 err = mlxsw_sp_mall_port_bind(block, mlxsw_sp_port, extack); in mlxsw_sp_flow_block_bind()
86 if (mlxsw_sp_flow_block_ruleset_bound(block)) { in mlxsw_sp_flow_block_bind()
87 err = mlxsw_sp_acl_ruleset_bind(mlxsw_sp, block, binding); in mlxsw_sp_flow_block_bind()
93 block->ingress_binding_count++; in mlxsw_sp_flow_block_bind()
95 block->egress_binding_count++; in mlxsw_sp_flow_block_bind()
96 list_add(&binding->list, &block->binding_list); in mlxsw_sp_flow_block_bind()
102 mlxsw_sp_mall_port_unbind(block, mlxsw_sp_port); in mlxsw_sp_flow_block_bind()
108 struct mlxsw_sp_flow_block *block, in mlxsw_sp_flow_block_unbind() argument
114 binding = mlxsw_sp_flow_block_lookup(block, mlxsw_sp_port, ingress); in mlxsw_sp_flow_block_unbind()
121 block->ingress_binding_count--; in mlxsw_sp_flow_block_unbind()
123 block->egress_binding_count--; in mlxsw_sp_flow_block_unbind()
125 if (mlxsw_sp_flow_block_ruleset_bound(block)) in mlxsw_sp_flow_block_unbind()
126 mlxsw_sp_acl_ruleset_unbind(mlxsw_sp, block, binding); in mlxsw_sp_flow_block_unbind()
130 mlxsw_sp_mall_port_unbind(block, mlxsw_sp_port); in mlxsw_sp_flow_block_unbind()
211 block_cb = flow_block_cb_lookup(f->block, mlxsw_sp_flow_block_cb, in mlxsw_sp_setup_tc_block_bind()
261 block_cb = flow_block_cb_lookup(f->block, mlxsw_sp_flow_block_cb, in mlxsw_sp_setup_tc_block_unbind()