Skip to content

Commit

Permalink
team: set qdisc_tx_busylock to avoid LOCKDEP splat
Browse files Browse the repository at this point in the history
If a qdisc is installed on a team device, its possible to get
a lockdep splat under stress, because nested dev_queue_xmit() can
lock busylock a second time (on a different device, so its a false
positive)

Avoid this problem using a distinct lock_class_key for team
devices.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Jiri Pirko <jpirko@redhat.com>
Acked-by: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Eric Dumazet authored and David S. Miller committed Oct 4, 2012
1 parent 49ee492 commit b3c581d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/net/team/team.c
Original file line number Diff line number Diff line change
Expand Up @@ -1315,6 +1315,7 @@ static const struct team_option team_options[] = {

static struct lock_class_key team_netdev_xmit_lock_key;
static struct lock_class_key team_netdev_addr_lock_key;
static struct lock_class_key team_tx_busylock_key;

static void team_set_lockdep_class_one(struct net_device *dev,
struct netdev_queue *txq,
Expand All @@ -1327,6 +1328,7 @@ static void team_set_lockdep_class(struct net_device *dev)
{
lockdep_set_class(&dev->addr_list_lock, &team_netdev_addr_lock_key);
netdev_for_each_tx_queue(dev, team_set_lockdep_class_one, NULL);
dev->qdisc_tx_busylock = &team_tx_busylock_key;
}

static int team_init(struct net_device *dev)
Expand Down

0 comments on commit b3c581d

Please sign in to comment.