net: sched: traverse chains in block with tcf_get_next_chain()
All users of block->chain_list rely on rtnl lock and assume that no new chains are added when traversing the list. Use tcf_get_next_chain() to traverse chain list without relying on rtnl mutex. This function iterates over chains by taking reference to current iterator chain only and doesn't assume external synchronization of chain list. Don't take reference to all chains in block when flushing and use tcf_get_next_chain() to safely iterate over chain list instead. Remove tcf_block_put_all_chains() that is no longer used. Signed-off-by: Vlad Buslov <vladbu@mellanox.com> Acked-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
165f01354c
commit
bbf73830cd
@@ -44,6 +44,8 @@ bool tcf_queue_work(struct rcu_work *rwork, work_func_t func);
|
||||
struct tcf_chain *tcf_chain_get_by_act(struct tcf_block *block,
|
||||
u32 chain_index);
|
||||
void tcf_chain_put_by_act(struct tcf_chain *chain);
|
||||
struct tcf_chain *tcf_get_next_chain(struct tcf_block *block,
|
||||
struct tcf_chain *chain);
|
||||
void tcf_block_netif_keep_dst(struct tcf_block *block);
|
||||
int tcf_block_get(struct tcf_block **p_block,
|
||||
struct tcf_proto __rcu **p_filter_chain, struct Qdisc *q,
|
||||
|
Reference in New Issue
Block a user