Lines Matching refs:f
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()
481 struct rsvp_filter *f, *nfp; in rsvp_change() local
509 f = *arg; in rsvp_change()
510 if (f) { in rsvp_change()
514 if (f->handle != handle && handle) in rsvp_change()
517 n = kmemdup(f, sizeof(*f), GFP_KERNEL); in rsvp_change()
548 f = kzalloc(sizeof(struct rsvp_filter), GFP_KERNEL); in rsvp_change()
549 if (f == NULL) in rsvp_change()
552 err = tcf_exts_init(&f->exts, net, TCA_RSVP_ACT, TCA_RSVP_POLICE); in rsvp_change()
557 memcpy(f->src, nla_data(tb[TCA_RSVP_SRC]), sizeof(f->src)); in rsvp_change()
558 h2 = hash_src(f->src); in rsvp_change()
562 f->spi = pinfo->spi; in rsvp_change()
563 f->tunnelhdr = pinfo->tunnelhdr; in rsvp_change()
566 f->res.classid = nla_get_u32(tb[TCA_RSVP_CLASSID]); in rsvp_change()
572 if ((f->handle = gen_handle(tp, h1 | (h2<<8))) == 0) in rsvp_change()
575 if (f->tunnelhdr) { in rsvp_change()
577 if (f->res.classid > 255) in rsvp_change()
581 if (f->res.classid == 0 && in rsvp_change()
582 (f->res.classid = gen_tunnel(data)) == 0) in rsvp_change()
604 f->sess = s; in rsvp_change()
605 if (f->tunnelhdr == 0) in rsvp_change()
606 tcf_bind_filter(tp, &f->res, base); in rsvp_change()
608 tcf_exts_change(&f->exts, &e); in rsvp_change()
613 __u32 mask = nfp->spi.mask & f->spi.mask; in rsvp_change()
615 if (mask != f->spi.mask) in rsvp_change()
618 RCU_INIT_POINTER(f->next, nfp); in rsvp_change()
619 rcu_assign_pointer(*fp, f); in rsvp_change()
621 *arg = f; in rsvp_change()
651 tcf_exts_destroy(&f->exts); in rsvp_change()
652 kfree(f); in rsvp_change()
673 struct rsvp_filter *f; in rsvp_walk() local
675 for (f = rtnl_dereference(s->ht[h1]); f; in rsvp_walk()
676 f = rtnl_dereference(f->next)) { in rsvp_walk()
681 if (arg->fn(tp, f, arg) < 0) { in rsvp_walk()
695 struct rsvp_filter *f = fh; in rsvp_dump() local
700 if (f == NULL) in rsvp_dump()
702 s = f->sess; in rsvp_dump()
704 t->tcm_handle = f->handle; in rsvp_dump()
713 pinfo.spi = f->spi; in rsvp_dump()
716 pinfo.tunnelhdr = f->tunnelhdr; in rsvp_dump()
720 if (f->res.classid && in rsvp_dump()
721 nla_put_u32(skb, TCA_RSVP_CLASSID, f->res.classid)) in rsvp_dump()
723 if (((f->handle >> 8) & 0xFF) != 16 && in rsvp_dump()
724 nla_put(skb, TCA_RSVP_SRC, sizeof(f->src), f->src)) in rsvp_dump()
727 if (tcf_exts_dump(skb, &f->exts) < 0) in rsvp_dump()
732 if (tcf_exts_dump_stats(skb, &f->exts) < 0) in rsvp_dump()
744 struct rsvp_filter *f = fh; in rsvp_bind_class() local
746 if (f && f->res.classid == classid) { in rsvp_bind_class()
748 __tcf_bind_filter(q, &f->res, base); in rsvp_bind_class()
750 __tcf_unbind_filter(q, &f->res); in rsvp_bind_class()