diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h index f561dfb79743..4ddc46f106b9 100644 --- a/include/net/sch_generic.h +++ b/include/net/sch_generic.h @@ -126,6 +126,7 @@ struct Qdisc { spinlock_t busylock ____cacheline_aligned_in_smp; spinlock_t seqlock; + struct lock_class_key qdisc_tx_rootlock; struct rcu_head rcu; netdevice_tracker dev_tracker; /* private data */ diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c index 4a2c763e2d11..809e974204f8 100644 --- a/net/sched/sch_generic.c +++ b/net/sched/sch_generic.c @@ -945,7 +945,9 @@ struct Qdisc *qdisc_alloc(struct netdev_queue *dev_queue, __skb_queue_head_init(&sch->gso_skb); __skb_queue_head_init(&sch->skb_bad_txq); gnet_stats_basic_sync_init(&sch->bstats); + lockdep_register_key(&sch->qdisc_tx_rootlock); spin_lock_init(&sch->q.lock); + lockdep_set_class(&sch->q.lock, &sch->qdisc_tx_rootlock); if (ops->static_flags & TCQ_F_CPUSTATS) { sch->cpu_bstats = @@ -1070,6 +1072,7 @@ static void __qdisc_destroy(struct Qdisc *qdisc) module_put(ops->owner); netdev_put(dev, &qdisc->dev_tracker); + lockdep_unregister_key(&qdisc->qdisc_tx_rootlock); trace_qdisc_destroy(qdisc);