Lines Matching full:chain

71 	return jhash_3words(tp->chain->index, tp->prio,  in destroy_obj_hashfn()
75 static void tcf_proto_signal_destroying(struct tcf_chain *chain, in tcf_proto_signal_destroying() argument
78 struct tcf_block *block = chain->block; in tcf_proto_signal_destroying()
89 return tp1->chain->index == tp2->chain->index && in tcf_proto_cmp()
94 static bool tcf_proto_exists_destroying(struct tcf_chain *chain, in tcf_proto_exists_destroying() argument
102 hash_for_each_possible_rcu(chain->block->proto_destroy_ht, iter, in tcf_proto_exists_destroying()
115 tcf_proto_signal_destroyed(struct tcf_chain *chain, struct tcf_proto *tp) in tcf_proto_signal_destroyed() argument
117 struct tcf_block *block = chain->block; in tcf_proto_signal_destroyed()
270 u32 prio, struct tcf_chain *chain, in tcf_proto_create() argument
289 tp->chain = chain; in tcf_proto_create()
310 static void tcf_chain_put(struct tcf_chain *chain);
317 tcf_proto_signal_destroyed(tp->chain, tp); in tcf_proto_destroy()
318 tcf_chain_put(tp->chain); in tcf_proto_destroy()
369 struct tcf_chain *chain; in tcf_chain_create() local
373 chain = kzalloc(sizeof(*chain), GFP_KERNEL); in tcf_chain_create()
374 if (!chain) in tcf_chain_create()
376 list_add_tail_rcu(&chain->list, &block->chain_list); in tcf_chain_create()
377 mutex_init(&chain->filter_chain_lock); in tcf_chain_create()
378 chain->block = block; in tcf_chain_create()
379 chain->index = chain_index; in tcf_chain_create()
380 chain->refcnt = 1; in tcf_chain_create()
381 if (!chain->index) in tcf_chain_create()
382 block->chain0.chain = chain; in tcf_chain_create()
383 return chain; in tcf_chain_create()
393 static void tcf_chain0_head_change(struct tcf_chain *chain, in tcf_chain0_head_change() argument
397 struct tcf_block *block = chain->block; in tcf_chain0_head_change()
399 if (chain->index) in tcf_chain0_head_change()
410 static bool tcf_chain_detach(struct tcf_chain *chain) in tcf_chain_detach() argument
412 struct tcf_block *block = chain->block; in tcf_chain_detach()
416 list_del_rcu(&chain->list); in tcf_chain_detach()
417 if (!chain->index) in tcf_chain_detach()
418 block->chain0.chain = NULL; in tcf_chain_detach()
434 static void tcf_chain_destroy(struct tcf_chain *chain, bool free_block) in tcf_chain_destroy() argument
436 struct tcf_block *block = chain->block; in tcf_chain_destroy()
438 mutex_destroy(&chain->filter_chain_lock); in tcf_chain_destroy()
439 kfree_rcu(chain, rcu); in tcf_chain_destroy()
444 static void tcf_chain_hold(struct tcf_chain *chain) in tcf_chain_hold() argument
446 ASSERT_BLOCK_LOCKED(chain->block); in tcf_chain_hold()
448 ++chain->refcnt; in tcf_chain_hold()
451 static bool tcf_chain_held_by_acts_only(struct tcf_chain *chain) in tcf_chain_held_by_acts_only() argument
453 ASSERT_BLOCK_LOCKED(chain->block); in tcf_chain_held_by_acts_only()
456 * chain should not be shown to the user. in tcf_chain_held_by_acts_only()
458 return chain->refcnt == chain->action_refcnt; in tcf_chain_held_by_acts_only()
464 struct tcf_chain *chain; in tcf_chain_lookup() local
468 list_for_each_entry(chain, &block->chain_list, list) { in tcf_chain_lookup()
469 if (chain->index == chain_index) in tcf_chain_lookup()
470 return chain; in tcf_chain_lookup()
479 struct tcf_chain *chain; in tcf_chain_lookup_rcu() local
481 list_for_each_entry_rcu(chain, &block->chain_list, list) { in tcf_chain_lookup_rcu()
482 if (chain->index == chain_index) in tcf_chain_lookup_rcu()
483 return chain; in tcf_chain_lookup_rcu()
489 static int tc_chain_notify(struct tcf_chain *chain, struct sk_buff *oskb,
496 struct tcf_chain *chain = NULL; in __tcf_chain_get() local
500 chain = tcf_chain_lookup(block, chain_index); in __tcf_chain_get()
501 if (chain) { in __tcf_chain_get()
502 tcf_chain_hold(chain); in __tcf_chain_get()
506 chain = tcf_chain_create(block, chain_index); in __tcf_chain_get()
507 if (!chain) in __tcf_chain_get()
512 ++chain->action_refcnt; in __tcf_chain_get()
513 is_first_reference = chain->refcnt - chain->action_refcnt == 1; in __tcf_chain_get()
517 * non-action reference. Until then, the chain acts only as in __tcf_chain_get()
522 tc_chain_notify(chain, NULL, 0, NLM_F_CREATE | NLM_F_EXCL, in __tcf_chain_get()
525 return chain; in __tcf_chain_get()
529 return chain; in __tcf_chain_get()
551 static void __tcf_chain_put(struct tcf_chain *chain, bool by_act, in __tcf_chain_put() argument
554 struct tcf_block *block = chain->block; in __tcf_chain_put()
562 if (!chain->explicitly_created) { in __tcf_chain_put()
566 chain->explicitly_created = false; in __tcf_chain_put()
570 chain->action_refcnt--; in __tcf_chain_put()
573 * However, when block is unlocked chain can be changed concurrently, so in __tcf_chain_put()
576 refcnt = --chain->refcnt; in __tcf_chain_put()
577 tmplt_ops = chain->tmplt_ops; in __tcf_chain_put()
578 tmplt_priv = chain->tmplt_priv; in __tcf_chain_put()
581 if (refcnt - chain->action_refcnt == 0 && !by_act) { in __tcf_chain_put()
582 tc_chain_notify_delete(tmplt_ops, tmplt_priv, chain->index, in __tcf_chain_put()
584 /* Last reference to chain, no need to lock. */ in __tcf_chain_put()
585 chain->flushing = false; in __tcf_chain_put()
589 free_block = tcf_chain_detach(chain); in __tcf_chain_put()
594 tcf_chain_destroy(chain, free_block); in __tcf_chain_put()
598 static void tcf_chain_put(struct tcf_chain *chain) in tcf_chain_put() argument
600 __tcf_chain_put(chain, false, false); in tcf_chain_put()
603 void tcf_chain_put_by_act(struct tcf_chain *chain) in tcf_chain_put_by_act() argument
605 __tcf_chain_put(chain, true, false); in tcf_chain_put_by_act()
609 static void tcf_chain_put_explicitly_created(struct tcf_chain *chain) in tcf_chain_put_explicitly_created() argument
611 __tcf_chain_put(chain, false, true); in tcf_chain_put_explicitly_created()
614 static void tcf_chain_flush(struct tcf_chain *chain, bool rtnl_held) in tcf_chain_flush() argument
618 mutex_lock(&chain->filter_chain_lock); in tcf_chain_flush()
619 tp = tcf_chain_dereference(chain->filter_chain, chain); in tcf_chain_flush()
622 tcf_proto_signal_destroying(chain, tp); in tcf_chain_flush()
625 tp = tcf_chain_dereference(chain->filter_chain, chain); in tcf_chain_flush()
626 RCU_INIT_POINTER(chain->filter_chain, NULL); in tcf_chain_flush()
627 tcf_chain0_head_change(chain, NULL); in tcf_chain_flush()
628 chain->flushing = true; in tcf_chain_flush()
629 mutex_unlock(&chain->filter_chain_lock); in tcf_chain_flush()
795 chain0 = block->chain0.chain; in tcf_chain0_head_change_cb_add()
833 if (block->chain0.chain) in tcf_chain0_head_change_cb_del()
928 __tcf_get_next_chain(struct tcf_block *block, struct tcf_chain *chain) in __tcf_get_next_chain() argument
931 if (chain) in __tcf_get_next_chain()
932 chain = list_is_last(&chain->list, &block->chain_list) ? in __tcf_get_next_chain()
933 NULL : list_next_entry(chain, list); in __tcf_get_next_chain()
935 chain = list_first_entry_or_null(&block->chain_list, in __tcf_get_next_chain()
939 while (chain && tcf_chain_held_by_acts_only(chain)) in __tcf_get_next_chain()
940 chain = list_is_last(&chain->list, &block->chain_list) ? in __tcf_get_next_chain()
941 NULL : list_next_entry(chain, list); in __tcf_get_next_chain()
943 if (chain) in __tcf_get_next_chain()
944 tcf_chain_hold(chain); in __tcf_get_next_chain()
947 return chain; in __tcf_get_next_chain()
951 * block. It properly obtains block->lock and takes reference to chain before
952 * returning it. Users of this function must be tolerant to concurrent chain
953 * insertion/deletion or ensure that no concurrent chain modification is
960 tcf_get_next_chain(struct tcf_block *block, struct tcf_chain *chain) in tcf_get_next_chain() argument
962 struct tcf_chain *chain_next = __tcf_get_next_chain(block, chain); in tcf_get_next_chain()
964 if (chain) in tcf_get_next_chain()
965 tcf_chain_put(chain); in tcf_get_next_chain()
972 __tcf_get_next_proto(struct tcf_chain *chain, struct tcf_proto *tp) in __tcf_get_next_proto() argument
977 mutex_lock(&chain->filter_chain_lock); in __tcf_get_next_proto()
980 tp = tcf_chain_dereference(chain->filter_chain, chain); in __tcf_get_next_proto()
982 /* 'deleting' flag is set and chain->filter_chain_lock was in __tcf_get_next_proto()
987 tp = tcf_chain_dereference(chain->filter_chain, chain); in __tcf_get_next_proto()
989 for (; tp; tp = tcf_chain_dereference(tp->next, chain)) in __tcf_get_next_proto()
993 tp = tcf_chain_dereference(tp->next, chain); in __tcf_get_next_proto()
999 mutex_unlock(&chain->filter_chain_lock); in __tcf_get_next_proto()
1005 * chain. Users of this function must be tolerant to concurrent tp
1006 * insertion/deletion or ensure that no concurrent chain modification is
1013 tcf_get_next_proto(struct tcf_chain *chain, struct tcf_proto *tp) in tcf_get_next_proto() argument
1015 struct tcf_proto *tp_next = __tcf_get_next_proto(chain, tp); in tcf_get_next_proto()
1026 struct tcf_chain *chain; in tcf_block_flush_all_chains() local
1031 for (chain = tcf_get_next_chain(block, NULL); in tcf_block_flush_all_chains()
1032 chain; in tcf_block_flush_all_chains()
1033 chain = tcf_get_next_chain(block, chain)) { in tcf_block_flush_all_chains()
1034 tcf_chain_put_explicitly_created(chain); in tcf_block_flush_all_chains()
1035 tcf_chain_flush(chain, rtnl_held); in tcf_block_flush_all_chains()
1180 * deallocated when last chain is freed. However, if chain_list in __tcf_block_put()
1391 /* XXX: Standalone actions are not allowed to jump to any chain, and bound
1422 struct tcf_chain *chain, *chain_prev; in tcf_block_playback_offloads() local
1428 for (chain = __tcf_get_next_chain(block, NULL); in tcf_block_playback_offloads()
1429 chain; in tcf_block_playback_offloads()
1430 chain_prev = chain, in tcf_block_playback_offloads()
1431 chain = __tcf_get_next_chain(block, chain), in tcf_block_playback_offloads()
1433 for (tp = __tcf_get_next_proto(chain, NULL); tp; in tcf_block_playback_offloads()
1435 tp = __tcf_get_next_proto(chain, tp), in tcf_block_playback_offloads()
1454 tcf_chain_put(chain); in tcf_block_playback_offloads()
1541 /* Main classifier routine: scans classifier chain attached
1571 *last_executed_chain = first_tp->chain->index; in __tcf_classify()
1588 tp->chain->block->index, in __tcf_classify()
1610 u32 last_executed_chain = tp ? tp->chain->index : 0; in tcf_classify()
1618 if (ext && ext->chain) { in tcf_classify()
1621 fchain = tcf_chain_lookup_rcu(block, ext->chain); in tcf_classify()
1637 /* If we missed on some chain */ in tcf_classify()
1644 ext->chain = last_executed_chain; in tcf_classify()
1663 static struct tcf_proto *tcf_chain_tp_prev(struct tcf_chain *chain, in tcf_chain_tp_prev() argument
1666 return tcf_chain_dereference(*chain_info->pprev, chain); in tcf_chain_tp_prev()
1669 static int tcf_chain_tp_insert(struct tcf_chain *chain, in tcf_chain_tp_insert() argument
1673 if (chain->flushing) in tcf_chain_tp_insert()
1676 RCU_INIT_POINTER(tp->next, tcf_chain_tp_prev(chain, chain_info)); in tcf_chain_tp_insert()
1677 if (*chain_info->pprev == chain->filter_chain) in tcf_chain_tp_insert()
1678 tcf_chain0_head_change(chain, tp); in tcf_chain_tp_insert()
1685 static void tcf_chain_tp_remove(struct tcf_chain *chain, in tcf_chain_tp_remove() argument
1689 struct tcf_proto *next = tcf_chain_dereference(chain_info->next, chain); in tcf_chain_tp_remove()
1692 if (tp == chain->filter_chain) in tcf_chain_tp_remove()
1693 tcf_chain0_head_change(chain, next); in tcf_chain_tp_remove()
1697 static struct tcf_proto *tcf_chain_tp_find(struct tcf_chain *chain,
1707 static struct tcf_proto *tcf_chain_tp_insert_unique(struct tcf_chain *chain, in tcf_chain_tp_insert_unique() argument
1716 mutex_lock(&chain->filter_chain_lock); in tcf_chain_tp_insert_unique()
1718 if (tcf_proto_exists_destroying(chain, tp_new)) { in tcf_chain_tp_insert_unique()
1719 mutex_unlock(&chain->filter_chain_lock); in tcf_chain_tp_insert_unique()
1724 tp = tcf_chain_tp_find(chain, &chain_info, in tcf_chain_tp_insert_unique()
1727 err = tcf_chain_tp_insert(chain, &chain_info, tp_new); in tcf_chain_tp_insert_unique()
1728 mutex_unlock(&chain->filter_chain_lock); in tcf_chain_tp_insert_unique()
1741 static void tcf_chain_tp_delete_empty(struct tcf_chain *chain, in tcf_chain_tp_delete_empty() argument
1750 mutex_lock(&chain->filter_chain_lock); in tcf_chain_tp_delete_empty()
1752 /* Atomically find and remove tp from chain. */ in tcf_chain_tp_delete_empty()
1753 for (pprev = &chain->filter_chain; in tcf_chain_tp_delete_empty()
1754 (tp_iter = tcf_chain_dereference(*pprev, chain)); in tcf_chain_tp_delete_empty()
1768 mutex_unlock(&chain->filter_chain_lock); in tcf_chain_tp_delete_empty()
1772 tcf_proto_signal_destroying(chain, tp); in tcf_chain_tp_delete_empty()
1773 next = tcf_chain_dereference(chain_info.next, chain); in tcf_chain_tp_delete_empty()
1774 if (tp == chain->filter_chain) in tcf_chain_tp_delete_empty()
1775 tcf_chain0_head_change(chain, next); in tcf_chain_tp_delete_empty()
1777 mutex_unlock(&chain->filter_chain_lock); in tcf_chain_tp_delete_empty()
1782 static struct tcf_proto *tcf_chain_tp_find(struct tcf_chain *chain, in tcf_chain_tp_find() argument
1790 /* Check the chain for existence of proto-tcf with this priority */ in tcf_chain_tp_find()
1791 for (pprev = &chain->filter_chain; in tcf_chain_tp_find()
1792 (tp = tcf_chain_dereference(*pprev, chain)); in tcf_chain_tp_find()
1842 if (nla_put_u32(skb, TCA_CHAIN, tp->chain->index)) in tcf_fill_node()
1940 struct tcf_chain *chain, int event) in tfilter_notify_chain() argument
1944 for (tp = tcf_get_next_proto(chain, NULL); in tfilter_notify_chain()
1945 tp; tp = tcf_get_next_proto(chain, tp)) in tfilter_notify_chain()
1970 struct tcf_chain *chain; in tc_new_tfilter() local
1997 chain = NULL; in tc_new_tfilter()
2013 /* Find head of filter chain. */ in tc_new_tfilter()
2050 NL_SET_ERR_MSG(extack, "Specified chain index exceeds upper limit"); in tc_new_tfilter()
2054 chain = tcf_chain_get(block, chain_index, true); in tc_new_tfilter()
2055 if (!chain) { in tc_new_tfilter()
2056 NL_SET_ERR_MSG(extack, "Cannot create specified filter chain"); in tc_new_tfilter()
2061 mutex_lock(&chain->filter_chain_lock); in tc_new_tfilter()
2062 tp = tcf_chain_tp_find(chain, &chain_info, protocol, in tc_new_tfilter()
2073 if (chain->flushing) { in tc_new_tfilter()
2093 prio = tcf_auto_prio(tcf_chain_tp_prev(chain, in tc_new_tfilter()
2096 mutex_unlock(&chain->filter_chain_lock); in tc_new_tfilter()
2097 tp_new = tcf_proto_create(name, protocol, prio, chain, in tc_new_tfilter()
2105 tp = tcf_chain_tp_insert_unique(chain, tp_new, protocol, prio, in tc_new_tfilter()
2112 mutex_unlock(&chain->filter_chain_lock); in tc_new_tfilter()
2136 if (chain->tmplt_ops && chain->tmplt_ops != tp->ops) { in tc_new_tfilter()
2138 NL_SET_ERR_MSG(extack, "Chain template is set to a different filter kind"); in tc_new_tfilter()
2160 tcf_chain_tp_delete_empty(chain, tp, rtnl_held, NULL); in tc_new_tfilter()
2162 if (chain) { in tc_new_tfilter()
2166 tcf_chain_put(chain); in tc_new_tfilter()
2175 * of target chain. in tc_new_tfilter()
2184 mutex_unlock(&chain->filter_chain_lock); in tc_new_tfilter()
2201 struct tcf_chain *chain = NULL; in tc_del_tfilter() local
2224 /* Find head of filter chain. */ in tc_del_tfilter()
2235 /* Take rtnl mutex if flushing whole chain, block is shared (no qdisc in tc_del_tfilter()
2259 NL_SET_ERR_MSG(extack, "Specified chain index exceeds upper limit"); in tc_del_tfilter()
2263 chain = tcf_chain_get(block, chain_index, false); in tc_del_tfilter()
2264 if (!chain) { in tc_del_tfilter()
2265 /* User requested flush on non-existent chain. Nothing to do, in tc_del_tfilter()
2272 NL_SET_ERR_MSG(extack, "Cannot find specified filter chain"); in tc_del_tfilter()
2279 chain, RTM_DELTFILTER); in tc_del_tfilter()
2280 tcf_chain_flush(chain, rtnl_held); in tc_del_tfilter()
2285 mutex_lock(&chain->filter_chain_lock); in tc_del_tfilter()
2286 tp = tcf_chain_tp_find(chain, &chain_info, protocol, in tc_del_tfilter()
2297 tcf_proto_signal_destroying(chain, tp); in tc_del_tfilter()
2298 tcf_chain_tp_remove(chain, &chain_info, tp); in tc_del_tfilter()
2299 mutex_unlock(&chain->filter_chain_lock); in tc_del_tfilter()
2307 mutex_unlock(&chain->filter_chain_lock); in tc_del_tfilter()
2324 tcf_chain_tp_delete_empty(chain, tp, rtnl_held, extack); in tc_del_tfilter()
2328 if (chain) { in tc_del_tfilter()
2331 tcf_chain_put(chain); in tc_del_tfilter()
2341 mutex_unlock(&chain->filter_chain_lock); in tc_del_tfilter()
2358 struct tcf_chain *chain = NULL; in tc_get_tfilter() local
2381 /* Find head of filter chain. */ in tc_get_tfilter()
2415 NL_SET_ERR_MSG(extack, "Specified chain index exceeds upper limit"); in tc_get_tfilter()
2419 chain = tcf_chain_get(block, chain_index, false); in tc_get_tfilter()
2420 if (!chain) { in tc_get_tfilter()
2421 NL_SET_ERR_MSG(extack, "Cannot find specified filter chain"); in tc_get_tfilter()
2426 mutex_lock(&chain->filter_chain_lock); in tc_get_tfilter()
2427 tp = tcf_chain_tp_find(chain, &chain_info, protocol, in tc_get_tfilter()
2429 mutex_unlock(&chain->filter_chain_lock); in tc_get_tfilter()
2454 if (chain) { in tc_get_tfilter()
2457 tcf_chain_put(chain); in tc_get_tfilter()
2488 static bool tcf_chain_dump(struct tcf_chain *chain, struct Qdisc *q, u32 parent, in tcf_chain_dump() argument
2493 struct tcf_block *block = chain->block; in tcf_chain_dump()
2498 for (tp = __tcf_get_next_proto(chain, NULL); in tcf_chain_dump()
2501 tp = __tcf_get_next_proto(chain, tp), in tcf_chain_dump()
2556 struct tcf_chain *chain, *chain_prev; in tc_dump_tfilter() local
2631 for (chain = __tcf_get_next_chain(block, NULL); in tc_dump_tfilter()
2632 chain; in tc_dump_tfilter()
2633 chain_prev = chain, in tc_dump_tfilter()
2634 chain = __tcf_get_next_chain(block, chain), in tc_dump_tfilter()
2637 nla_get_u32(tca[TCA_CHAIN]) != chain->index) in tc_dump_tfilter()
2639 if (!tcf_chain_dump(chain, q, parent, skb, cb, in tc_dump_tfilter()
2641 tcf_chain_put(chain); in tc_dump_tfilter()
2708 static int tc_chain_notify(struct tcf_chain *chain, struct sk_buff *oskb, in tc_chain_notify() argument
2712 struct tcf_block *block = chain->block; in tc_chain_notify()
2721 if (tc_chain_fill_node(chain->tmplt_ops, chain->tmplt_priv, in tc_chain_notify()
2722 chain->index, net, skb, block, portid, in tc_chain_notify()
2762 static int tc_chain_tmplt_add(struct tcf_chain *chain, struct net *net, in tc_chain_tmplt_add() argument
2775 NL_SET_ERR_MSG(extack, "Specified TC chain template name too long"); in tc_chain_tmplt_add()
2783 NL_SET_ERR_MSG(extack, "Chain templates are not supported with specified classifier"); in tc_chain_tmplt_add()
2787 tmplt_priv = ops->tmplt_create(net, chain, tca, extack); in tc_chain_tmplt_add()
2792 chain->tmplt_ops = ops; in tc_chain_tmplt_add()
2793 chain->tmplt_priv = tmplt_priv; in tc_chain_tmplt_add()
2808 /* Add/delete/get a chain */
2819 struct tcf_chain *chain; in tc_ctl_chain() local
2842 NL_SET_ERR_MSG(extack, "Specified chain index exceeds upper limit"); in tc_ctl_chain()
2848 chain = tcf_chain_lookup(block, chain_index); in tc_ctl_chain()
2850 if (chain) { in tc_ctl_chain()
2851 if (tcf_chain_held_by_acts_only(chain)) { in tc_ctl_chain()
2852 /* The chain exists only because there is in tc_ctl_chain()
2855 tcf_chain_hold(chain); in tc_ctl_chain()
2857 NL_SET_ERR_MSG(extack, "Filter chain already exists"); in tc_ctl_chain()
2863 NL_SET_ERR_MSG(extack, "Need both RTM_NEWCHAIN and NLM_F_CREATE to create a new chain"); in tc_ctl_chain()
2867 chain = tcf_chain_create(block, chain_index); in tc_ctl_chain()
2868 if (!chain) { in tc_ctl_chain()
2869 NL_SET_ERR_MSG(extack, "Failed to create filter chain"); in tc_ctl_chain()
2875 if (!chain || tcf_chain_held_by_acts_only(chain)) { in tc_ctl_chain()
2876 NL_SET_ERR_MSG(extack, "Cannot find specified filter chain"); in tc_ctl_chain()
2880 tcf_chain_hold(chain); in tc_ctl_chain()
2884 /* Modifying chain requires holding parent block lock. In case in tc_ctl_chain()
2885 * the chain was successfully added, take a reference to the in tc_ctl_chain()
2886 * chain. This ensures that an empty chain does not disappear at in tc_ctl_chain()
2889 tcf_chain_hold(chain); in tc_ctl_chain()
2890 chain->explicitly_created = true; in tc_ctl_chain()
2896 err = tc_chain_tmplt_add(chain, net, tca, extack); in tc_ctl_chain()
2898 tcf_chain_put_explicitly_created(chain); in tc_ctl_chain()
2902 tc_chain_notify(chain, NULL, 0, NLM_F_CREATE | NLM_F_EXCL, in tc_ctl_chain()
2907 chain, RTM_DELTFILTER); in tc_ctl_chain()
2908 /* Flush the chain first as the user requested chain removal. */ in tc_ctl_chain()
2909 tcf_chain_flush(chain, true); in tc_ctl_chain()
2910 /* In case the chain was successfully deleted, put a reference in tc_ctl_chain()
2911 * to the chain previously taken during addition. in tc_ctl_chain()
2913 tcf_chain_put_explicitly_created(chain); in tc_ctl_chain()
2916 err = tc_chain_notify(chain, skb, n->nlmsg_seq, in tc_ctl_chain()
2919 NL_SET_ERR_MSG(extack, "Failed to send chain notify message"); in tc_ctl_chain()
2928 tcf_chain_put(chain); in tc_ctl_chain()
2949 struct tcf_chain *chain; in tc_dump_chain() local
3003 list_for_each_entry(chain, &block->chain_list, list) { in tc_dump_chain()
3005 nla_get_u32(tca[TCA_CHAIN]) != chain->index)) in tc_dump_chain()
3011 if (tcf_chain_held_by_acts_only(chain)) in tc_dump_chain()
3013 err = tc_chain_fill_node(chain->tmplt_ops, chain->tmplt_priv, in tc_dump_chain()
3014 chain->index, net, skb, block, in tc_dump_chain()