Lines Matching refs:head
30 struct cls_mall_head *head = rcu_dereference_bh(tp->root); in mall_classify() local
32 if (unlikely(!head)) in mall_classify()
35 if (tc_skip_sw(head->flags)) in mall_classify()
38 *res = head->res; in mall_classify()
39 __this_cpu_inc(head->pf->rhit); in mall_classify()
40 return tcf_exts_exec(skb, &head->exts, res); in mall_classify()
48 static void __mall_destroy(struct cls_mall_head *head) in __mall_destroy() argument
50 tcf_exts_destroy(&head->exts); in __mall_destroy()
51 tcf_exts_put_net(&head->exts); in __mall_destroy()
52 free_percpu(head->pf); in __mall_destroy()
53 kfree(head); in __mall_destroy()
58 struct cls_mall_head *head = container_of(to_rcu_work(work), in mall_destroy_work() local
62 __mall_destroy(head); in mall_destroy_work()
67 struct cls_mall_head *head, in mall_destroy_hw_filter() argument
74 tc_cls_common_offload_init(&cls_mall.common, tp, head->flags, extack); in mall_destroy_hw_filter()
79 &head->flags, &head->in_hw_count, true); in mall_destroy_hw_filter()
83 struct cls_mall_head *head, in mall_replace_hw_filter() argument
89 bool skip_sw = tc_skip_sw(head->flags); in mall_replace_hw_filter()
92 cls_mall.rule = flow_rule_alloc(tcf_exts_num_actions(&head->exts)); in mall_replace_hw_filter()
96 tc_cls_common_offload_init(&cls_mall.common, tp, head->flags, extack); in mall_replace_hw_filter()
100 err = tc_setup_offload_action(&cls_mall.rule->action, &head->exts, in mall_replace_hw_filter()
104 mall_destroy_hw_filter(tp, head, cookie, NULL); in mall_replace_hw_filter()
110 skip_sw, &head->flags, &head->in_hw_count, true); in mall_replace_hw_filter()
115 mall_destroy_hw_filter(tp, head, cookie, NULL); in mall_replace_hw_filter()
119 if (skip_sw && !(head->flags & TCA_CLS_FLAGS_IN_HW)) in mall_replace_hw_filter()
128 struct cls_mall_head *head = rtnl_dereference(tp->root); in mall_destroy() local
130 if (!head) in mall_destroy()
133 tcf_unbind_filter(tp, &head->res); in mall_destroy()
135 if (!tc_skip_hw(head->flags)) in mall_destroy()
136 mall_destroy_hw_filter(tp, head, (unsigned long) head, extack); in mall_destroy()
138 if (tcf_exts_get_net(&head->exts)) in mall_destroy()
139 tcf_queue_work(&head->rwork, mall_destroy_work); in mall_destroy()
141 __mall_destroy(head); in mall_destroy()
146 struct cls_mall_head *head = rtnl_dereference(tp->root); in mall_get() local
148 if (head && head->handle == handle) in mall_get()
149 return head; in mall_get()
161 struct cls_mall_head *head, in mall_set_parms() argument
168 err = tcf_exts_validate_ex(net, tp, tb, est, &head->exts, flags, in mall_set_parms()
174 head->res.classid = nla_get_u32(tb[TCA_MATCHALL_CLASSID]); in mall_set_parms()
175 tcf_bind_filter(tp, &head->res, base); in mall_set_parms()
186 struct cls_mall_head *head = rtnl_dereference(tp->root); in mall_change() local
195 if (head) in mall_change()
242 *arg = head; in mall_change()
259 struct cls_mall_head *head = rtnl_dereference(tp->root); in mall_delete() local
261 head->deleting = true; in mall_delete()
269 struct cls_mall_head *head = rtnl_dereference(tp->root); in mall_walk() local
274 if (!head || head->deleting) in mall_walk()
276 if (arg->fn(tp, head, arg) < 0) in mall_walk()
285 struct cls_mall_head *head = rtnl_dereference(tp->root); in mall_reoffload() local
290 if (tc_skip_hw(head->flags)) in mall_reoffload()
293 cls_mall.rule = flow_rule_alloc(tcf_exts_num_actions(&head->exts)); in mall_reoffload()
297 tc_cls_common_offload_init(&cls_mall.common, tp, head->flags, extack); in mall_reoffload()
300 cls_mall.cookie = (unsigned long)head; in mall_reoffload()
302 err = tc_setup_offload_action(&cls_mall.rule->action, &head->exts, in mall_reoffload()
307 return add && tc_skip_sw(head->flags) ? err : 0; in mall_reoffload()
311 &cls_mall, cb_priv, &head->flags, in mall_reoffload()
312 &head->in_hw_count); in mall_reoffload()
320 struct cls_mall_head *head, in mall_stats_hw_filter() argument
326 tc_cls_common_offload_init(&cls_mall.common, tp, head->flags, NULL); in mall_stats_hw_filter()
332 tcf_exts_hw_stats_update(&head->exts, cls_mall.stats.bytes, in mall_stats_hw_filter()
343 struct cls_mall_head *head = fh; in mall_dump() local
347 if (!head) in mall_dump()
350 if (!tc_skip_hw(head->flags)) in mall_dump()
351 mall_stats_hw_filter(tp, head, (unsigned long)head); in mall_dump()
353 t->tcm_handle = head->handle; in mall_dump()
359 if (head->res.classid && in mall_dump()
360 nla_put_u32(skb, TCA_MATCHALL_CLASSID, head->res.classid)) in mall_dump()
363 if (head->flags && nla_put_u32(skb, TCA_MATCHALL_FLAGS, head->flags)) in mall_dump()
367 struct tc_matchall_pcnt *pf = per_cpu_ptr(head->pf, cpu); in mall_dump()
377 if (tcf_exts_dump(skb, &head->exts)) in mall_dump()
382 if (tcf_exts_dump_stats(skb, &head->exts) < 0) in mall_dump()
395 struct cls_mall_head *head = fh; in mall_bind_class() local
397 tc_cls_bind_class(classid, cl, q, &head->res, base); in mall_bind_class()