Lines Matching refs:ife
296 struct tcf_ife_info *ife, u32 metaid, void *metaval, in __add_metainfo() argument
317 spin_lock_bh(&ife->tcf_lock); in __add_metainfo()
318 list_add_tail(&mi->metalist, &ife->metalist); in __add_metainfo()
320 spin_unlock_bh(&ife->tcf_lock); in __add_metainfo()
326 struct tcf_ife_info *ife, u32 metaid, in add_metainfo_and_get_ops() argument
333 ret = __add_metainfo(ops, ife, metaid, NULL, 0, true, exists); in add_metainfo_and_get_ops()
339 static int add_metainfo(struct tcf_ife_info *ife, u32 metaid, void *metaval, in add_metainfo() argument
347 ret = __add_metainfo(ops, ife, metaid, metaval, len, false, exists); in add_metainfo()
354 static int use_all_metadata(struct tcf_ife_info *ife, bool exists) in use_all_metadata() argument
362 rc = add_metainfo_and_get_ops(o, ife, o->metaid, exists); in use_all_metadata()
374 static int dump_metalist(struct sk_buff *skb, struct tcf_ife_info *ife) in dump_metalist() argument
382 if (list_empty(&ife->metalist)) in dump_metalist()
389 list_for_each_entry(e, &ife->metalist, metalist) { in dump_metalist()
409 struct tcf_ife_info *ife = to_ife(a); in _tcf_ife_cleanup() local
412 list_for_each_entry_safe(e, n, &ife->metalist, metalist) { in _tcf_ife_cleanup()
427 struct tcf_ife_info *ife = to_ife(a); in tcf_ife_cleanup() local
430 spin_lock_bh(&ife->tcf_lock); in tcf_ife_cleanup()
432 spin_unlock_bh(&ife->tcf_lock); in tcf_ife_cleanup()
434 p = rcu_dereference_protected(ife->params, 1); in tcf_ife_cleanup()
439 static int populate_metalist(struct tcf_ife_info *ife, struct nlattr **tb, in populate_metalist() argument
456 rc = add_metainfo(ife, i, val, len, exists); in populate_metalist()
475 struct tcf_ife_info *ife; in tcf_ife_init() local
538 ife = to_ife(*a); in tcf_ife_init()
570 INIT_LIST_HEAD(&ife->metalist); in tcf_ife_init()
578 err = populate_metalist(ife, tb2, exists, rtnl_held); in tcf_ife_init()
588 err = use_all_metadata(ife, exists); in tcf_ife_init()
594 spin_lock_bh(&ife->tcf_lock); in tcf_ife_init()
597 rcu_swap_protected(ife->params, p, 1); in tcf_ife_init()
600 spin_unlock_bh(&ife->tcf_lock); in tcf_ife_init()
623 struct tcf_ife_info *ife = to_ife(a); in tcf_ife_dump() local
626 .index = ife->tcf_index, in tcf_ife_dump()
627 .refcnt = refcount_read(&ife->tcf_refcnt) - ref, in tcf_ife_dump()
628 .bindcnt = atomic_read(&ife->tcf_bindcnt) - bind, in tcf_ife_dump()
632 spin_lock_bh(&ife->tcf_lock); in tcf_ife_dump()
633 opt.action = ife->tcf_action; in tcf_ife_dump()
634 p = rcu_dereference_protected(ife->params, in tcf_ife_dump()
635 lockdep_is_held(&ife->tcf_lock)); in tcf_ife_dump()
641 tcf_tm_dump(&t, &ife->tcf_tm); in tcf_ife_dump()
658 if (dump_metalist(skb, ife)) { in tcf_ife_dump()
663 spin_unlock_bh(&ife->tcf_lock); in tcf_ife_dump()
667 spin_unlock_bh(&ife->tcf_lock); in tcf_ife_dump()
672 static int find_decode_metaid(struct sk_buff *skb, struct tcf_ife_info *ife, in find_decode_metaid() argument
678 list_for_each_entry(e, &ife->metalist, metalist) { in find_decode_metaid()
693 struct tcf_ife_info *ife = to_ife(a); in tcf_ife_decode() local
694 int action = ife->tcf_action; in tcf_ife_decode()
699 bstats_cpu_update(this_cpu_ptr(ife->common.cpu_bstats), skb); in tcf_ife_decode()
700 tcf_lastuse_update(&ife->tcf_tm); in tcf_ife_decode()
707 qstats_drop_inc(this_cpu_ptr(ife->common.cpu_qstats)); in tcf_ife_decode()
720 qstats_drop_inc(this_cpu_ptr(ife->common.cpu_qstats)); in tcf_ife_decode()
724 if (find_decode_metaid(skb, ife, mtype, dlen, curr_data)) { in tcf_ife_decode()
730 qstats_overlimit_inc(this_cpu_ptr(ife->common.cpu_qstats)); in tcf_ife_decode()
735 qstats_drop_inc(this_cpu_ptr(ife->common.cpu_qstats)); in tcf_ife_decode()
748 static int ife_get_sz(struct sk_buff *skb, struct tcf_ife_info *ife) in ife_get_sz() argument
753 list_for_each_entry_safe(e, n, &ife->metalist, metalist) { in ife_get_sz()
766 struct tcf_ife_info *ife = to_ife(a); in tcf_ife_encode() local
767 int action = ife->tcf_action; in tcf_ife_encode()
774 u16 metalen = ife_get_sz(skb, ife); in tcf_ife_encode()
787 bstats_cpu_update(this_cpu_ptr(ife->common.cpu_bstats), skb); in tcf_ife_encode()
788 tcf_lastuse_update(&ife->tcf_tm); in tcf_ife_encode()
794 qstats_overlimit_inc(this_cpu_ptr(ife->common.cpu_qstats)); in tcf_ife_encode()
800 qstats_drop_inc(this_cpu_ptr(ife->common.cpu_qstats)); in tcf_ife_encode()
809 spin_lock(&ife->tcf_lock); in tcf_ife_encode()
815 list_for_each_entry(e, &ife->metalist, metalist) { in tcf_ife_encode()
822 spin_unlock(&ife->tcf_lock); in tcf_ife_encode()
823 qstats_drop_inc(this_cpu_ptr(ife->common.cpu_qstats)); in tcf_ife_encode()
828 spin_unlock(&ife->tcf_lock); in tcf_ife_encode()
846 struct tcf_ife_info *ife = to_ife(a); in tcf_ife_act() local
850 p = rcu_dereference_bh(ife->params); in tcf_ife_act()