• Home
  • Raw
  • Download

Lines Matching full:chain

52 	return jhash_3words(tp->chain->index, tp->prio,  in destroy_obj_hashfn()
56 static void tcf_proto_signal_destroying(struct tcf_chain *chain, in tcf_proto_signal_destroying() argument
59 struct tcf_block *block = chain->block; in tcf_proto_signal_destroying()
70 return tp1->chain->index == tp2->chain->index && in tcf_proto_cmp()
75 static bool tcf_proto_exists_destroying(struct tcf_chain *chain, in tcf_proto_exists_destroying() argument
83 hash_for_each_possible_rcu(chain->block->proto_destroy_ht, iter, in tcf_proto_exists_destroying()
96 tcf_proto_signal_destroyed(struct tcf_chain *chain, struct tcf_proto *tp) in tcf_proto_signal_destroyed() argument
98 struct tcf_block *block = chain->block; in tcf_proto_signal_destroyed()
250 u32 prio, struct tcf_chain *chain, in tcf_proto_create() argument
269 tp->chain = chain; in tcf_proto_create()
290 static void tcf_chain_put(struct tcf_chain *chain);
297 tcf_proto_signal_destroyed(tp->chain, tp); in tcf_proto_destroy()
298 tcf_chain_put(tp->chain); in tcf_proto_destroy()
349 struct tcf_chain *chain; in tcf_chain_create() local
353 chain = kzalloc(sizeof(*chain), GFP_KERNEL); in tcf_chain_create()
354 if (!chain) in tcf_chain_create()
356 list_add_tail_rcu(&chain->list, &block->chain_list); in tcf_chain_create()
357 mutex_init(&chain->filter_chain_lock); in tcf_chain_create()
358 chain->block = block; in tcf_chain_create()
359 chain->index = chain_index; in tcf_chain_create()
360 chain->refcnt = 1; in tcf_chain_create()
361 if (!chain->index) in tcf_chain_create()
362 block->chain0.chain = chain; in tcf_chain_create()
363 return chain; in tcf_chain_create()
373 static void tcf_chain0_head_change(struct tcf_chain *chain, in tcf_chain0_head_change() argument
377 struct tcf_block *block = chain->block; in tcf_chain0_head_change()
379 if (chain->index) in tcf_chain0_head_change()
390 static bool tcf_chain_detach(struct tcf_chain *chain) in tcf_chain_detach() argument
392 struct tcf_block *block = chain->block; in tcf_chain_detach()
396 list_del_rcu(&chain->list); in tcf_chain_detach()
397 if (!chain->index) in tcf_chain_detach()
398 block->chain0.chain = NULL; in tcf_chain_detach()
414 static void tcf_chain_destroy(struct tcf_chain *chain, bool free_block) in tcf_chain_destroy() argument
416 struct tcf_block *block = chain->block; in tcf_chain_destroy()
418 mutex_destroy(&chain->filter_chain_lock); in tcf_chain_destroy()
419 kfree_rcu(chain, rcu); in tcf_chain_destroy()
424 static void tcf_chain_hold(struct tcf_chain *chain) in tcf_chain_hold() argument
426 ASSERT_BLOCK_LOCKED(chain->block); in tcf_chain_hold()
428 ++chain->refcnt; in tcf_chain_hold()
431 static bool tcf_chain_held_by_acts_only(struct tcf_chain *chain) in tcf_chain_held_by_acts_only() argument
433 ASSERT_BLOCK_LOCKED(chain->block); in tcf_chain_held_by_acts_only()
436 * chain should not be shown to the user. in tcf_chain_held_by_acts_only()
438 return chain->refcnt == chain->action_refcnt; in tcf_chain_held_by_acts_only()
444 struct tcf_chain *chain; in tcf_chain_lookup() local
448 list_for_each_entry(chain, &block->chain_list, list) { in tcf_chain_lookup()
449 if (chain->index == chain_index) in tcf_chain_lookup()
450 return chain; in tcf_chain_lookup()
459 struct tcf_chain *chain; in tcf_chain_lookup_rcu() local
461 list_for_each_entry_rcu(chain, &block->chain_list, list) { in tcf_chain_lookup_rcu()
462 if (chain->index == chain_index) in tcf_chain_lookup_rcu()
463 return chain; in tcf_chain_lookup_rcu()
469 static int tc_chain_notify(struct tcf_chain *chain, struct sk_buff *oskb,
476 struct tcf_chain *chain = NULL; in __tcf_chain_get() local
480 chain = tcf_chain_lookup(block, chain_index); in __tcf_chain_get()
481 if (chain) { in __tcf_chain_get()
482 tcf_chain_hold(chain); in __tcf_chain_get()
486 chain = tcf_chain_create(block, chain_index); in __tcf_chain_get()
487 if (!chain) in __tcf_chain_get()
492 ++chain->action_refcnt; in __tcf_chain_get()
493 is_first_reference = chain->refcnt - chain->action_refcnt == 1; in __tcf_chain_get()
497 * non-action reference. Until then, the chain acts only as in __tcf_chain_get()
502 tc_chain_notify(chain, NULL, 0, NLM_F_CREATE | NLM_F_EXCL, in __tcf_chain_get()
505 return chain; in __tcf_chain_get()
509 return chain; in __tcf_chain_get()
531 static void __tcf_chain_put(struct tcf_chain *chain, bool by_act, in __tcf_chain_put() argument
534 struct tcf_block *block = chain->block; in __tcf_chain_put()
542 if (!chain->explicitly_created) { in __tcf_chain_put()
546 chain->explicitly_created = false; in __tcf_chain_put()
550 chain->action_refcnt--; in __tcf_chain_put()
553 * However, when block is unlocked chain can be changed concurrently, so in __tcf_chain_put()
556 refcnt = --chain->refcnt; in __tcf_chain_put()
557 non_act_refcnt = refcnt - chain->action_refcnt; in __tcf_chain_put()
558 tmplt_ops = chain->tmplt_ops; in __tcf_chain_put()
559 tmplt_priv = chain->tmplt_priv; in __tcf_chain_put()
561 if (non_act_refcnt == chain->explicitly_created && !by_act) { in __tcf_chain_put()
564 chain->index, block, NULL, 0, 0, in __tcf_chain_put()
566 /* Last reference to chain, no need to lock. */ in __tcf_chain_put()
567 chain->flushing = false; in __tcf_chain_put()
571 free_block = tcf_chain_detach(chain); in __tcf_chain_put()
576 tcf_chain_destroy(chain, free_block); in __tcf_chain_put()
580 static void tcf_chain_put(struct tcf_chain *chain) in tcf_chain_put() argument
582 __tcf_chain_put(chain, false, false); in tcf_chain_put()
585 void tcf_chain_put_by_act(struct tcf_chain *chain) in tcf_chain_put_by_act() argument
587 __tcf_chain_put(chain, true, false); in tcf_chain_put_by_act()
591 static void tcf_chain_put_explicitly_created(struct tcf_chain *chain) in tcf_chain_put_explicitly_created() argument
593 __tcf_chain_put(chain, false, true); in tcf_chain_put_explicitly_created()
596 static void tcf_chain_flush(struct tcf_chain *chain, bool rtnl_held) in tcf_chain_flush() argument
600 mutex_lock(&chain->filter_chain_lock); in tcf_chain_flush()
601 tp = tcf_chain_dereference(chain->filter_chain, chain); in tcf_chain_flush()
604 tcf_proto_signal_destroying(chain, tp); in tcf_chain_flush()
607 tp = tcf_chain_dereference(chain->filter_chain, chain); in tcf_chain_flush()
608 RCU_INIT_POINTER(chain->filter_chain, NULL); in tcf_chain_flush()
609 tcf_chain0_head_change(chain, NULL); in tcf_chain_flush()
610 chain->flushing = true; in tcf_chain_flush()
611 mutex_unlock(&chain->filter_chain_lock); in tcf_chain_flush()
777 chain0 = block->chain0.chain; in tcf_chain0_head_change_cb_add()
815 if (block->chain0.chain) in tcf_chain0_head_change_cb_del()
910 __tcf_get_next_chain(struct tcf_block *block, struct tcf_chain *chain) in __tcf_get_next_chain() argument
913 if (chain) in __tcf_get_next_chain()
914 chain = list_is_last(&chain->list, &block->chain_list) ? in __tcf_get_next_chain()
915 NULL : list_next_entry(chain, list); in __tcf_get_next_chain()
917 chain = list_first_entry_or_null(&block->chain_list, in __tcf_get_next_chain()
921 while (chain && tcf_chain_held_by_acts_only(chain)) in __tcf_get_next_chain()
922 chain = list_is_last(&chain->list, &block->chain_list) ? in __tcf_get_next_chain()
923 NULL : list_next_entry(chain, list); in __tcf_get_next_chain()
925 if (chain) in __tcf_get_next_chain()
926 tcf_chain_hold(chain); in __tcf_get_next_chain()
929 return chain; in __tcf_get_next_chain()
933 * block. It properly obtains block->lock and takes reference to chain before
934 * returning it. Users of this function must be tolerant to concurrent chain
935 * insertion/deletion or ensure that no concurrent chain modification is
942 tcf_get_next_chain(struct tcf_block *block, struct tcf_chain *chain) in tcf_get_next_chain() argument
944 struct tcf_chain *chain_next = __tcf_get_next_chain(block, chain); in tcf_get_next_chain()
946 if (chain) in tcf_get_next_chain()
947 tcf_chain_put(chain); in tcf_get_next_chain()
954 __tcf_get_next_proto(struct tcf_chain *chain, struct tcf_proto *tp) in __tcf_get_next_proto() argument
959 mutex_lock(&chain->filter_chain_lock); in __tcf_get_next_proto()
962 tp = tcf_chain_dereference(chain->filter_chain, chain); in __tcf_get_next_proto()
964 /* 'deleting' flag is set and chain->filter_chain_lock was in __tcf_get_next_proto()
969 tp = tcf_chain_dereference(chain->filter_chain, chain); in __tcf_get_next_proto()
971 for (; tp; tp = tcf_chain_dereference(tp->next, chain)) in __tcf_get_next_proto()
975 tp = tcf_chain_dereference(tp->next, chain); in __tcf_get_next_proto()
981 mutex_unlock(&chain->filter_chain_lock); in __tcf_get_next_proto()
987 * chain. Users of this function must be tolerant to concurrent tp
988 * insertion/deletion or ensure that no concurrent chain modification is
995 tcf_get_next_proto(struct tcf_chain *chain, struct tcf_proto *tp, in tcf_get_next_proto() argument
998 struct tcf_proto *tp_next = __tcf_get_next_proto(chain, tp); in tcf_get_next_proto()
1009 struct tcf_chain *chain; in tcf_block_flush_all_chains() local
1014 for (chain = tcf_get_next_chain(block, NULL); in tcf_block_flush_all_chains()
1015 chain; in tcf_block_flush_all_chains()
1016 chain = tcf_get_next_chain(block, chain)) { in tcf_block_flush_all_chains()
1017 tcf_chain_put_explicitly_created(chain); in tcf_block_flush_all_chains()
1018 tcf_chain_flush(chain, rtnl_held); in tcf_block_flush_all_chains()
1163 * deallocated when last chain is freed. However, if chain_list in __tcf_block_put()
1374 /* XXX: Standalone actions are not allowed to jump to any chain, and bound
1405 struct tcf_chain *chain, *chain_prev; in tcf_block_playback_offloads() local
1411 for (chain = __tcf_get_next_chain(block, NULL); in tcf_block_playback_offloads()
1412 chain; in tcf_block_playback_offloads()
1413 chain_prev = chain, in tcf_block_playback_offloads()
1414 chain = __tcf_get_next_chain(block, chain), in tcf_block_playback_offloads()
1416 for (tp = __tcf_get_next_proto(chain, NULL); tp; in tcf_block_playback_offloads()
1418 tp = __tcf_get_next_proto(chain, tp), in tcf_block_playback_offloads()
1437 tcf_chain_put(chain); in tcf_block_playback_offloads()
1525 /* Main classifier routine: scans classifier chain attached
1555 *last_executed_chain = first_tp->chain->index; in __tcf_classify()
1572 tp->chain->block->index, in __tcf_classify()
1604 u32 last_executed_chain = tp ? tp->chain->index : 0; in tcf_classify_ingress()
1611 if (ext && ext->chain) { in tcf_classify_ingress()
1614 fchain = tcf_chain_lookup_rcu(ingress_block, ext->chain); in tcf_classify_ingress()
1628 /* If we missed on some chain */ in tcf_classify_ingress()
1633 ext->chain = last_executed_chain; in tcf_classify_ingress()
1647 static struct tcf_proto *tcf_chain_tp_prev(struct tcf_chain *chain, in tcf_chain_tp_prev() argument
1650 return tcf_chain_dereference(*chain_info->pprev, chain); in tcf_chain_tp_prev()
1653 static int tcf_chain_tp_insert(struct tcf_chain *chain, in tcf_chain_tp_insert() argument
1657 if (chain->flushing) in tcf_chain_tp_insert()
1660 RCU_INIT_POINTER(tp->next, tcf_chain_tp_prev(chain, chain_info)); in tcf_chain_tp_insert()
1661 if (*chain_info->pprev == chain->filter_chain) in tcf_chain_tp_insert()
1662 tcf_chain0_head_change(chain, tp); in tcf_chain_tp_insert()
1669 static void tcf_chain_tp_remove(struct tcf_chain *chain, in tcf_chain_tp_remove() argument
1673 struct tcf_proto *next = tcf_chain_dereference(chain_info->next, chain); in tcf_chain_tp_remove()
1676 if (tp == chain->filter_chain) in tcf_chain_tp_remove()
1677 tcf_chain0_head_change(chain, next); in tcf_chain_tp_remove()
1681 static struct tcf_proto *tcf_chain_tp_find(struct tcf_chain *chain,
1691 static struct tcf_proto *tcf_chain_tp_insert_unique(struct tcf_chain *chain, in tcf_chain_tp_insert_unique() argument
1700 mutex_lock(&chain->filter_chain_lock); in tcf_chain_tp_insert_unique()
1702 if (tcf_proto_exists_destroying(chain, tp_new)) { in tcf_chain_tp_insert_unique()
1703 mutex_unlock(&chain->filter_chain_lock); in tcf_chain_tp_insert_unique()
1708 tp = tcf_chain_tp_find(chain, &chain_info, in tcf_chain_tp_insert_unique()
1711 err = tcf_chain_tp_insert(chain, &chain_info, tp_new); in tcf_chain_tp_insert_unique()
1712 mutex_unlock(&chain->filter_chain_lock); in tcf_chain_tp_insert_unique()
1725 static void tcf_chain_tp_delete_empty(struct tcf_chain *chain, in tcf_chain_tp_delete_empty() argument
1734 mutex_lock(&chain->filter_chain_lock); in tcf_chain_tp_delete_empty()
1736 /* Atomically find and remove tp from chain. */ in tcf_chain_tp_delete_empty()
1737 for (pprev = &chain->filter_chain; in tcf_chain_tp_delete_empty()
1738 (tp_iter = tcf_chain_dereference(*pprev, chain)); in tcf_chain_tp_delete_empty()
1752 mutex_unlock(&chain->filter_chain_lock); in tcf_chain_tp_delete_empty()
1756 tcf_proto_signal_destroying(chain, tp); in tcf_chain_tp_delete_empty()
1757 next = tcf_chain_dereference(chain_info.next, chain); in tcf_chain_tp_delete_empty()
1758 if (tp == chain->filter_chain) in tcf_chain_tp_delete_empty()
1759 tcf_chain0_head_change(chain, next); in tcf_chain_tp_delete_empty()
1761 mutex_unlock(&chain->filter_chain_lock); in tcf_chain_tp_delete_empty()
1766 static struct tcf_proto *tcf_chain_tp_find(struct tcf_chain *chain, in tcf_chain_tp_find() argument
1774 /* Check the chain for existence of proto-tcf with this priority */ in tcf_chain_tp_find()
1775 for (pprev = &chain->filter_chain; in tcf_chain_tp_find()
1776 (tp = tcf_chain_dereference(*pprev, chain)); in tcf_chain_tp_find()
1826 if (nla_put_u32(skb, TCA_CHAIN, tp->chain->index)) in tcf_fill_node()
1929 struct tcf_chain *chain, int event, in tfilter_notify_chain() argument
1934 for (tp = tcf_get_next_proto(chain, NULL, rtnl_held); in tfilter_notify_chain()
1935 tp; tp = tcf_get_next_proto(chain, tp, rtnl_held)) in tfilter_notify_chain()
1960 struct tcf_chain *chain; in tc_new_tfilter() local
1989 chain = NULL; in tc_new_tfilter()
2004 /* Find head of filter chain. */ in tc_new_tfilter()
2041 NL_SET_ERR_MSG(extack, "Specified chain index exceeds upper limit"); in tc_new_tfilter()
2045 chain = tcf_chain_get(block, chain_index, true); in tc_new_tfilter()
2046 if (!chain) { in tc_new_tfilter()
2047 NL_SET_ERR_MSG(extack, "Cannot create specified filter chain"); in tc_new_tfilter()
2052 mutex_lock(&chain->filter_chain_lock); in tc_new_tfilter()
2053 tp = tcf_chain_tp_find(chain, &chain_info, protocol, in tc_new_tfilter()
2064 if (chain->flushing) { in tc_new_tfilter()
2084 prio = tcf_auto_prio(tcf_chain_tp_prev(chain, in tc_new_tfilter()
2087 mutex_unlock(&chain->filter_chain_lock); in tc_new_tfilter()
2088 tp_new = tcf_proto_create(name, protocol, prio, chain, in tc_new_tfilter()
2096 tp = tcf_chain_tp_insert_unique(chain, tp_new, protocol, prio, in tc_new_tfilter()
2103 mutex_unlock(&chain->filter_chain_lock); in tc_new_tfilter()
2127 if (chain->tmplt_ops && chain->tmplt_ops != tp->ops) { in tc_new_tfilter()
2129 NL_SET_ERR_MSG(extack, "Chain template is set to a different filter kind"); in tc_new_tfilter()
2148 tcf_chain_tp_delete_empty(chain, tp, rtnl_held, NULL); in tc_new_tfilter()
2150 if (chain) { in tc_new_tfilter()
2154 tcf_chain_put(chain); in tc_new_tfilter()
2163 * of target chain. in tc_new_tfilter()
2172 mutex_unlock(&chain->filter_chain_lock); in tc_new_tfilter()
2189 struct tcf_chain *chain = NULL; in tc_del_tfilter() local
2215 /* Find head of filter chain. */ in tc_del_tfilter()
2226 /* Take rtnl mutex if flushing whole chain, block is shared (no qdisc in tc_del_tfilter()
2250 NL_SET_ERR_MSG(extack, "Specified chain index exceeds upper limit"); in tc_del_tfilter()
2254 chain = tcf_chain_get(block, chain_index, false); in tc_del_tfilter()
2255 if (!chain) { in tc_del_tfilter()
2256 /* User requested flush on non-existent chain. Nothing to do, in tc_del_tfilter()
2263 NL_SET_ERR_MSG(extack, "Cannot find specified filter chain"); in tc_del_tfilter()
2270 chain, RTM_DELTFILTER, rtnl_held); in tc_del_tfilter()
2271 tcf_chain_flush(chain, rtnl_held); in tc_del_tfilter()
2276 mutex_lock(&chain->filter_chain_lock); in tc_del_tfilter()
2277 tp = tcf_chain_tp_find(chain, &chain_info, protocol, in tc_del_tfilter()
2288 tcf_proto_signal_destroying(chain, tp); in tc_del_tfilter()
2289 tcf_chain_tp_remove(chain, &chain_info, tp); in tc_del_tfilter()
2290 mutex_unlock(&chain->filter_chain_lock); in tc_del_tfilter()
2298 mutex_unlock(&chain->filter_chain_lock); in tc_del_tfilter()
2315 tcf_chain_tp_delete_empty(chain, tp, rtnl_held, extack); in tc_del_tfilter()
2319 if (chain) { in tc_del_tfilter()
2322 tcf_chain_put(chain); in tc_del_tfilter()
2332 mutex_unlock(&chain->filter_chain_lock); in tc_del_tfilter()
2349 struct tcf_chain *chain = NULL; in tc_get_tfilter() local
2372 /* Find head of filter chain. */ in tc_get_tfilter()
2406 NL_SET_ERR_MSG(extack, "Specified chain index exceeds upper limit"); in tc_get_tfilter()
2410 chain = tcf_chain_get(block, chain_index, false); in tc_get_tfilter()
2411 if (!chain) { in tc_get_tfilter()
2412 NL_SET_ERR_MSG(extack, "Cannot find specified filter chain"); in tc_get_tfilter()
2417 mutex_lock(&chain->filter_chain_lock); in tc_get_tfilter()
2418 tp = tcf_chain_tp_find(chain, &chain_info, protocol, in tc_get_tfilter()
2420 mutex_unlock(&chain->filter_chain_lock); in tc_get_tfilter()
2445 if (chain) { in tc_get_tfilter()
2448 tcf_chain_put(chain); in tc_get_tfilter()
2479 static bool tcf_chain_dump(struct tcf_chain *chain, struct Qdisc *q, u32 parent, in tcf_chain_dump() argument
2484 struct tcf_block *block = chain->block; in tcf_chain_dump()
2489 for (tp = __tcf_get_next_proto(chain, NULL); in tcf_chain_dump()
2492 tp = __tcf_get_next_proto(chain, tp), in tcf_chain_dump()
2547 struct tcf_chain *chain, *chain_prev; in tc_dump_tfilter() local
2622 for (chain = __tcf_get_next_chain(block, NULL); in tc_dump_tfilter()
2623 chain; in tc_dump_tfilter()
2624 chain_prev = chain, in tc_dump_tfilter()
2625 chain = __tcf_get_next_chain(block, chain), in tc_dump_tfilter()
2628 nla_get_u32(tca[TCA_CHAIN]) != chain->index) in tc_dump_tfilter()
2630 if (!tcf_chain_dump(chain, q, parent, skb, cb, in tc_dump_tfilter()
2632 tcf_chain_put(chain); in tc_dump_tfilter()
2699 static int tc_chain_notify(struct tcf_chain *chain, struct sk_buff *oskb, in tc_chain_notify() argument
2703 struct tcf_block *block = chain->block; in tc_chain_notify()
2712 if (tc_chain_fill_node(chain->tmplt_ops, chain->tmplt_priv, in tc_chain_notify()
2713 chain->index, net, skb, block, portid, in tc_chain_notify()
2755 static int tc_chain_tmplt_add(struct tcf_chain *chain, struct net *net, in tc_chain_tmplt_add() argument
2768 NL_SET_ERR_MSG(extack, "Specified TC chain template name too long"); in tc_chain_tmplt_add()
2776 NL_SET_ERR_MSG(extack, "Chain templates are not supported with specified classifier"); in tc_chain_tmplt_add()
2781 tmplt_priv = ops->tmplt_create(net, chain, tca, extack); in tc_chain_tmplt_add()
2786 chain->tmplt_ops = ops; in tc_chain_tmplt_add()
2787 chain->tmplt_priv = tmplt_priv; in tc_chain_tmplt_add()
2802 /* Add/delete/get a chain */
2813 struct tcf_chain *chain; in tc_ctl_chain() local
2840 NL_SET_ERR_MSG(extack, "Specified chain index exceeds upper limit"); in tc_ctl_chain()
2846 chain = tcf_chain_lookup(block, chain_index); in tc_ctl_chain()
2848 if (chain) { in tc_ctl_chain()
2849 if (tcf_chain_held_by_acts_only(chain)) { in tc_ctl_chain()
2850 /* The chain exists only because there is in tc_ctl_chain()
2853 tcf_chain_hold(chain); in tc_ctl_chain()
2855 NL_SET_ERR_MSG(extack, "Filter chain already exists"); in tc_ctl_chain()
2861 NL_SET_ERR_MSG(extack, "Need both RTM_NEWCHAIN and NLM_F_CREATE to create a new chain"); in tc_ctl_chain()
2865 chain = tcf_chain_create(block, chain_index); in tc_ctl_chain()
2866 if (!chain) { in tc_ctl_chain()
2867 NL_SET_ERR_MSG(extack, "Failed to create filter chain"); in tc_ctl_chain()
2873 if (!chain || tcf_chain_held_by_acts_only(chain)) { in tc_ctl_chain()
2874 NL_SET_ERR_MSG(extack, "Cannot find specified filter chain"); in tc_ctl_chain()
2878 tcf_chain_hold(chain); in tc_ctl_chain()
2882 /* Modifying chain requires holding parent block lock. In case in tc_ctl_chain()
2883 * the chain was successfully added, take a reference to the in tc_ctl_chain()
2884 * chain. This ensures that an empty chain does not disappear at in tc_ctl_chain()
2887 tcf_chain_hold(chain); in tc_ctl_chain()
2888 chain->explicitly_created = true; in tc_ctl_chain()
2894 err = tc_chain_tmplt_add(chain, net, tca, extack); in tc_ctl_chain()
2896 tcf_chain_put_explicitly_created(chain); in tc_ctl_chain()
2900 tc_chain_notify(chain, NULL, 0, NLM_F_CREATE | NLM_F_EXCL, in tc_ctl_chain()
2905 chain, RTM_DELTFILTER, true); in tc_ctl_chain()
2906 /* Flush the chain first as the user requested chain removal. */ in tc_ctl_chain()
2907 tcf_chain_flush(chain, true); in tc_ctl_chain()
2908 /* In case the chain was successfully deleted, put a reference in tc_ctl_chain()
2909 * to the chain previously taken during addition. in tc_ctl_chain()
2911 tcf_chain_put_explicitly_created(chain); in tc_ctl_chain()
2914 err = tc_chain_notify(chain, skb, n->nlmsg_seq, in tc_ctl_chain()
2917 NL_SET_ERR_MSG(extack, "Failed to send chain notify message"); in tc_ctl_chain()
2926 tcf_chain_put(chain); in tc_ctl_chain()
2947 struct tcf_chain *chain; in tc_dump_chain() local
3011 list_for_each_entry(chain, &block->chain_list, list) { in tc_dump_chain()
3013 nla_get_u32(tca[TCA_CHAIN]) != chain->index)) in tc_dump_chain()
3019 if (tcf_chain_held_by_acts_only(chain)) in tc_dump_chain()
3021 err = tc_chain_fill_node(chain->tmplt_ops, chain->tmplt_priv, in tc_dump_chain()
3022 chain->index, net, skb, block, in tc_dump_chain()