summaryrefslogtreecommitdiffstats
path: root/include/linux/rtnetlink.h
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2010-10-05 00:29:48 -0700
committerDavid S. Miller <davem@davemloft.net>2010-10-05 00:29:48 -0700
commit29fa060eab3f524d338566d34c1d9e704579ae5e (patch)
tree5ec18e56dc3321dda6e1fa76b08b32043f8c88e9 /include/linux/rtnetlink.h
parent13f5bf18ba657d2d17c8fcf584e50359c718dd4b (diff)
downloadlinux-stable-29fa060eab3f524d338566d34c1d9e704579ae5e.tar.gz
linux-stable-29fa060eab3f524d338566d34c1d9e704579ae5e.tar.bz2
linux-stable-29fa060eab3f524d338566d34c1d9e704579ae5e.zip
net: relax rtnl_dereference()
rtnl_dereference() is used in contexts where RTNL is held, to fetch an RCU protected pointer. Updates to this pointer are prevented by RTNL, so we dont need smp_read_barrier_depends() and the ACCESS_ONCE() provided in rcu_dereference_check(). rtnl_dereference() is mainly a macro to document the locking invariant. Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/rtnetlink.h')
-rw-r--r--include/linux/rtnetlink.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h
index 0bb7b48632bd..d42f274418b8 100644
--- a/include/linux/rtnetlink.h
+++ b/include/linux/rtnetlink.h
@@ -755,20 +755,22 @@ extern int lockdep_rtnl_is_held(void);
* @p: The pointer to read, prior to dereferencing
*
* Do an rcu_dereference(p), but check caller either holds rcu_read_lock()
- * or RTNL
+ * or RTNL. Note : Please prefer rtnl_dereference() or rcu_dereference()
*/
#define rcu_dereference_rtnl(p) \
rcu_dereference_check(p, rcu_read_lock_held() || \
lockdep_rtnl_is_held())
/**
- * rtnl_dereference - rcu_dereference with debug checking
+ * rtnl_dereference - fetch RCU pointer when updates are prevented by RTNL
* @p: The pointer to read, prior to dereferencing
*
- * Do an rcu_dereference(p), but check caller holds RTNL
+ * Return the value of the specified RCU-protected pointer, but omit
+ * both the smp_read_barrier_depends() and the ACCESS_ONCE(), because
+ * caller holds RTNL.
*/
#define rtnl_dereference(p) \
- rcu_dereference_check(p, lockdep_rtnl_is_held())
+ rcu_dereference_protected(p, lockdep_rtnl_is_held())
static inline struct netdev_queue *dev_ingress_queue(struct net_device *dev)
{