Lines Matching full:f
56 F.e. DPI can select ETH_P_IP (and necessary flags to make
120 int r = tcf_exts_exec(skb, &f->exts, res); \
132 struct rsvp_filter *f; in rsvp_classify() local
183 for (f = rcu_dereference_bh(s->ht[h2]); f; in rsvp_classify()
184 f = rcu_dereference_bh(f->next)) { in rsvp_classify()
185 if (src[RSVP_DST_LEN-1] == f->src[RSVP_DST_LEN - 1] && in rsvp_classify()
186 !(f->spi.mask & (*(u32 *)(xprt + f->spi.offset) ^ f->spi.key)) in rsvp_classify()
189 src[0] == f->src[0] && in rsvp_classify()
190 src[1] == f->src[1] && in rsvp_classify()
191 src[2] == f->src[2] in rsvp_classify()
194 *res = f->res; in rsvp_classify()
198 if (f->tunnelhdr == 0) in rsvp_classify()
201 tunnelid = f->res.classid; in rsvp_classify()
202 nhptr = (void *)(xprt + f->tunnelhdr - sizeof(*nhptr)); in rsvp_classify()
208 for (f = rcu_dereference_bh(s->ht[16]); f; in rsvp_classify()
209 f = rcu_dereference_bh(f->next)) { in rsvp_classify()
210 *res = f->res; in rsvp_classify()
251 struct rsvp_filter *f; in rsvp_get() local
260 for (f = rtnl_dereference(s->ht[h2]); f; in rsvp_get()
261 f = rtnl_dereference(f->next)) { in rsvp_get()
262 if (f->handle == handle) in rsvp_get()
263 return f; in rsvp_get()
281 static void __rsvp_delete_filter(struct rsvp_filter *f) in __rsvp_delete_filter() argument
283 tcf_exts_destroy(&f->exts); in __rsvp_delete_filter()
284 tcf_exts_put_net(&f->exts); in __rsvp_delete_filter()
285 kfree(f); in __rsvp_delete_filter()
290 struct rsvp_filter *f = container_of(to_rcu_work(work), in rsvp_delete_filter_work() local
294 __rsvp_delete_filter(f); in rsvp_delete_filter_work()
298 static void rsvp_delete_filter(struct tcf_proto *tp, struct rsvp_filter *f) in rsvp_delete_filter() argument
300 tcf_unbind_filter(tp, &f->res); in rsvp_delete_filter()
305 if (tcf_exts_get_net(&f->exts)) in rsvp_delete_filter()
306 tcf_queue_work(&f->rwork, rsvp_delete_filter_work); in rsvp_delete_filter()
308 __rsvp_delete_filter(f); in rsvp_delete_filter()
327 struct rsvp_filter *f; in rsvp_destroy() local
329 while ((f = rtnl_dereference(s->ht[h2])) != NULL) { in rsvp_destroy()
330 rcu_assign_pointer(s->ht[h2], f->next); in rsvp_destroy()
331 rsvp_delete_filter(tp, f); in rsvp_destroy()
344 struct rsvp_filter *nfp, *f = arg; in rsvp_delete() local
346 unsigned int h = f->handle; in rsvp_delete()
348 struct rsvp_session *nsp, *s = f->sess; in rsvp_delete()
354 if (nfp == f) { in rsvp_delete()
355 RCU_INIT_POINTER(*fp, f->next); in rsvp_delete()
356 rsvp_delete_filter(tp, f); in rsvp_delete()
432 struct rsvp_filter *f; in tunnel_recycle() local
434 for (f = rtnl_dereference(s->ht[h2]); f; in tunnel_recycle()
435 f = rtnl_dereference(f->next)) { in tunnel_recycle()
436 if (f->tunnelhdr == 0) in tunnel_recycle()
438 data->tgenerator = f->res.classid; in tunnel_recycle()
478 struct rsvp_filter *f, *nfp; in rsvp_change() local
506 f = *arg; in rsvp_change()
507 if (f) { in rsvp_change()
511 if (f->handle != handle && handle) in rsvp_change()
514 n = kmemdup(f, sizeof(*f), GFP_KERNEL); in rsvp_change()
545 f = kzalloc(sizeof(struct rsvp_filter), GFP_KERNEL); in rsvp_change()
546 if (f == NULL) in rsvp_change()
549 err = tcf_exts_init(&f->exts, net, TCA_RSVP_ACT, TCA_RSVP_POLICE); in rsvp_change()
554 memcpy(f->src, nla_data(tb[TCA_RSVP_SRC]), sizeof(f->src)); in rsvp_change()
555 h2 = hash_src(f->src); in rsvp_change()
559 f->spi = pinfo->spi; in rsvp_change()
560 f->tunnelhdr = pinfo->tunnelhdr; in rsvp_change()
563 f->res.classid = nla_get_u32(tb[TCA_RSVP_CLASSID]); in rsvp_change()
569 if ((f->handle = gen_handle(tp, h1 | (h2<<8))) == 0) in rsvp_change()
572 if (f->tunnelhdr) { in rsvp_change()
574 if (f->res.classid > 255) in rsvp_change()
578 if (f->res.classid == 0 && in rsvp_change()
579 (f->res.classid = gen_tunnel(data)) == 0) in rsvp_change()
601 f->sess = s; in rsvp_change()
602 if (f->tunnelhdr == 0) in rsvp_change()
603 tcf_bind_filter(tp, &f->res, base); in rsvp_change()
605 tcf_exts_change(&f->exts, &e); in rsvp_change()
610 __u32 mask = nfp->spi.mask & f->spi.mask; in rsvp_change()
612 if (mask != f->spi.mask) in rsvp_change()
615 RCU_INIT_POINTER(f->next, nfp); in rsvp_change()
616 rcu_assign_pointer(*fp, f); in rsvp_change()
618 *arg = f; in rsvp_change()
648 tcf_exts_destroy(&f->exts); in rsvp_change()
649 kfree(f); in rsvp_change()
670 struct rsvp_filter *f; in rsvp_walk() local
672 for (f = rtnl_dereference(s->ht[h1]); f; in rsvp_walk()
673 f = rtnl_dereference(f->next)) { in rsvp_walk()
674 if (!tc_cls_stats_dump(tp, arg, f)) in rsvp_walk()
685 struct rsvp_filter *f = fh; in rsvp_dump() local
690 if (f == NULL) in rsvp_dump()
692 s = f->sess; in rsvp_dump()
694 t->tcm_handle = f->handle; in rsvp_dump()
703 pinfo.spi = f->spi; in rsvp_dump()
706 pinfo.tunnelhdr = f->tunnelhdr; in rsvp_dump()
710 if (f->res.classid && in rsvp_dump()
711 nla_put_u32(skb, TCA_RSVP_CLASSID, f->res.classid)) in rsvp_dump()
713 if (((f->handle >> 8) & 0xFF) != 16 && in rsvp_dump()
714 nla_put(skb, TCA_RSVP_SRC, sizeof(f->src), f->src)) in rsvp_dump()
717 if (tcf_exts_dump(skb, &f->exts) < 0) in rsvp_dump()
722 if (tcf_exts_dump_stats(skb, &f->exts) < 0) in rsvp_dump()
734 struct rsvp_filter *f = fh; in rsvp_bind_class() local
736 tc_cls_bind_class(classid, cl, q, &f->res, base); in rsvp_bind_class()