diff options
Diffstat (limited to 'include/linux/rtnetlink.h')
-rw-r--r-- | include/linux/rtnetlink.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h index 58d44491880f..bbad657a3725 100644 --- a/include/linux/rtnetlink.h +++ b/include/linux/rtnetlink.h | |||
@@ -605,6 +605,7 @@ struct tcamsg { | |||
605 | #ifdef __KERNEL__ | 605 | #ifdef __KERNEL__ |
606 | 606 | ||
607 | #include <linux/mutex.h> | 607 | #include <linux/mutex.h> |
608 | #include <linux/netdevice.h> | ||
608 | 609 | ||
609 | static __inline__ int rtattr_strcmp(const struct rtattr *rta, const char *str) | 610 | static __inline__ int rtattr_strcmp(const struct rtattr *rta, const char *str) |
610 | { | 611 | { |
@@ -749,6 +750,35 @@ extern int rtnl_is_locked(void); | |||
749 | extern int lockdep_rtnl_is_held(void); | 750 | extern int lockdep_rtnl_is_held(void); |
750 | #endif /* #ifdef CONFIG_PROVE_LOCKING */ | 751 | #endif /* #ifdef CONFIG_PROVE_LOCKING */ |
751 | 752 | ||
753 | /** | ||
754 | * rcu_dereference_rtnl - rcu_dereference with debug checking | ||
755 | * @p: The pointer to read, prior to dereferencing | ||
756 | * | ||
757 | * Do an rcu_dereference(p), but check caller either holds rcu_read_lock() | ||
758 | * or RTNL. Note : Please prefer rtnl_dereference() or rcu_dereference() | ||
759 | */ | ||
760 | #define rcu_dereference_rtnl(p) \ | ||
761 | rcu_dereference_check(p, rcu_read_lock_held() || \ | ||
762 | lockdep_rtnl_is_held()) | ||
763 | |||
764 | /** | ||
765 | * rtnl_dereference - fetch RCU pointer when updates are prevented by RTNL | ||
766 | * @p: The pointer to read, prior to dereferencing | ||
767 | * | ||
768 | * Return the value of the specified RCU-protected pointer, but omit | ||
769 | * both the smp_read_barrier_depends() and the ACCESS_ONCE(), because | ||
770 | * caller holds RTNL. | ||
771 | */ | ||
772 | #define rtnl_dereference(p) \ | ||
773 | rcu_dereference_protected(p, lockdep_rtnl_is_held()) | ||
774 | |||
775 | static inline struct netdev_queue *dev_ingress_queue(struct net_device *dev) | ||
776 | { | ||
777 | return rtnl_dereference(dev->ingress_queue); | ||
778 | } | ||
779 | |||
780 | extern struct netdev_queue *dev_ingress_queue_create(struct net_device *dev); | ||
781 | |||
752 | extern void rtnetlink_init(void); | 782 | extern void rtnetlink_init(void); |
753 | extern void __rtnl_unlock(void); | 783 | extern void __rtnl_unlock(void); |
754 | 784 | ||