• Home
  • Raw
  • Download

Lines Matching full:f

64 	struct fw_filter *f;  in fw_classify()  local
71 for (f = rcu_dereference_bh(head->ht[fw_hash(id)]); f; in fw_classify()
72 f = rcu_dereference_bh(f->next)) { in fw_classify()
73 if (f->id == id) { in fw_classify()
74 *res = f->res; in fw_classify()
76 if (!tcf_match_indev(skb, f->ifindex)) in fw_classify()
79 r = tcf_exts_exec(skb, &f->exts, res); in fw_classify()
104 struct fw_filter *f; in fw_get() local
109 f = rtnl_dereference(head->ht[fw_hash(handle)]); in fw_get()
110 for (; f; f = rtnl_dereference(f->next)) { in fw_get()
111 if (f->id == handle) in fw_get()
112 return f; in fw_get()
125 static void __fw_delete_filter(struct fw_filter *f) in __fw_delete_filter() argument
127 tcf_exts_destroy(&f->exts); in __fw_delete_filter()
128 tcf_exts_put_net(&f->exts); in __fw_delete_filter()
129 kfree(f); in __fw_delete_filter()
134 struct fw_filter *f = container_of(to_rcu_work(work), in fw_delete_filter_work() local
138 __fw_delete_filter(f); in fw_delete_filter_work()
145 struct fw_filter *f; in fw_destroy() local
152 while ((f = rtnl_dereference(head->ht[h])) != NULL) { in fw_destroy()
154 rtnl_dereference(f->next)); in fw_destroy()
155 tcf_unbind_filter(tp, &f->res); in fw_destroy()
156 if (tcf_exts_get_net(&f->exts)) in fw_destroy()
157 tcf_queue_work(&f->rwork, fw_delete_filter_work); in fw_destroy()
159 __fw_delete_filter(f); in fw_destroy()
169 struct fw_filter *f = arg; in fw_delete() local
175 if (head == NULL || f == NULL) in fw_delete()
178 fp = &head->ht[fw_hash(f->id)]; in fw_delete()
182 if (pfp == f) { in fw_delete()
183 RCU_INIT_POINTER(*fp, rtnl_dereference(f->next)); in fw_delete()
184 tcf_unbind_filter(tp, &f->res); in fw_delete()
185 tcf_exts_get_net(&f->exts); in fw_delete()
186 tcf_queue_work(&f->rwork, fw_delete_filter_work); in fw_delete()
211 struct fw_filter *f, struct nlattr **tb, in fw_set_parms() argument
219 err = tcf_exts_validate(net, tp, tb, tca[TCA_RATE], &f->exts, ovr, in fw_set_parms()
225 f->res.classid = nla_get_u32(tb[TCA_FW_CLASSID]); in fw_set_parms()
226 tcf_bind_filter(tp, &f->res, base); in fw_set_parms()
235 f->ifindex = ret; in fw_set_parms()
256 struct fw_filter *f = *arg; in fw_change() local
268 if (f) { in fw_change()
272 if (f->id != handle && handle) in fw_change()
279 fnew->id = f->id; in fw_change()
280 fnew->res = f->res; in fw_change()
282 fnew->ifindex = f->ifindex; in fw_change()
284 fnew->tp = f->tp; in fw_change()
302 if (pfp == f) in fw_change()
307 tcf_unbind_filter(tp, &f->res); in fw_change()
308 tcf_exts_get_net(&f->exts); in fw_change()
309 tcf_queue_work(&f->rwork, fw_delete_filter_work); in fw_change()
331 f = kzalloc(sizeof(struct fw_filter), GFP_KERNEL); in fw_change()
332 if (f == NULL) in fw_change()
335 err = tcf_exts_init(&f->exts, TCA_FW_ACT, TCA_FW_POLICE); in fw_change()
338 f->id = handle; in fw_change()
339 f->tp = tp; in fw_change()
341 err = fw_set_parms(net, tp, f, tb, tca, base, ovr, extack); in fw_change()
345 RCU_INIT_POINTER(f->next, head->ht[fw_hash(handle)]); in fw_change()
346 rcu_assign_pointer(head->ht[fw_hash(handle)], f); in fw_change()
348 *arg = f; in fw_change()
352 tcf_exts_destroy(&f->exts); in fw_change()
353 kfree(f); in fw_change()
369 struct fw_filter *f; in fw_walk() local
371 for (f = rtnl_dereference(head->ht[h]); f; in fw_walk()
372 f = rtnl_dereference(f->next)) { in fw_walk()
377 if (arg->fn(tp, f, arg) < 0) { in fw_walk()
390 struct fw_filter *f = fh; in fw_dump() local
393 if (f == NULL) in fw_dump()
396 t->tcm_handle = f->id; in fw_dump()
398 if (!f->res.classid && !tcf_exts_has_actions(&f->exts)) in fw_dump()
405 if (f->res.classid && in fw_dump()
406 nla_put_u32(skb, TCA_FW_CLASSID, f->res.classid)) in fw_dump()
409 if (f->ifindex) { in fw_dump()
411 dev = __dev_get_by_index(net, f->ifindex); in fw_dump()
420 if (tcf_exts_dump(skb, &f->exts) < 0) in fw_dump()
425 if (tcf_exts_dump_stats(skb, &f->exts) < 0) in fw_dump()
438 struct fw_filter *f = fh; in fw_bind_class() local
440 if (f && f->res.classid == classid) { in fw_bind_class()
442 __tcf_bind_filter(q, &f->res, base); in fw_bind_class()
444 __tcf_unbind_filter(q, &f->res); in fw_bind_class()