Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
[linux-block.git] / include / linux / netdevice.h
index 5b364a2e0006250e440a988b2a72da9a046bc70f..6fc613ed8eae7743ce7c9093aa966f16b812b35e 100644 (file)
@@ -1821,8 +1821,6 @@ enum netdev_priv_flags {
  *                     for hardware timestamping
  *     @sfp_bus:       attached &struct sfp_bus structure.
  *
- *     @addr_list_lock_key:    lockdep class annotating
- *                             net_device->addr_list_lock spinlock
  *     @qdisc_tx_busylock: lockdep class annotating Qdisc->busylock spinlock
  *     @qdisc_running_key: lockdep class annotating Qdisc->running seqcount
  *
@@ -2125,7 +2123,6 @@ struct net_device {
 #endif
        struct phy_device       *phydev;
        struct sfp_bus          *sfp_bus;
-       struct lock_class_key   addr_list_lock_key;
        struct lock_class_key   *qdisc_tx_busylock;
        struct lock_class_key   *qdisc_running_key;
        bool                    proto_down;
@@ -2217,10 +2214,13 @@ static inline void netdev_for_each_tx_queue(struct net_device *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);        \
@@ -3253,7 +3253,6 @@ static inline void netif_stop_queue(struct net_device *dev)
 }
 
 void netif_tx_stop_all_queues(struct net_device *dev);
-void netdev_update_lockdep_key(struct net_device *dev);
 
 static inline bool netif_tx_queue_stopped(const struct netdev_queue *dev_queue)
 {
@@ -4239,6 +4238,11 @@ static inline void netif_addr_lock(struct net_device *dev)
        spin_lock(&dev->addr_list_lock);
 }
 
+static inline void netif_addr_lock_nested(struct net_device *dev)
+{
+       spin_lock_nested(&dev->addr_list_lock, dev->lower_level);
+}
+
 static inline void netif_addr_lock_bh(struct net_device *dev)
 {
        spin_lock_bh(&dev->addr_list_lock);