Lines Matching full:f

78 		   struct route4_filter *f)  in route4_set_fastmap()  argument
86 head->fastmap[h].filter = f; in route4_set_fastmap()
112 *res = f->res; \
113 if (tcf_exts_has_actions(&f->exts)) { \
114 int r = tcf_exts_exec(skb, &f->exts, res); \
121 route4_set_fastmap(head, id, iif, f); \
132 struct route4_filter *f; in route4_classify() local
149 (f = head->fastmap[h].filter) != NULL) { in route4_classify()
150 if (f == ROUTE4_FAILURE) { in route4_classify()
155 *res = f->res; in route4_classify()
166 for (f = rcu_dereference_bh(b->ht[route4_hash_from(id)]); in route4_classify()
167 f; in route4_classify()
168 f = rcu_dereference_bh(f->next)) in route4_classify()
169 if (f->id == id) in route4_classify()
172 for (f = rcu_dereference_bh(b->ht[route4_hash_iif(iif)]); in route4_classify()
173 f; in route4_classify()
174 f = rcu_dereference_bh(f->next)) in route4_classify()
175 if (f->iif == iif) in route4_classify()
178 for (f = rcu_dereference_bh(b->ht[route4_hash_wild()]); in route4_classify()
179 f; in route4_classify()
180 f = rcu_dereference_bh(f->next)) in route4_classify()
221 struct route4_filter *f; in route4_get() local
234 for (f = rtnl_dereference(b->ht[h2]); in route4_get()
235 f; in route4_get()
236 f = rtnl_dereference(f->next)) in route4_get()
237 if (f->handle == handle) in route4_get()
238 return f; in route4_get()
255 static void __route4_delete_filter(struct route4_filter *f) in __route4_delete_filter() argument
257 tcf_exts_destroy(&f->exts); in __route4_delete_filter()
258 tcf_exts_put_net(&f->exts); in __route4_delete_filter()
259 kfree(f); in __route4_delete_filter()
264 struct route4_filter *f = container_of(to_rcu_work(work), in route4_delete_filter_work() local
268 __route4_delete_filter(f); in route4_delete_filter_work()
272 static void route4_queue_work(struct route4_filter *f) in route4_queue_work() argument
274 tcf_queue_work(&f->rwork, route4_delete_filter_work); in route4_queue_work()
292 struct route4_filter *f; in route4_destroy() local
294 while ((f = rtnl_dereference(b->ht[h2])) != NULL) { in route4_destroy()
297 next = rtnl_dereference(f->next); in route4_destroy()
299 tcf_unbind_filter(tp, &f->res); in route4_destroy()
300 if (tcf_exts_get_net(&f->exts)) in route4_destroy()
301 route4_queue_work(f); in route4_destroy()
303 __route4_delete_filter(f); in route4_destroy()
317 struct route4_filter *f = arg; in route4_delete() local
324 if (!head || !f) in route4_delete()
327 h = f->handle; in route4_delete()
328 b = f->bkt; in route4_delete()
333 if (nf == f) { in route4_delete()
335 RCU_INIT_POINTER(*fp, rtnl_dereference(f->next)); in route4_delete()
344 tcf_unbind_filter(tp, &f->res); in route4_delete()
345 tcf_exts_get_net(&f->exts); in route4_delete()
346 tcf_queue_work(&f->rwork, route4_delete_filter_work); in route4_delete()
384 unsigned long base, struct route4_filter *f, in route4_set_parms() argument
395 err = tcf_exts_validate(net, tp, tb, est, &f->exts, flags, extack); in route4_set_parms()
448 if (fp->handle == f->handle) in route4_set_parms()
453 f->id = to; in route4_set_parms()
456 f->id = to | id<<16; in route4_set_parms()
458 f->iif = id; in route4_set_parms()
460 f->handle = nhandle; in route4_set_parms()
461 f->bkt = b; in route4_set_parms()
462 f->tp = tp; in route4_set_parms()
465 f->res.classid = nla_get_u32(tb[TCA_ROUTE4_CLASSID]); in route4_set_parms()
466 tcf_bind_filter(tp, &f->res, base); in route4_set_parms()
479 struct route4_filter *fold, *f1, *pfp, *f = NULL; in route4_change() local
505 f = kzalloc(sizeof(struct route4_filter), GFP_KERNEL); in route4_change()
506 if (!f) in route4_change()
509 err = tcf_exts_init(&f->exts, net, TCA_ROUTE4_ACT, TCA_ROUTE4_POLICE); in route4_change()
514 f->id = fold->id; in route4_change()
515 f->iif = fold->iif; in route4_change()
516 f->handle = fold->handle; in route4_change()
518 f->tp = fold->tp; in route4_change()
519 f->bkt = fold->bkt; in route4_change()
523 err = route4_set_parms(net, tp, base, f, handle, head, tb, in route4_change()
528 h = from_hash(f->handle >> 16); in route4_change()
529 fp = &f->bkt->ht[h]; in route4_change()
533 if (f->handle < f1->handle) in route4_change()
537 rcu_assign_pointer(f->next, f1); in route4_change()
538 rcu_assign_pointer(*fp, f); in route4_change()
557 *arg = f; in route4_change()
566 if (f) in route4_change()
567 tcf_exts_destroy(&f->exts); in route4_change()
568 kfree(f); in route4_change()
586 struct route4_filter *f; in route4_walk() local
588 for (f = rtnl_dereference(b->ht[h1]); in route4_walk()
589 f; in route4_walk()
590 f = rtnl_dereference(f->next)) { in route4_walk()
591 if (!tc_cls_stats_dump(tp, arg, f)) in route4_walk()
602 struct route4_filter *f = fh; in route4_dump() local
606 if (f == NULL) in route4_dump()
609 t->tcm_handle = f->handle; in route4_dump()
615 if (!(f->handle & 0x8000)) { in route4_dump()
616 id = f->id & 0xFF; in route4_dump()
620 if (f->handle & 0x80000000) { in route4_dump()
621 if ((f->handle >> 16) != 0xFFFF && in route4_dump()
622 nla_put_u32(skb, TCA_ROUTE4_IIF, f->iif)) in route4_dump()
625 id = f->id >> 16; in route4_dump()
629 if (f->res.classid && in route4_dump()
630 nla_put_u32(skb, TCA_ROUTE4_CLASSID, f->res.classid)) in route4_dump()
633 if (tcf_exts_dump(skb, &f->exts) < 0) in route4_dump()
638 if (tcf_exts_dump_stats(skb, &f->exts) < 0) in route4_dump()
651 struct route4_filter *f = fh; in route4_bind_class() local
653 tc_cls_bind_class(classid, cl, q, &f->res, base); in route4_bind_class()