net: sched: traverse chains in block with tcf_get_next_chain()
authorVlad Buslov <vladbu@mellanox.com>
Mon, 11 Feb 2019 08:55:36 +0000 (10:55 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 12 Feb 2019 18:41:32 +0000 (13:41 -0500)
commitbbf73830cd48cff1599811d4f69c7cfd49c7b869
tree8d7b223d7f14ebd104a608c2f5e7adb5c307a29a
parent165f01354c52b6ce175b2c67f771c153f0563f41
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>
include/net/pkt_cls.h
net/sched/cls_api.c
net/sched/sch_api.c