diff options
author | Vlad Buslov <vladbu@mellanox.com> | 2018-09-24 19:22:57 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-09-26 06:17:36 +0300 |
commit | 0607e439943bd150e53eed2979f9c69aa61c37ce (patch) | |
tree | 969c4d044d26ce67e16f763b9d9c229b668cee31 /include | |
parent | ab2816295f991700b7e2ee117880751be8f705b4 (diff) | |
download | linux-0607e439943bd150e53eed2979f9c69aa61c37ce.tar.xz |
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>
Diffstat (limited to 'include')
-rw-r--r-- | include/net/sch_generic.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h index 4a86f4d33f07..7a6b71ee5433 100644 --- a/include/net/sch_generic.h +++ b/include/net/sch_generic.h @@ -357,6 +357,7 @@ struct tcf_block { struct tcf_chain *chain; struct list_head filter_chain_list; } chain0; + struct rcu_head rcu; }; static inline void tcf_block_offload_inc(struct tcf_block *block, u32 *flags) |