Lines Matching full:chain

54 	return jhash_3words(tp->chain->index, tp->prio,  in destroy_obj_hashfn()
58 static void tcf_proto_signal_destroying(struct tcf_chain *chain, in tcf_proto_signal_destroying() argument
61 struct tcf_block *block = chain->block; in tcf_proto_signal_destroying()
72 return tp1->chain->index == tp2->chain->index && in tcf_proto_cmp()
77 static bool tcf_proto_exists_destroying(struct tcf_chain *chain, in tcf_proto_exists_destroying() argument
85 hash_for_each_possible_rcu(chain->block->proto_destroy_ht, iter, in tcf_proto_exists_destroying()
98 tcf_proto_signal_destroyed(struct tcf_chain *chain, struct tcf_proto *tp) in tcf_proto_signal_destroyed() argument
100 struct tcf_block *block = chain->block; in tcf_proto_signal_destroyed()
252 u32 prio, struct tcf_chain *chain, in tcf_proto_create() argument
271 tp->chain = chain; in tcf_proto_create()
292 static void tcf_chain_put(struct tcf_chain *chain);
299 tcf_proto_signal_destroyed(tp->chain, tp); in tcf_proto_destroy()
300 tcf_chain_put(tp->chain); in tcf_proto_destroy()
351 struct tcf_chain *chain; in tcf_chain_create() local
355 chain = kzalloc(sizeof(*chain), GFP_KERNEL); in tcf_chain_create()
356 if (!chain) in tcf_chain_create()
358 list_add_tail_rcu(&chain->list, &block->chain_list); in tcf_chain_create()
359 mutex_init(&chain->filter_chain_lock); in tcf_chain_create()
360 chain->block = block; in tcf_chain_create()
361 chain->index = chain_index; in tcf_chain_create()
362 chain->refcnt = 1; in tcf_chain_create()
363 if (!chain->index) in tcf_chain_create()
364 block->chain0.chain = chain; in tcf_chain_create()
365 return chain; in tcf_chain_create()
375 static void tcf_chain0_head_change(struct tcf_chain *chain, in tcf_chain0_head_change() argument
379 struct tcf_block *block = chain->block; in tcf_chain0_head_change()
381 if (chain->index) in tcf_chain0_head_change()
392 static bool tcf_chain_detach(struct tcf_chain *chain) in tcf_chain_detach() argument
394 struct tcf_block *block = chain->block; in tcf_chain_detach()
398 list_del_rcu(&chain->list); in tcf_chain_detach()
399 if (!chain->index) in tcf_chain_detach()
400 block->chain0.chain = NULL; in tcf_chain_detach()
416 static void tcf_chain_destroy(struct tcf_chain *chain, bool free_block) in tcf_chain_destroy() argument
418 struct tcf_block *block = chain->block; in tcf_chain_destroy()
420 mutex_destroy(&chain->filter_chain_lock); in tcf_chain_destroy()
421 kfree_rcu(chain, rcu); in tcf_chain_destroy()
426 static void tcf_chain_hold(struct tcf_chain *chain) in tcf_chain_hold() argument
428 ASSERT_BLOCK_LOCKED(chain->block); in tcf_chain_hold()
430 ++chain->refcnt; in tcf_chain_hold()
433 static bool tcf_chain_held_by_acts_only(struct tcf_chain *chain) in tcf_chain_held_by_acts_only() argument
435 ASSERT_BLOCK_LOCKED(chain->block); in tcf_chain_held_by_acts_only()
438 * chain should not be shown to the user. in tcf_chain_held_by_acts_only()
440 return chain->refcnt == chain->action_refcnt; in tcf_chain_held_by_acts_only()
446 struct tcf_chain *chain; in tcf_chain_lookup() local
450 list_for_each_entry(chain, &block->chain_list, list) { in tcf_chain_lookup()
451 if (chain->index == chain_index) in tcf_chain_lookup()
452 return chain; in tcf_chain_lookup()
461 struct tcf_chain *chain; in tcf_chain_lookup_rcu() local
463 list_for_each_entry_rcu(chain, &block->chain_list, list) { in tcf_chain_lookup_rcu()
464 if (chain->index == chain_index) in tcf_chain_lookup_rcu()
465 return chain; in tcf_chain_lookup_rcu()
471 static int tc_chain_notify(struct tcf_chain *chain, struct sk_buff *oskb,
478 struct tcf_chain *chain = NULL; in __tcf_chain_get() local
482 chain = tcf_chain_lookup(block, chain_index); in __tcf_chain_get()
483 if (chain) { in __tcf_chain_get()
484 tcf_chain_hold(chain); in __tcf_chain_get()
488 chain = tcf_chain_create(block, chain_index); in __tcf_chain_get()
489 if (!chain) in __tcf_chain_get()
494 ++chain->action_refcnt; in __tcf_chain_get()
495 is_first_reference = chain->refcnt - chain->action_refcnt == 1; in __tcf_chain_get()
499 * non-action reference. Until then, the chain acts only as in __tcf_chain_get()
504 tc_chain_notify(chain, NULL, 0, NLM_F_CREATE | NLM_F_EXCL, in __tcf_chain_get()
507 return chain; in __tcf_chain_get()
511 return chain; in __tcf_chain_get()
533 static void __tcf_chain_put(struct tcf_chain *chain, bool by_act, in __tcf_chain_put() argument
536 struct tcf_block *block = chain->block; in __tcf_chain_put()
544 if (!chain->explicitly_created) { in __tcf_chain_put()
548 chain->explicitly_created = false; in __tcf_chain_put()
552 chain->action_refcnt--; in __tcf_chain_put()
555 * However, when block is unlocked chain can be changed concurrently, so in __tcf_chain_put()
558 refcnt = --chain->refcnt; in __tcf_chain_put()
559 tmplt_ops = chain->tmplt_ops; in __tcf_chain_put()
560 tmplt_priv = chain->tmplt_priv; in __tcf_chain_put()
563 if (refcnt - chain->action_refcnt == 0 && !by_act) { in __tcf_chain_put()
564 tc_chain_notify_delete(tmplt_ops, tmplt_priv, chain->index, 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
997 struct tcf_proto *tp_next = __tcf_get_next_proto(chain, tp); in tcf_get_next_proto()
1008 struct tcf_chain *chain; in tcf_block_flush_all_chains() local
1013 for (chain = tcf_get_next_chain(block, NULL); in tcf_block_flush_all_chains()
1014 chain; in tcf_block_flush_all_chains()
1015 chain = tcf_get_next_chain(block, chain)) { in tcf_block_flush_all_chains()
1016 tcf_chain_put_explicitly_created(chain); in tcf_block_flush_all_chains()
1017 tcf_chain_flush(chain, rtnl_held); in tcf_block_flush_all_chains()
1162 * deallocated when last chain is freed. However, if chain_list in __tcf_block_put()
1373 /* XXX: Standalone actions are not allowed to jump to any chain, and bound
1404 struct tcf_chain *chain, *chain_prev; in tcf_block_playback_offloads() local
1410 for (chain = __tcf_get_next_chain(block, NULL); in tcf_block_playback_offloads()
1411 chain; in tcf_block_playback_offloads()
1412 chain_prev = chain, in tcf_block_playback_offloads()
1413 chain = __tcf_get_next_chain(block, chain), in tcf_block_playback_offloads()
1415 for (tp = __tcf_get_next_proto(chain, NULL); tp; in tcf_block_playback_offloads()
1417 tp = __tcf_get_next_proto(chain, tp), in tcf_block_playback_offloads()
1436 tcf_chain_put(chain); in tcf_block_playback_offloads()
1523 /* Main classifier routine: scans classifier chain attached
1553 *last_executed_chain = first_tp->chain->index; in __tcf_classify()
1570 tp->chain->block->index, in __tcf_classify()
1592 u32 last_executed_chain = tp ? tp->chain->index : 0; in tcf_classify()
1600 if (ext && ext->chain) { in tcf_classify()
1603 fchain = tcf_chain_lookup_rcu(block, ext->chain); in tcf_classify()
1618 /* If we missed on some chain */ in tcf_classify()
1623 ext->chain = last_executed_chain; in tcf_classify()
1638 static struct tcf_proto *tcf_chain_tp_prev(struct tcf_chain *chain, in tcf_chain_tp_prev() argument
1641 return tcf_chain_dereference(*chain_info->pprev, chain); in tcf_chain_tp_prev()
1644 static int tcf_chain_tp_insert(struct tcf_chain *chain, in tcf_chain_tp_insert() argument
1648 if (chain->flushing) in tcf_chain_tp_insert()
1651 if (*chain_info->pprev == chain->filter_chain) in tcf_chain_tp_insert()
1652 tcf_chain0_head_change(chain, tp); in tcf_chain_tp_insert()
1654 RCU_INIT_POINTER(tp->next, tcf_chain_tp_prev(chain, chain_info)); in tcf_chain_tp_insert()
1660 static void tcf_chain_tp_remove(struct tcf_chain *chain, in tcf_chain_tp_remove() argument
1664 struct tcf_proto *next = tcf_chain_dereference(chain_info->next, chain); in tcf_chain_tp_remove()
1667 if (tp == chain->filter_chain) in tcf_chain_tp_remove()
1668 tcf_chain0_head_change(chain, next); in tcf_chain_tp_remove()
1672 static struct tcf_proto *tcf_chain_tp_find(struct tcf_chain *chain,
1682 static struct tcf_proto *tcf_chain_tp_insert_unique(struct tcf_chain *chain, in tcf_chain_tp_insert_unique() argument
1691 mutex_lock(&chain->filter_chain_lock); in tcf_chain_tp_insert_unique()
1693 if (tcf_proto_exists_destroying(chain, tp_new)) { in tcf_chain_tp_insert_unique()
1694 mutex_unlock(&chain->filter_chain_lock); in tcf_chain_tp_insert_unique()
1699 tp = tcf_chain_tp_find(chain, &chain_info, in tcf_chain_tp_insert_unique()
1702 err = tcf_chain_tp_insert(chain, &chain_info, tp_new); in tcf_chain_tp_insert_unique()
1703 mutex_unlock(&chain->filter_chain_lock); in tcf_chain_tp_insert_unique()
1716 static void tcf_chain_tp_delete_empty(struct tcf_chain *chain, in tcf_chain_tp_delete_empty() argument
1725 mutex_lock(&chain->filter_chain_lock); in tcf_chain_tp_delete_empty()
1727 /* Atomically find and remove tp from chain. */ in tcf_chain_tp_delete_empty()
1728 for (pprev = &chain->filter_chain; in tcf_chain_tp_delete_empty()
1729 (tp_iter = tcf_chain_dereference(*pprev, chain)); in tcf_chain_tp_delete_empty()
1743 mutex_unlock(&chain->filter_chain_lock); in tcf_chain_tp_delete_empty()
1747 tcf_proto_signal_destroying(chain, tp); in tcf_chain_tp_delete_empty()
1748 next = tcf_chain_dereference(chain_info.next, chain); in tcf_chain_tp_delete_empty()
1749 if (tp == chain->filter_chain) in tcf_chain_tp_delete_empty()
1750 tcf_chain0_head_change(chain, next); in tcf_chain_tp_delete_empty()
1752 mutex_unlock(&chain->filter_chain_lock); in tcf_chain_tp_delete_empty()
1757 static struct tcf_proto *tcf_chain_tp_find(struct tcf_chain *chain, in tcf_chain_tp_find() argument
1765 /* Check the chain for existence of proto-tcf with this priority */ in tcf_chain_tp_find()
1766 for (pprev = &chain->filter_chain; in tcf_chain_tp_find()
1767 (tp = tcf_chain_dereference(*pprev, chain)); in tcf_chain_tp_find()
1817 if (nla_put_u32(skb, TCA_CHAIN, tp->chain->index)) in tcf_fill_node()
1915 struct tcf_chain *chain, int event) in tfilter_notify_chain() argument
1919 for (tp = tcf_get_next_proto(chain, NULL); in tfilter_notify_chain()
1920 tp; tp = tcf_get_next_proto(chain, tp)) in tfilter_notify_chain()
1945 struct tcf_chain *chain = NULL; in tc_new_tfilter() local
1989 /* Find head of filter chain. */ in tc_new_tfilter()
2026 NL_SET_ERR_MSG(extack, "Specified chain index exceeds upper limit"); in tc_new_tfilter()
2030 chain = tcf_chain_get(block, chain_index, true); in tc_new_tfilter()
2031 if (!chain) { in tc_new_tfilter()
2032 NL_SET_ERR_MSG(extack, "Cannot create specified filter chain"); in tc_new_tfilter()
2037 mutex_lock(&chain->filter_chain_lock); in tc_new_tfilter()
2038 tp = tcf_chain_tp_find(chain, &chain_info, protocol, in tc_new_tfilter()
2049 if (chain->flushing) { in tc_new_tfilter()
2069 prio = tcf_auto_prio(tcf_chain_tp_prev(chain, in tc_new_tfilter()
2072 mutex_unlock(&chain->filter_chain_lock); in tc_new_tfilter()
2073 tp_new = tcf_proto_create(name, protocol, prio, chain, in tc_new_tfilter()
2081 tp = tcf_chain_tp_insert_unique(chain, tp_new, protocol, prio, in tc_new_tfilter()
2088 mutex_unlock(&chain->filter_chain_lock); in tc_new_tfilter()
2112 if (chain->tmplt_ops && chain->tmplt_ops != tp->ops) { in tc_new_tfilter()
2113 NL_SET_ERR_MSG(extack, "Chain template is set to a different filter kind"); in tc_new_tfilter()
2135 tcf_chain_tp_delete_empty(chain, tp, rtnl_held, NULL); in tc_new_tfilter()
2137 if (chain) { in tc_new_tfilter()
2141 tcf_chain_put(chain); in tc_new_tfilter()
2150 * of target chain. in tc_new_tfilter()
2159 mutex_unlock(&chain->filter_chain_lock); in tc_new_tfilter()
2176 struct tcf_chain *chain = NULL; in tc_del_tfilter() local
2202 /* Find head of filter chain. */ in tc_del_tfilter()
2213 /* Take rtnl mutex if flushing whole chain, block is shared (no qdisc in tc_del_tfilter()
2237 NL_SET_ERR_MSG(extack, "Specified chain index exceeds upper limit"); in tc_del_tfilter()
2241 chain = tcf_chain_get(block, chain_index, false); in tc_del_tfilter()
2242 if (!chain) { in tc_del_tfilter()
2243 /* User requested flush on non-existent chain. Nothing to do, in tc_del_tfilter()
2250 NL_SET_ERR_MSG(extack, "Cannot find specified filter chain"); in tc_del_tfilter()
2257 chain, RTM_DELTFILTER); in tc_del_tfilter()
2258 tcf_chain_flush(chain, rtnl_held); in tc_del_tfilter()
2263 mutex_lock(&chain->filter_chain_lock); in tc_del_tfilter()
2264 tp = tcf_chain_tp_find(chain, &chain_info, protocol, in tc_del_tfilter()
2275 tcf_proto_signal_destroying(chain, tp); in tc_del_tfilter()
2276 tcf_chain_tp_remove(chain, &chain_info, tp); in tc_del_tfilter()
2277 mutex_unlock(&chain->filter_chain_lock); in tc_del_tfilter()
2285 mutex_unlock(&chain->filter_chain_lock); in tc_del_tfilter()
2302 tcf_chain_tp_delete_empty(chain, tp, rtnl_held, extack); in tc_del_tfilter()
2306 if (chain) { in tc_del_tfilter()
2309 tcf_chain_put(chain); in tc_del_tfilter()
2319 mutex_unlock(&chain->filter_chain_lock); in tc_del_tfilter()
2336 struct tcf_chain *chain = NULL; in tc_get_tfilter() local
2359 /* Find head of filter chain. */ in tc_get_tfilter()
2393 NL_SET_ERR_MSG(extack, "Specified chain index exceeds upper limit"); in tc_get_tfilter()
2397 chain = tcf_chain_get(block, chain_index, false); in tc_get_tfilter()
2398 if (!chain) { in tc_get_tfilter()
2399 NL_SET_ERR_MSG(extack, "Cannot find specified filter chain"); in tc_get_tfilter()
2404 mutex_lock(&chain->filter_chain_lock); in tc_get_tfilter()
2405 tp = tcf_chain_tp_find(chain, &chain_info, protocol, in tc_get_tfilter()
2407 mutex_unlock(&chain->filter_chain_lock); in tc_get_tfilter()
2432 if (chain) { in tc_get_tfilter()
2435 tcf_chain_put(chain); in tc_get_tfilter()
2466 static bool tcf_chain_dump(struct tcf_chain *chain, struct Qdisc *q, u32 parent, in tcf_chain_dump() argument
2471 struct tcf_block *block = chain->block; in tcf_chain_dump()
2476 for (tp = __tcf_get_next_proto(chain, NULL); in tcf_chain_dump()
2479 tp = __tcf_get_next_proto(chain, tp), in tcf_chain_dump()
2534 struct tcf_chain *chain, *chain_prev; in tc_dump_tfilter() local
2609 for (chain = __tcf_get_next_chain(block, NULL); in tc_dump_tfilter()
2610 chain; in tc_dump_tfilter()
2611 chain_prev = chain, in tc_dump_tfilter()
2612 chain = __tcf_get_next_chain(block, chain), in tc_dump_tfilter()
2615 nla_get_u32(tca[TCA_CHAIN]) != chain->index) in tc_dump_tfilter()
2617 if (!tcf_chain_dump(chain, q, parent, skb, cb, in tc_dump_tfilter()
2619 tcf_chain_put(chain); in tc_dump_tfilter()
2686 static int tc_chain_notify(struct tcf_chain *chain, struct sk_buff *oskb, in tc_chain_notify() argument
2690 struct tcf_block *block = chain->block; in tc_chain_notify()
2699 if (tc_chain_fill_node(chain->tmplt_ops, chain->tmplt_priv, in tc_chain_notify()
2700 chain->index, net, skb, block, portid, in tc_chain_notify()
2740 static int tc_chain_tmplt_add(struct tcf_chain *chain, struct net *net, in tc_chain_tmplt_add() argument
2753 NL_SET_ERR_MSG(extack, "Specified TC chain template name too long"); in tc_chain_tmplt_add()
2761 NL_SET_ERR_MSG(extack, "Chain templates are not supported with specified classifier"); in tc_chain_tmplt_add()
2765 tmplt_priv = ops->tmplt_create(net, chain, tca, extack); in tc_chain_tmplt_add()
2770 chain->tmplt_ops = ops; in tc_chain_tmplt_add()
2771 chain->tmplt_priv = tmplt_priv; in tc_chain_tmplt_add()
2786 /* Add/delete/get a chain */
2797 struct tcf_chain *chain = NULL; in tc_ctl_chain() local
2823 NL_SET_ERR_MSG(extack, "Specified chain index exceeds upper limit"); in tc_ctl_chain()
2829 chain = tcf_chain_lookup(block, chain_index); in tc_ctl_chain()
2831 if (chain) { in tc_ctl_chain()
2832 if (tcf_chain_held_by_acts_only(chain)) { in tc_ctl_chain()
2833 /* The chain exists only because there is in tc_ctl_chain()
2836 tcf_chain_hold(chain); in tc_ctl_chain()
2838 NL_SET_ERR_MSG(extack, "Filter chain already exists"); in tc_ctl_chain()
2844 NL_SET_ERR_MSG(extack, "Need both RTM_NEWCHAIN and NLM_F_CREATE to create a new chain"); in tc_ctl_chain()
2848 chain = tcf_chain_create(block, chain_index); in tc_ctl_chain()
2849 if (!chain) { in tc_ctl_chain()
2850 NL_SET_ERR_MSG(extack, "Failed to create filter chain"); in tc_ctl_chain()
2856 if (!chain || tcf_chain_held_by_acts_only(chain)) { in tc_ctl_chain()
2857 NL_SET_ERR_MSG(extack, "Cannot find specified filter chain"); in tc_ctl_chain()
2861 tcf_chain_hold(chain); in tc_ctl_chain()
2865 /* Modifying chain requires holding parent block lock. In case in tc_ctl_chain()
2866 * the chain was successfully added, take a reference to the in tc_ctl_chain()
2867 * chain. This ensures that an empty chain does not disappear at in tc_ctl_chain()
2870 tcf_chain_hold(chain); in tc_ctl_chain()
2871 chain->explicitly_created = true; in tc_ctl_chain()
2877 err = tc_chain_tmplt_add(chain, net, tca, extack); in tc_ctl_chain()
2879 tcf_chain_put_explicitly_created(chain); in tc_ctl_chain()
2883 tc_chain_notify(chain, NULL, 0, NLM_F_CREATE | NLM_F_EXCL, in tc_ctl_chain()
2888 chain, RTM_DELTFILTER); in tc_ctl_chain()
2889 /* Flush the chain first as the user requested chain removal. */ in tc_ctl_chain()
2890 tcf_chain_flush(chain, true); in tc_ctl_chain()
2891 /* In case the chain was successfully deleted, put a reference in tc_ctl_chain()
2892 * to the chain previously taken during addition. in tc_ctl_chain()
2894 tcf_chain_put_explicitly_created(chain); in tc_ctl_chain()
2897 err = tc_chain_notify(chain, skb, n->nlmsg_seq, in tc_ctl_chain()
2900 NL_SET_ERR_MSG(extack, "Failed to send chain notify message"); in tc_ctl_chain()
2909 tcf_chain_put(chain); in tc_ctl_chain()
2930 struct tcf_chain *chain; in tc_dump_chain() local
2984 list_for_each_entry(chain, &block->chain_list, list) { in tc_dump_chain()
2986 nla_get_u32(tca[TCA_CHAIN]) != chain->index)) in tc_dump_chain()
2992 if (tcf_chain_held_by_acts_only(chain)) in tc_dump_chain()
2994 err = tc_chain_fill_node(chain->tmplt_ops, chain->tmplt_priv, in tc_dump_chain()
2995 chain->index, net, skb, block, in tc_dump_chain()