Lines Matching refs:f
54 struct fw_filter *f; in fw_classify() local
61 for (f = rcu_dereference_bh(head->ht[fw_hash(id)]); f; in fw_classify()
62 f = rcu_dereference_bh(f->next)) { in fw_classify()
63 if (f->id == id) { in fw_classify()
64 *res = f->res; in fw_classify()
65 if (!tcf_match_indev(skb, f->ifindex)) in fw_classify()
67 r = tcf_exts_exec(skb, &f->exts, res); in fw_classify()
92 struct fw_filter *f; in fw_get() local
97 f = rtnl_dereference(head->ht[fw_hash(handle)]); in fw_get()
98 for (; f; f = rtnl_dereference(f->next)) { in fw_get()
99 if (f->id == handle) in fw_get()
100 return f; in fw_get()
113 static void __fw_delete_filter(struct fw_filter *f) in __fw_delete_filter() argument
115 tcf_exts_destroy(&f->exts); in __fw_delete_filter()
116 tcf_exts_put_net(&f->exts); in __fw_delete_filter()
117 kfree(f); in __fw_delete_filter()
122 struct fw_filter *f = container_of(to_rcu_work(work), in fw_delete_filter_work() local
126 __fw_delete_filter(f); in fw_delete_filter_work()
134 struct fw_filter *f; in fw_destroy() local
141 while ((f = rtnl_dereference(head->ht[h])) != NULL) { in fw_destroy()
143 rtnl_dereference(f->next)); in fw_destroy()
144 tcf_unbind_filter(tp, &f->res); in fw_destroy()
145 if (tcf_exts_get_net(&f->exts)) in fw_destroy()
146 tcf_queue_work(&f->rwork, fw_delete_filter_work); in fw_destroy()
148 __fw_delete_filter(f); in fw_destroy()
158 struct fw_filter *f = arg; in fw_delete() local
164 if (head == NULL || f == NULL) in fw_delete()
167 fp = &head->ht[fw_hash(f->id)]; in fw_delete()
171 if (pfp == f) { in fw_delete()
172 RCU_INIT_POINTER(*fp, rtnl_dereference(f->next)); in fw_delete()
173 tcf_unbind_filter(tp, &f->res); in fw_delete()
174 tcf_exts_get_net(&f->exts); in fw_delete()
175 tcf_queue_work(&f->rwork, fw_delete_filter_work); in fw_delete()
200 struct fw_filter *f, struct nlattr **tb, in fw_set_parms() argument
208 err = tcf_exts_validate(net, tp, tb, tca[TCA_RATE], &f->exts, ovr, in fw_set_parms()
218 f->ifindex = ret; in fw_set_parms()
230 f->res.classid = nla_get_u32(tb[TCA_FW_CLASSID]); in fw_set_parms()
231 tcf_bind_filter(tp, &f->res, base); in fw_set_parms()
244 struct fw_filter *f = *arg; in fw_change() local
257 if (f) { in fw_change()
261 if (f->id != handle && handle) in fw_change()
268 fnew->id = f->id; in fw_change()
269 fnew->ifindex = f->ifindex; in fw_change()
270 fnew->tp = f->tp; in fw_change()
289 if (pfp == f) in fw_change()
294 tcf_unbind_filter(tp, &f->res); in fw_change()
295 tcf_exts_get_net(&f->exts); in fw_change()
296 tcf_queue_work(&f->rwork, fw_delete_filter_work); in fw_change()
318 f = kzalloc(sizeof(struct fw_filter), GFP_KERNEL); in fw_change()
319 if (f == NULL) in fw_change()
322 err = tcf_exts_init(&f->exts, net, TCA_FW_ACT, TCA_FW_POLICE); in fw_change()
325 f->id = handle; in fw_change()
326 f->tp = tp; in fw_change()
328 err = fw_set_parms(net, tp, f, tb, tca, base, ovr, extack); in fw_change()
332 RCU_INIT_POINTER(f->next, head->ht[fw_hash(handle)]); in fw_change()
333 rcu_assign_pointer(head->ht[fw_hash(handle)], f); in fw_change()
335 *arg = f; in fw_change()
339 tcf_exts_destroy(&f->exts); in fw_change()
340 kfree(f); in fw_change()
357 struct fw_filter *f; in fw_walk() local
359 for (f = rtnl_dereference(head->ht[h]); f; in fw_walk()
360 f = rtnl_dereference(f->next)) { in fw_walk()
365 if (arg->fn(tp, f, arg) < 0) { in fw_walk()
378 struct fw_filter *f = fh; in fw_dump() local
381 if (f == NULL) in fw_dump()
384 t->tcm_handle = f->id; in fw_dump()
386 if (!f->res.classid && !tcf_exts_has_actions(&f->exts)) in fw_dump()
393 if (f->res.classid && in fw_dump()
394 nla_put_u32(skb, TCA_FW_CLASSID, f->res.classid)) in fw_dump()
396 if (f->ifindex) { in fw_dump()
398 dev = __dev_get_by_index(net, f->ifindex); in fw_dump()
406 if (tcf_exts_dump(skb, &f->exts) < 0) in fw_dump()
411 if (tcf_exts_dump_stats(skb, &f->exts) < 0) in fw_dump()
424 struct fw_filter *f = fh; in fw_bind_class() local
426 if (f && f->res.classid == classid) { in fw_bind_class()
428 __tcf_bind_filter(q, &f->res, base); in fw_bind_class()
430 __tcf_unbind_filter(q, &f->res); in fw_bind_class()