]> git.baikalelectronics.ru Git - kernel.git/commit
net: sched: implement tcf_block_refcnt_{get|put}()
authorVlad Buslov <vladbu@mellanox.com>
Mon, 24 Sep 2018 16:22:57 +0000 (19:22 +0300)
committerDavid S. Miller <davem@davemloft.net>
Wed, 26 Sep 2018 03:17:36 +0000 (20:17 -0700)
commitbf90c96e1c1dc6a0e7557e5ad4834ba03080d9b4
tree969c4d044d26ce67e16f763b9d9c229b668cee31
parent65b69eaa9925b31e700db0f8787dc18217983586
net: sched: implement tcf_block_refcnt_{get|put}()

Implement get/put function for blocks that only take/release the reference
and perform deallocation. These functions are intended to be used by
unlocked rules update path to always hold reference to block while working
with it. They use on new fine-grained locking mechanisms introduced in
previous patches in this set, instead of relying on global protection
provided by rtnl lock.

Extract code that is common with tcf_block_detach_ext() into common
function __tcf_block_put().

Extend tcf_block with rcu to allow safe deallocation when it is accessed
concurrently.

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/sch_generic.h
net/sched/cls_api.c