• Home
  • Raw
  • Download

Lines Matching refs:f

257 	struct cls_fl_filter *filter, *f;  in fl_lookup_range()  local
266 f = __fl_lookup(mask, mkey); in fl_lookup_range()
267 if (f) in fl_lookup_range()
268 return f; in fl_lookup_range()
303 struct cls_fl_filter *f; in fl_classify() local
321 f = fl_lookup(mask, &skb_mkey, &skb_key); in fl_classify()
322 if (f && !tc_skip_sw(f->flags)) { in fl_classify()
323 *res = f->res; in fl_classify()
324 return tcf_exts_exec(skb, &f->exts, res); in fl_classify()
399 static void __fl_destroy_filter(struct cls_fl_filter *f) in __fl_destroy_filter() argument
401 tcf_exts_destroy(&f->exts); in __fl_destroy_filter()
402 tcf_exts_put_net(&f->exts); in __fl_destroy_filter()
403 kfree(f); in __fl_destroy_filter()
408 struct cls_fl_filter *f = container_of(to_rcu_work(work), in fl_destroy_filter_work() local
411 __fl_destroy_filter(f); in fl_destroy_filter_work()
414 static void fl_hw_destroy_filter(struct tcf_proto *tp, struct cls_fl_filter *f, in fl_hw_destroy_filter() argument
420 tc_cls_common_offload_init(&cls_flower.common, tp, f->flags, extack); in fl_hw_destroy_filter()
422 cls_flower.cookie = (unsigned long) f; in fl_hw_destroy_filter()
425 &f->flags, &f->in_hw_count, rtnl_held); in fl_hw_destroy_filter()
430 struct cls_fl_filter *f, bool rtnl_held, in fl_hw_replace_filter() argument
435 bool skip_sw = tc_skip_sw(f->flags); in fl_hw_replace_filter()
438 cls_flower.rule = flow_rule_alloc(tcf_exts_num_actions(&f->exts)); in fl_hw_replace_filter()
442 tc_cls_common_offload_init(&cls_flower.common, tp, f->flags, extack); in fl_hw_replace_filter()
444 cls_flower.cookie = (unsigned long) f; in fl_hw_replace_filter()
445 cls_flower.rule->match.dissector = &f->mask->dissector; in fl_hw_replace_filter()
446 cls_flower.rule->match.mask = &f->mask->key; in fl_hw_replace_filter()
447 cls_flower.rule->match.key = &f->mkey; in fl_hw_replace_filter()
448 cls_flower.classid = f->res.classid; in fl_hw_replace_filter()
450 err = tc_setup_flow_action(&cls_flower.rule->action, &f->exts, in fl_hw_replace_filter()
462 skip_sw, &f->flags, &f->in_hw_count, rtnl_held); in fl_hw_replace_filter()
467 fl_hw_destroy_filter(tp, f, rtnl_held, NULL); in fl_hw_replace_filter()
471 if (skip_sw && !(f->flags & TCA_CLS_FLAGS_IN_HW)) in fl_hw_replace_filter()
477 static void fl_hw_update_stats(struct tcf_proto *tp, struct cls_fl_filter *f, in fl_hw_update_stats() argument
483 tc_cls_common_offload_init(&cls_flower.common, tp, f->flags, NULL); in fl_hw_update_stats()
485 cls_flower.cookie = (unsigned long) f; in fl_hw_update_stats()
486 cls_flower.classid = f->res.classid; in fl_hw_update_stats()
491 tcf_exts_stats_update(&f->exts, cls_flower.stats.bytes, in fl_hw_update_stats()
496 static void __fl_put(struct cls_fl_filter *f) in __fl_put() argument
498 if (!refcount_dec_and_test(&f->refcnt)) in __fl_put()
501 if (tcf_exts_get_net(&f->exts)) in __fl_put()
502 tcf_queue_work(&f->rwork, fl_destroy_filter_work); in __fl_put()
504 __fl_destroy_filter(f); in __fl_put()
509 struct cls_fl_filter *f; in __fl_get() local
512 f = idr_find(&head->handle_idr, handle); in __fl_get()
513 if (f && !refcount_inc_not_zero(&f->refcnt)) in __fl_get()
514 f = NULL; in __fl_get()
517 return f; in __fl_get()
520 static int __fl_delete(struct tcf_proto *tp, struct cls_fl_filter *f, in __fl_delete() argument
529 if (f->deleted) { in __fl_delete()
534 f->deleted = true; in __fl_delete()
535 rhashtable_remove_fast(&f->mask->ht, &f->ht_node, in __fl_delete()
536 f->mask->filter_ht_params); in __fl_delete()
537 idr_remove(&head->handle_idr, f->handle); in __fl_delete()
538 list_del_rcu(&f->list); in __fl_delete()
541 *last = fl_mask_put(head, f->mask); in __fl_delete()
542 if (!tc_skip_hw(f->flags)) in __fl_delete()
543 fl_hw_destroy_filter(tp, f, rtnl_held, extack); in __fl_delete()
544 tcf_unbind_filter(tp, &f->res); in __fl_delete()
545 __fl_put(f); in __fl_delete()
566 struct cls_fl_filter *f, *next; in fl_destroy() local
570 list_for_each_entry_safe(f, next, &mask->filters, list) { in fl_destroy()
571 __fl_delete(tp, f, &last, rtnl_held, extack); in fl_destroy()
584 struct cls_fl_filter *f = arg; in fl_put() local
586 __fl_put(f); in fl_put()
1467 struct cls_fl_filter *f, struct fl_flow_mask *mask, in fl_set_parms() argument
1475 err = tcf_exts_validate(net, tp, tb, est, &f->exts, ovr, rtnl_held, in fl_set_parms()
1481 f->res.classid = nla_get_u32(tb[TCA_FLOWER_CLASSID]); in fl_set_parms()
1484 tcf_bind_filter(tp, &f->res, base); in fl_set_parms()
1489 err = fl_set_key(net, tb, &f->key, &mask->key, extack); in fl_set_parms()
1494 fl_set_masked_key(&f->mkey, &f->key, mask); in fl_set_parms()
1722 struct cls_fl_filter *f = arg; in fl_delete() local
1726 err = __fl_delete(tp, f, &last_on_mask, rtnl_held, extack); in fl_delete()
1728 __fl_put(f); in fl_delete()
1738 struct cls_fl_filter *f; in fl_walk() local
1742 idr_for_each_entry_continue_ul(&head->handle_idr, f, tmp, id) { in fl_walk()
1744 if (!refcount_inc_not_zero(&f->refcnt)) in fl_walk()
1746 if (arg->fn(tp, f, arg) < 0) { in fl_walk()
1747 __fl_put(f); in fl_walk()
1751 __fl_put(f); in fl_walk()
1758 fl_get_next_hw_filter(struct tcf_proto *tp, struct cls_fl_filter *f, bool add) in fl_get_next_hw_filter() argument
1768 if (!f) in fl_get_next_hw_filter()
1769 f = list_entry(&head->hw_filters, struct cls_fl_filter, in fl_get_next_hw_filter()
1771 list_for_each_entry_continue(f, &head->hw_filters, hw_list) { in fl_get_next_hw_filter()
1772 if (!(add && f->deleted) && refcount_inc_not_zero(&f->refcnt)) { in fl_get_next_hw_filter()
1774 return f; in fl_get_next_hw_filter()
1787 struct cls_fl_filter *f = NULL; in fl_reoffload() local
1796 while ((f = fl_get_next_hw_filter(tp, f, add))) { in fl_reoffload()
1798 flow_rule_alloc(tcf_exts_num_actions(&f->exts)); in fl_reoffload()
1800 __fl_put(f); in fl_reoffload()
1804 tc_cls_common_offload_init(&cls_flower.common, tp, f->flags, in fl_reoffload()
1808 cls_flower.cookie = (unsigned long)f; in fl_reoffload()
1809 cls_flower.rule->match.dissector = &f->mask->dissector; in fl_reoffload()
1810 cls_flower.rule->match.mask = &f->mask->key; in fl_reoffload()
1811 cls_flower.rule->match.key = &f->mkey; in fl_reoffload()
1813 err = tc_setup_flow_action(&cls_flower.rule->action, &f->exts, in fl_reoffload()
1817 if (tc_skip_sw(f->flags)) { in fl_reoffload()
1819 __fl_put(f); in fl_reoffload()
1825 cls_flower.classid = f->res.classid; in fl_reoffload()
1829 cb_priv, &f->flags, in fl_reoffload()
1830 &f->in_hw_count); in fl_reoffload()
1835 __fl_put(f); in fl_reoffload()
1839 __fl_put(f); in fl_reoffload()
1848 struct cls_fl_filter *f = in fl_hw_add() local
1853 list_add(&f->hw_list, &head->hw_filters); in fl_hw_add()
1860 struct cls_fl_filter *f = in fl_hw_del() local
1864 if (!list_empty(&f->hw_list)) in fl_hw_del()
1865 list_del_init(&f->hw_list); in fl_hw_del()
2434 struct cls_fl_filter *f = fh; in fl_dump() local
2439 if (!f) in fl_dump()
2442 t->tcm_handle = f->handle; in fl_dump()
2450 if (f->res.classid && in fl_dump()
2451 nla_put_u32(skb, TCA_FLOWER_CLASSID, f->res.classid)) in fl_dump()
2454 key = &f->key; in fl_dump()
2455 mask = &f->mask->key; in fl_dump()
2456 skip_hw = tc_skip_hw(f->flags); in fl_dump()
2461 if (f->flags && nla_put_u32(skb, TCA_FLOWER_FLAGS, f->flags)) in fl_dump()
2467 fl_hw_update_stats(tp, f, rtnl_held); in fl_dump()
2469 if (nla_put_u32(skb, TCA_FLOWER_IN_HW_COUNT, f->in_hw_count)) in fl_dump()
2472 if (tcf_exts_dump(skb, &f->exts)) in fl_dump()
2477 if (tcf_exts_dump_stats(skb, &f->exts) < 0) in fl_dump()
2517 struct cls_fl_filter *f = fh; in fl_bind_class() local
2519 if (f && f->res.classid == classid) { in fl_bind_class()
2521 __tcf_bind_filter(q, &f->res, base); in fl_bind_class()
2523 __tcf_unbind_filter(q, &f->res); in fl_bind_class()