aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ipvlan/ipvlan_main.c
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2016-06-09 10:45:15 -0400
committerDavid S. Miller <davem@davemloft.net>2016-06-09 16:28:37 -0400
commit0d7dd798fd89d986a6c59030b704827a4e6a13b4 (patch)
treee2596fb5628d463cc4acb13f282a612496174aae /drivers/net/ipvlan/ipvlan_main.c
parent24ffd752007fb04e8efb560029c6076f6f3c0c5e (diff)
net: ipvlan: call netdev_lockdep_set_classes()
In case a qdisc is used on a ipvlan device, we need to use different lockdep classes to avoid false positives. Use the new netdev_lockdep_set_classes() generic helper. Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ipvlan/ipvlan_main.c')
-rw-r--r--drivers/net/ipvlan/ipvlan_main.c22
1 files changed, 1 insertions, 21 deletions
diff --git a/drivers/net/ipvlan/ipvlan_main.c b/drivers/net/ipvlan/ipvlan_main.c
index 1c4d395fbd49..18b4e8c7f68a 100644
--- a/drivers/net/ipvlan/ipvlan_main.c
+++ b/drivers/net/ipvlan/ipvlan_main.c
@@ -80,13 +80,6 @@ static void ipvlan_port_destroy(struct net_device *dev)
80 kfree_rcu(port, rcu); 80 kfree_rcu(port, rcu);
81} 81}
82 82
83/* ipvlan network devices have devices nesting below it and are a special
84 * "super class" of normal network devices; split their locks off into a
85 * separate class since they always nest.
86 */
87static struct lock_class_key ipvlan_netdev_xmit_lock_key;
88static struct lock_class_key ipvlan_netdev_addr_lock_key;
89
90#define IPVLAN_FEATURES \ 83#define IPVLAN_FEATURES \
91 (NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_HIGHDMA | NETIF_F_FRAGLIST | \ 84 (NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_HIGHDMA | NETIF_F_FRAGLIST | \
92 NETIF_F_GSO | NETIF_F_TSO | NETIF_F_UFO | NETIF_F_GSO_ROBUST | \ 85 NETIF_F_GSO | NETIF_F_TSO | NETIF_F_UFO | NETIF_F_GSO_ROBUST | \
@@ -96,19 +89,6 @@ static struct lock_class_key ipvlan_netdev_addr_lock_key;
96#define IPVLAN_STATE_MASK \ 89#define IPVLAN_STATE_MASK \
97 ((1<<__LINK_STATE_NOCARRIER) | (1<<__LINK_STATE_DORMANT)) 90 ((1<<__LINK_STATE_NOCARRIER) | (1<<__LINK_STATE_DORMANT))
98 91
99static void ipvlan_set_lockdep_class_one(struct net_device *dev,
100 struct netdev_queue *txq,
101 void *_unused)
102{
103 lockdep_set_class(&txq->_xmit_lock, &ipvlan_netdev_xmit_lock_key);
104}
105
106static void ipvlan_set_lockdep_class(struct net_device *dev)
107{
108 lockdep_set_class(&dev->addr_list_lock, &ipvlan_netdev_addr_lock_key);
109 netdev_for_each_tx_queue(dev, ipvlan_set_lockdep_class_one, NULL);
110}
111
112static int ipvlan_init(struct net_device *dev) 92static int ipvlan_init(struct net_device *dev)
113{ 93{
114 struct ipvl_dev *ipvlan = netdev_priv(dev); 94 struct ipvl_dev *ipvlan = netdev_priv(dev);
@@ -123,7 +103,7 @@ static int ipvlan_init(struct net_device *dev)
123 dev->gso_max_segs = phy_dev->gso_max_segs; 103 dev->gso_max_segs = phy_dev->gso_max_segs;
124 dev->hard_header_len = phy_dev->hard_header_len; 104 dev->hard_header_len = phy_dev->hard_header_len;
125 105
126 ipvlan_set_lockdep_class(dev); 106 netdev_lockdep_set_classes(dev);
127 107
128 ipvlan->pcpu_stats = alloc_percpu(struct ipvl_pcpu_stats); 108 ipvlan->pcpu_stats = alloc_percpu(struct ipvl_pcpu_stats);
129 if (!ipvlan->pcpu_stats) 109 if (!ipvlan->pcpu_stats)