summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2016-06-09 23:28:38 +0300
committerDavid S. Miller <davem@davemloft.net>2016-06-09 23:28:38 +0300
commitcf515802043cccecfe9ab75065f8fc71e6ec9bab (patch)
treee2596fb5628d463cc4acb13f282a612496174aae /include/linux
parent5362855aba7159aab8f7c6573eb675d9da317914 (diff)
parent0d7dd798fd89d986a6c59030b704827a4e6a13b4 (diff)
downloadlinux-cf515802043cccecfe9ab75065f8fc71e6ec9bab.tar.xz
Merge branch 'netdev_lockdep_set_classes'
Eric Dumazet says: ==================== net: better lockdep annotations Introduction of qdisc->running seqcount added lockdep false positives. While chasing the bug, it came to me that we had a lot of copies of the same stuff in virtual drivers. This patch series has the qdisc->running fix (considers that a trylock is attempted in lockdep terminology), and adds a generic helper so that we no longer have to patch many virtual drivers when a new per-device or per-qdisc lock is added. Thanks to David Ahern for reporting the issue and testing my patches :) ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/netdevice.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 541562333ba5..4f234b102892 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -1946,6 +1946,23 @@ static inline void netdev_for_each_tx_queue(struct net_device *dev,
f(dev, &dev->_tx[i], arg);
}
+#define netdev_lockdep_set_classes(dev) \
+{ \
+ static struct lock_class_key qdisc_tx_busylock_key; \
+ static struct lock_class_key qdisc_running_key; \
+ static struct lock_class_key qdisc_xmit_lock_key; \
+ static struct lock_class_key dev_addr_list_lock_key; \
+ unsigned int i; \
+ \
+ (dev)->qdisc_tx_busylock = &qdisc_tx_busylock_key; \
+ (dev)->qdisc_running_key = &qdisc_running_key; \
+ lockdep_set_class(&(dev)->addr_list_lock, \
+ &dev_addr_list_lock_key); \
+ for (i = 0; i < (dev)->num_tx_queues; i++) \
+ lockdep_set_class(&(dev)->_tx[i]._xmit_lock, \
+ &qdisc_xmit_lock_key); \
+}
+
struct netdev_queue *netdev_pick_tx(struct net_device *dev,
struct sk_buff *skb,
void *accel_priv);