diff options
Diffstat (limited to 'include/linux/netdevice.h')
-rw-r--r-- | include/linux/netdevice.h | 35 |
1 files changed, 13 insertions, 22 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 38c5909e1c35..c93df7cf187b 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -925,6 +925,7 @@ struct dev_ifalias { | |||
925 | struct devlink; | 925 | struct devlink; |
926 | struct tlsdev_ops; | 926 | struct tlsdev_ops; |
927 | 927 | ||
928 | |||
928 | /* | 929 | /* |
929 | * This structure defines the management hooks for network devices. | 930 | * This structure defines the management hooks for network devices. |
930 | * The following hooks can be defined; unless noted otherwise, they are | 931 | * The following hooks can be defined; unless noted otherwise, they are |
@@ -1760,9 +1761,13 @@ enum netdev_priv_flags { | |||
1760 | * @phydev: Physical device may attach itself | 1761 | * @phydev: Physical device may attach itself |
1761 | * for hardware timestamping | 1762 | * for hardware timestamping |
1762 | * @sfp_bus: attached &struct sfp_bus structure. | 1763 | * @sfp_bus: attached &struct sfp_bus structure. |
1763 | * | 1764 | * @qdisc_tx_busylock_key: lockdep class annotating Qdisc->busylock |
1764 | * @qdisc_tx_busylock: lockdep class annotating Qdisc->busylock spinlock | 1765 | spinlock |
1765 | * @qdisc_running_key: lockdep class annotating Qdisc->running seqcount | 1766 | * @qdisc_running_key: lockdep class annotating Qdisc->running seqcount |
1767 | * @qdisc_xmit_lock_key: lockdep class annotating | ||
1768 | * netdev_queue->_xmit_lock spinlock | ||
1769 | * @addr_list_lock_key: lockdep class annotating | ||
1770 | * net_device->addr_list_lock spinlock | ||
1766 | * | 1771 | * |
1767 | * @proto_down: protocol port state information can be sent to the | 1772 | * @proto_down: protocol port state information can be sent to the |
1768 | * switch driver and used to set the phys state of the | 1773 | * switch driver and used to set the phys state of the |
@@ -2049,8 +2054,10 @@ struct net_device { | |||
2049 | #endif | 2054 | #endif |
2050 | struct phy_device *phydev; | 2055 | struct phy_device *phydev; |
2051 | struct sfp_bus *sfp_bus; | 2056 | struct sfp_bus *sfp_bus; |
2052 | struct lock_class_key *qdisc_tx_busylock; | 2057 | struct lock_class_key qdisc_tx_busylock_key; |
2053 | struct lock_class_key *qdisc_running_key; | 2058 | struct lock_class_key qdisc_running_key; |
2059 | struct lock_class_key qdisc_xmit_lock_key; | ||
2060 | struct lock_class_key addr_list_lock_key; | ||
2054 | bool proto_down; | 2061 | bool proto_down; |
2055 | unsigned wol_enabled:1; | 2062 | unsigned wol_enabled:1; |
2056 | }; | 2063 | }; |
@@ -2128,23 +2135,6 @@ static inline void netdev_for_each_tx_queue(struct net_device *dev, | |||
2128 | f(dev, &dev->_tx[i], arg); | 2135 | f(dev, &dev->_tx[i], arg); |
2129 | } | 2136 | } |
2130 | 2137 | ||
2131 | #define netdev_lockdep_set_classes(dev) \ | ||
2132 | { \ | ||
2133 | static struct lock_class_key qdisc_tx_busylock_key; \ | ||
2134 | static struct lock_class_key qdisc_running_key; \ | ||
2135 | static struct lock_class_key qdisc_xmit_lock_key; \ | ||
2136 | static struct lock_class_key dev_addr_list_lock_key; \ | ||
2137 | unsigned int i; \ | ||
2138 | \ | ||
2139 | (dev)->qdisc_tx_busylock = &qdisc_tx_busylock_key; \ | ||
2140 | (dev)->qdisc_running_key = &qdisc_running_key; \ | ||
2141 | lockdep_set_class(&(dev)->addr_list_lock, \ | ||
2142 | &dev_addr_list_lock_key); \ | ||
2143 | for (i = 0; i < (dev)->num_tx_queues; i++) \ | ||
2144 | lockdep_set_class(&(dev)->_tx[i]._xmit_lock, \ | ||
2145 | &qdisc_xmit_lock_key); \ | ||
2146 | } | ||
2147 | |||
2148 | u16 netdev_pick_tx(struct net_device *dev, struct sk_buff *skb, | 2138 | u16 netdev_pick_tx(struct net_device *dev, struct sk_buff *skb, |
2149 | struct net_device *sb_dev); | 2139 | struct net_device *sb_dev); |
2150 | struct netdev_queue *netdev_core_pick_tx(struct net_device *dev, | 2140 | struct netdev_queue *netdev_core_pick_tx(struct net_device *dev, |
@@ -3143,6 +3133,7 @@ static inline void netif_stop_queue(struct net_device *dev) | |||
3143 | } | 3133 | } |
3144 | 3134 | ||
3145 | void netif_tx_stop_all_queues(struct net_device *dev); | 3135 | void netif_tx_stop_all_queues(struct net_device *dev); |
3136 | void netdev_update_lockdep_key(struct net_device *dev); | ||
3146 | 3137 | ||
3147 | static inline bool netif_tx_queue_stopped(const struct netdev_queue *dev_queue) | 3138 | static inline bool netif_tx_queue_stopped(const struct netdev_queue *dev_queue) |
3148 | { | 3139 | { |