• Home
  • Raw
  • Download

Lines Matching refs:f

63 	struct fw_filter *f;  in fw_classify()  local
70 for (f = rcu_dereference_bh(head->ht[fw_hash(id)]); f; in fw_classify()
71 f = rcu_dereference_bh(f->next)) { in fw_classify()
72 if (f->id == id) { in fw_classify()
73 *res = f->res; in fw_classify()
75 if (!tcf_match_indev(skb, f->ifindex)) in fw_classify()
78 r = tcf_exts_exec(skb, &f->exts, res); in fw_classify()
101 struct fw_filter *f; in fw_get() local
106 f = rtnl_dereference(head->ht[fw_hash(handle)]); in fw_get()
107 for (; f; f = rtnl_dereference(f->next)) { in fw_get()
108 if (f->id == handle) in fw_get()
109 return (unsigned long)f; in fw_get()
114 static void fw_put(struct tcf_proto *tp, unsigned long f) in fw_put() argument
125 struct fw_filter *f = container_of(head, struct fw_filter, rcu); in fw_delete_filter() local
127 tcf_exts_destroy(&f->exts); in fw_delete_filter()
128 kfree(f); in fw_delete_filter()
134 struct fw_filter *f; in fw_destroy() local
141 while ((f = rtnl_dereference(head->ht[h])) != NULL) { in fw_destroy()
143 rtnl_dereference(f->next)); in fw_destroy()
144 tcf_unbind_filter(tp, &f->res); in fw_destroy()
145 call_rcu(&f->rcu, fw_delete_filter); in fw_destroy()
155 struct fw_filter *f = (struct fw_filter *)arg; in fw_delete() local
159 if (head == NULL || f == NULL) in fw_delete()
162 fp = &head->ht[fw_hash(f->id)]; in fw_delete()
166 if (pfp == f) { in fw_delete()
167 RCU_INIT_POINTER(*fp, rtnl_dereference(f->next)); in fw_delete()
168 tcf_unbind_filter(tp, &f->res); in fw_delete()
169 call_rcu(&f->rcu, fw_delete_filter); in fw_delete()
184 fw_change_attrs(struct net *net, struct tcf_proto *tp, struct fw_filter *f, in fw_change_attrs() argument
198 f->res.classid = nla_get_u32(tb[TCA_FW_CLASSID]); in fw_change_attrs()
199 tcf_bind_filter(tp, &f->res, base); in fw_change_attrs()
210 f->ifindex = ret; in fw_change_attrs()
222 tcf_exts_change(tp, &f->exts, &e); in fw_change_attrs()
237 struct fw_filter *f = (struct fw_filter *) *arg; in fw_change() local
249 if (f) { in fw_change()
253 if (f->id != handle && handle) in fw_change()
260 fnew->id = f->id; in fw_change()
261 fnew->res = f->res; in fw_change()
263 fnew->ifindex = f->ifindex; in fw_change()
265 fnew->tp = f->tp; in fw_change()
278 if (pfp == f) in fw_change()
283 tcf_unbind_filter(tp, &f->res); in fw_change()
284 call_rcu(&f->rcu, fw_delete_filter); in fw_change()
306 f = kzalloc(sizeof(struct fw_filter), GFP_KERNEL); in fw_change()
307 if (f == NULL) in fw_change()
310 tcf_exts_init(&f->exts, TCA_FW_ACT, TCA_FW_POLICE); in fw_change()
311 f->id = handle; in fw_change()
312 f->tp = tp; in fw_change()
314 err = fw_change_attrs(net, tp, f, tb, tca, base, ovr); in fw_change()
318 RCU_INIT_POINTER(f->next, head->ht[fw_hash(handle)]); in fw_change()
319 rcu_assign_pointer(head->ht[fw_hash(handle)], f); in fw_change()
321 *arg = (unsigned long)f; in fw_change()
325 kfree(f); in fw_change()
341 struct fw_filter *f; in fw_walk() local
343 for (f = rtnl_dereference(head->ht[h]); f; in fw_walk()
344 f = rtnl_dereference(f->next)) { in fw_walk()
349 if (arg->fn(tp, (unsigned long)f, arg) < 0) { in fw_walk()
362 struct fw_filter *f = (struct fw_filter *)fh; in fw_dump() local
366 if (f == NULL) in fw_dump()
369 t->tcm_handle = f->id; in fw_dump()
371 if (!f->res.classid && !tcf_exts_is_available(&f->exts)) in fw_dump()
378 if (f->res.classid && in fw_dump()
379 nla_put_u32(skb, TCA_FW_CLASSID, f->res.classid)) in fw_dump()
382 if (f->ifindex) { in fw_dump()
384 dev = __dev_get_by_index(net, f->ifindex); in fw_dump()
393 if (tcf_exts_dump(skb, &f->exts) < 0) in fw_dump()
398 if (tcf_exts_dump_stats(skb, &f->exts) < 0) in fw_dump()