Lines Matching full:f

56 	struct fw_filter *f;  in fw_classify()  local
63 for (f = rcu_dereference_bh(head->ht[fw_hash(id)]); f; in fw_classify()
64 f = rcu_dereference_bh(f->next)) { in fw_classify()
65 if (f->id == id) { in fw_classify()
66 *res = f->res; in fw_classify()
67 if (!tcf_match_indev(skb, f->ifindex)) in fw_classify()
69 r = tcf_exts_exec(skb, &f->exts, res); in fw_classify()
94 struct fw_filter *f; in fw_get() local
99 f = rtnl_dereference(head->ht[fw_hash(handle)]); in fw_get()
100 for (; f; f = rtnl_dereference(f->next)) { in fw_get()
101 if (f->id == handle) in fw_get()
102 return f; in fw_get()
115 static void __fw_delete_filter(struct fw_filter *f) in __fw_delete_filter() argument
117 tcf_exts_destroy(&f->exts); in __fw_delete_filter()
118 tcf_exts_put_net(&f->exts); in __fw_delete_filter()
119 kfree(f); in __fw_delete_filter()
124 struct fw_filter *f = container_of(to_rcu_work(work), in fw_delete_filter_work() local
128 __fw_delete_filter(f); in fw_delete_filter_work()
136 struct fw_filter *f; in fw_destroy() local
143 while ((f = rtnl_dereference(head->ht[h])) != NULL) { in fw_destroy()
145 rtnl_dereference(f->next)); in fw_destroy()
146 tcf_unbind_filter(tp, &f->res); in fw_destroy()
147 if (tcf_exts_get_net(&f->exts)) in fw_destroy()
148 tcf_queue_work(&f->rwork, fw_delete_filter_work); in fw_destroy()
150 __fw_delete_filter(f); in fw_destroy()
160 struct fw_filter *f = arg; in fw_delete() local
166 if (head == NULL || f == NULL) in fw_delete()
169 fp = &head->ht[fw_hash(f->id)]; in fw_delete()
173 if (pfp == f) { in fw_delete()
174 RCU_INIT_POINTER(*fp, rtnl_dereference(f->next)); in fw_delete()
175 tcf_unbind_filter(tp, &f->res); in fw_delete()
176 tcf_exts_get_net(&f->exts); in fw_delete()
177 tcf_queue_work(&f->rwork, fw_delete_filter_work); in fw_delete()
202 struct fw_filter *f, struct nlattr **tb, in fw_set_parms() argument
210 err = tcf_exts_validate(net, tp, tb, tca[TCA_RATE], &f->exts, flags, in fw_set_parms()
220 f->ifindex = ret; in fw_set_parms()
232 f->res.classid = nla_get_u32(tb[TCA_FW_CLASSID]); in fw_set_parms()
233 tcf_bind_filter(tp, &f->res, base); in fw_set_parms()
245 struct fw_filter *f = *arg; in fw_change() local
258 if (f) { in fw_change()
262 if (f->id != handle && handle) in fw_change()
269 fnew->id = f->id; in fw_change()
270 fnew->ifindex = f->ifindex; in fw_change()
271 fnew->tp = f->tp; in fw_change()
290 if (pfp == f) in fw_change()
295 tcf_unbind_filter(tp, &f->res); in fw_change()
296 tcf_exts_get_net(&f->exts); in fw_change()
297 tcf_queue_work(&f->rwork, fw_delete_filter_work); in fw_change()
319 f = kzalloc(sizeof(struct fw_filter), GFP_KERNEL); in fw_change()
320 if (f == NULL) in fw_change()
323 err = tcf_exts_init(&f->exts, net, TCA_FW_ACT, TCA_FW_POLICE); in fw_change()
326 f->id = handle; in fw_change()
327 f->tp = tp; in fw_change()
329 err = fw_set_parms(net, tp, f, tb, tca, base, flags, extack); in fw_change()
333 RCU_INIT_POINTER(f->next, head->ht[fw_hash(handle)]); in fw_change()
334 rcu_assign_pointer(head->ht[fw_hash(handle)], f); in fw_change()
336 *arg = f; in fw_change()
340 tcf_exts_destroy(&f->exts); in fw_change()
341 kfree(f); in fw_change()
358 struct fw_filter *f; in fw_walk() local
360 for (f = rtnl_dereference(head->ht[h]); f; in fw_walk()
361 f = rtnl_dereference(f->next)) { in fw_walk()
362 if (!tc_cls_stats_dump(tp, arg, f)) in fw_walk()
372 struct fw_filter *f = fh; in fw_dump() local
375 if (f == NULL) in fw_dump()
378 t->tcm_handle = f->id; in fw_dump()
380 if (!f->res.classid && !tcf_exts_has_actions(&f->exts)) in fw_dump()
387 if (f->res.classid && in fw_dump()
388 nla_put_u32(skb, TCA_FW_CLASSID, f->res.classid)) in fw_dump()
390 if (f->ifindex) { in fw_dump()
392 dev = __dev_get_by_index(net, f->ifindex); in fw_dump()
400 if (tcf_exts_dump(skb, &f->exts) < 0) in fw_dump()
405 if (tcf_exts_dump_stats(skb, &f->exts) < 0) in fw_dump()
418 struct fw_filter *f = fh; in fw_bind_class() local
420 tc_cls_bind_class(classid, cl, q, &f->res, base); in fw_bind_class()