Lines Matching full:f

77 		   struct route4_filter *f)  in route4_set_fastmap()  argument
85 head->fastmap[h].filter = f; in route4_set_fastmap()
111 *res = f->res; \
112 if (tcf_exts_has_actions(&f->exts)) { \
113 int r = tcf_exts_exec(skb, &f->exts, res); \
120 route4_set_fastmap(head, id, iif, f); \
130 struct route4_filter *f; in route4_classify() local
147 (f = head->fastmap[h].filter) != NULL) { in route4_classify()
148 if (f == ROUTE4_FAILURE) { in route4_classify()
153 *res = f->res; in route4_classify()
164 for (f = rcu_dereference_bh(b->ht[route4_hash_from(id)]); in route4_classify()
165 f; in route4_classify()
166 f = rcu_dereference_bh(f->next)) in route4_classify()
167 if (f->id == id) in route4_classify()
170 for (f = rcu_dereference_bh(b->ht[route4_hash_iif(iif)]); in route4_classify()
171 f; in route4_classify()
172 f = rcu_dereference_bh(f->next)) in route4_classify()
173 if (f->iif == iif) in route4_classify()
176 for (f = rcu_dereference_bh(b->ht[route4_hash_wild()]); in route4_classify()
177 f; in route4_classify()
178 f = rcu_dereference_bh(f->next)) in route4_classify()
219 struct route4_filter *f; in route4_get() local
232 for (f = rtnl_dereference(b->ht[h2]); in route4_get()
233 f; in route4_get()
234 f = rtnl_dereference(f->next)) in route4_get()
235 if (f->handle == handle) in route4_get()
236 return f; in route4_get()
253 static void __route4_delete_filter(struct route4_filter *f) in __route4_delete_filter() argument
255 tcf_exts_destroy(&f->exts); in __route4_delete_filter()
256 tcf_exts_put_net(&f->exts); in __route4_delete_filter()
257 kfree(f); in __route4_delete_filter()
262 struct route4_filter *f = container_of(to_rcu_work(work), in route4_delete_filter_work() local
266 __route4_delete_filter(f); in route4_delete_filter_work()
270 static void route4_queue_work(struct route4_filter *f) in route4_queue_work() argument
272 tcf_queue_work(&f->rwork, route4_delete_filter_work); in route4_queue_work()
290 struct route4_filter *f; in route4_destroy() local
292 while ((f = rtnl_dereference(b->ht[h2])) != NULL) { in route4_destroy()
295 next = rtnl_dereference(f->next); in route4_destroy()
297 tcf_unbind_filter(tp, &f->res); in route4_destroy()
298 if (tcf_exts_get_net(&f->exts)) in route4_destroy()
299 route4_queue_work(f); in route4_destroy()
301 __route4_delete_filter(f); in route4_destroy()
315 struct route4_filter *f = arg; in route4_delete() local
322 if (!head || !f) in route4_delete()
325 h = f->handle; in route4_delete()
326 b = f->bkt; in route4_delete()
331 if (nf == f) { in route4_delete()
333 RCU_INIT_POINTER(*fp, rtnl_dereference(f->next)); in route4_delete()
342 tcf_unbind_filter(tp, &f->res); in route4_delete()
343 tcf_exts_get_net(&f->exts); in route4_delete()
344 tcf_queue_work(&f->rwork, route4_delete_filter_work); in route4_delete()
382 unsigned long base, struct route4_filter *f, in route4_set_parms() argument
393 err = tcf_exts_validate(net, tp, tb, est, &f->exts, flags, extack); in route4_set_parms()
446 if (fp->handle == f->handle) in route4_set_parms()
451 f->id = to; in route4_set_parms()
454 f->id = to | id<<16; in route4_set_parms()
456 f->iif = id; in route4_set_parms()
458 f->handle = nhandle; in route4_set_parms()
459 f->bkt = b; in route4_set_parms()
460 f->tp = tp; in route4_set_parms()
463 f->res.classid = nla_get_u32(tb[TCA_ROUTE4_CLASSID]); in route4_set_parms()
464 tcf_bind_filter(tp, &f->res, base); in route4_set_parms()
477 struct route4_filter *fold, *f1, *pfp, *f = NULL; in route4_change() local
503 f = kzalloc(sizeof(struct route4_filter), GFP_KERNEL); in route4_change()
504 if (!f) in route4_change()
507 err = tcf_exts_init(&f->exts, net, TCA_ROUTE4_ACT, TCA_ROUTE4_POLICE); in route4_change()
512 f->id = fold->id; in route4_change()
513 f->iif = fold->iif; in route4_change()
514 f->res = fold->res; in route4_change()
515 f->handle = fold->handle; in route4_change()
517 f->tp = fold->tp; in route4_change()
518 f->bkt = fold->bkt; in route4_change()
522 err = route4_set_parms(net, tp, base, f, handle, head, tb, in route4_change()
527 h = from_hash(f->handle >> 16); in route4_change()
528 fp = &f->bkt->ht[h]; in route4_change()
532 if (f->handle < f1->handle) in route4_change()
536 rcu_assign_pointer(f->next, f1); in route4_change()
537 rcu_assign_pointer(*fp, f); in route4_change()
556 *arg = f; in route4_change()
565 if (f) in route4_change()
566 tcf_exts_destroy(&f->exts); in route4_change()
567 kfree(f); in route4_change()
585 struct route4_filter *f; in route4_walk() local
587 for (f = rtnl_dereference(b->ht[h1]); in route4_walk()
588 f; in route4_walk()
589 f = rtnl_dereference(f->next)) { in route4_walk()
590 if (!tc_cls_stats_dump(tp, arg, f)) in route4_walk()
601 struct route4_filter *f = fh; in route4_dump() local
605 if (f == NULL) in route4_dump()
608 t->tcm_handle = f->handle; in route4_dump()
614 if (!(f->handle & 0x8000)) { in route4_dump()
615 id = f->id & 0xFF; in route4_dump()
619 if (f->handle & 0x80000000) { in route4_dump()
620 if ((f->handle >> 16) != 0xFFFF && in route4_dump()
621 nla_put_u32(skb, TCA_ROUTE4_IIF, f->iif)) in route4_dump()
624 id = f->id >> 16; in route4_dump()
628 if (f->res.classid && in route4_dump()
629 nla_put_u32(skb, TCA_ROUTE4_CLASSID, f->res.classid)) in route4_dump()
632 if (tcf_exts_dump(skb, &f->exts) < 0) in route4_dump()
637 if (tcf_exts_dump_stats(skb, &f->exts) < 0) in route4_dump()
650 struct route4_filter *f = fh; in route4_bind_class() local
652 tc_cls_bind_class(classid, cl, q, &f->res, base); in route4_bind_class()