]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit5d60c23390a0032cf845eb876e2e10a08e265437
tree8d7b223d7f14ebd104a608c2f5e7adb5c307a29a
parent900b3ff1f92d29e8d710d3edaaff0667fdce7507
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