]> 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)
commit7d75df8f66344bb9b809e06956e11feacaaa1ac7
tree969c4d044d26ce67e16f763b9d9c229b668cee31
parent8a2d0b0b713facefe2ec1e845ec38f18e370988a
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