Skip to content

Commit 24ffd75

Browse files
edumazetdavem330
authored andcommitted
net: macvlan: call netdev_lockdep_set_classes()
In case a qdisc is used on a macvlan 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 <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 78e7a2a commit 24ffd75

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

drivers/net/macvlan.c

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -788,7 +788,6 @@ static int macvlan_change_mtu(struct net_device *dev, int new_mtu)
788788
* "super class" of normal network devices; split their locks off into a
789789
* separate class since they always nest.
790790
*/
791-
static struct lock_class_key macvlan_netdev_xmit_lock_key;
792791
static struct lock_class_key macvlan_netdev_addr_lock_key;
793792

794793
#define ALWAYS_ON_FEATURES \
@@ -809,20 +808,12 @@ static int macvlan_get_nest_level(struct net_device *dev)
809808
return ((struct macvlan_dev *)netdev_priv(dev))->nest_level;
810809
}
811810

812-
static void macvlan_set_lockdep_class_one(struct net_device *dev,
813-
struct netdev_queue *txq,
814-
void *_unused)
815-
{
816-
lockdep_set_class(&txq->_xmit_lock,
817-
&macvlan_netdev_xmit_lock_key);
818-
}
819-
820811
static void macvlan_set_lockdep_class(struct net_device *dev)
821812
{
813+
netdev_lockdep_set_classes(dev);
822814
lockdep_set_class_and_subclass(&dev->addr_list_lock,
823815
&macvlan_netdev_addr_lock_key,
824816
macvlan_get_nest_level(dev));
825-
netdev_for_each_tx_queue(dev, macvlan_set_lockdep_class_one, NULL);
826817
}
827818

828819
static int macvlan_init(struct net_device *dev)

0 commit comments

Comments
 (0)