Commit 331b7292 authored by John Fastabend's avatar John Fastabend Committed by David S. Miller

net: sched: RCU cls_tcindex

Make cls_tcindex RCU safe.

This patch addds a new RCU routine rcu_dereference_bh_rtnl() to check
caller either holds the rcu read lock or RTNL. This is needed to
handle the case where tcindex_lookup() is being called in both cases.
Signed-off-by: default avatarJohn Fastabend <john.r.fastabend@intel.com>
Acked-by: default avatarEric Dumazet <edumazet@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 1109c005
...@@ -46,6 +46,16 @@ static inline int lockdep_rtnl_is_held(void) ...@@ -46,6 +46,16 @@ static inline int lockdep_rtnl_is_held(void)
#define rcu_dereference_rtnl(p) \ #define rcu_dereference_rtnl(p) \
rcu_dereference_check(p, lockdep_rtnl_is_held()) rcu_dereference_check(p, lockdep_rtnl_is_held())
/**
* rcu_dereference_bh_rtnl - rcu_dereference_bh with debug checking
* @p: The pointer to read, prior to dereference
*
* Do an rcu_dereference_bh(p), but check caller either holds rcu_read_lock_bh()
* or RTNL. Note : Please prefer rtnl_dereference() or rcu_dereference_bh()
*/
#define rcu_dereference_bh_rtnl(p) \
rcu_dereference_bh_check(p, lockdep_rtnl_is_held())
/** /**
* rtnl_dereference - fetch RCU pointer when updates are prevented by RTNL * rtnl_dereference - fetch RCU pointer when updates are prevented by RTNL
* @p: The pointer to read, prior to dereferencing * @p: The pointer to read, prior to dereferencing
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment