提交 20e7c4e8 编写于 作者: E Eric Dumazet 提交者: David S. Miller

6lowpan: fix lockdep splats

When a device ndo_start_xmit() calls again dev_queue_xmit(),
lockdep can complain because dev_queue_xmit() is re-entered and the
spinlocks protecting tx queues share a common lockdep class.

Same issue was fixed for bonding/l2tp/ppp in commits

0daa2303 ("[PATCH] bonding: lockdep annotation")
49ee4920 ("bonding: set qdisc_tx_busylock to avoid LOCKDEP splat")
23d3b8bf ("net: qdisc busylock needs lockdep annotations ")
303c07db ("ppp: set qdisc_tx_busylock to avoid LOCKDEP splat ")
Reported-by: NAlexander Aring <alex.aring@gmail.com>
Signed-off-by: NEric Dumazet <edumazet@google.com>
Tested-by: NAlexander Aring <alex.aring@gmail.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 3e5ccc29
...@@ -530,7 +530,27 @@ static struct header_ops lowpan_header_ops = { ...@@ -530,7 +530,27 @@ static struct header_ops lowpan_header_ops = {
.create = lowpan_header_create, .create = lowpan_header_create,
}; };
static struct lock_class_key lowpan_tx_busylock;
static struct lock_class_key lowpan_netdev_xmit_lock_key;
static void lowpan_set_lockdep_class_one(struct net_device *dev,
struct netdev_queue *txq,
void *_unused)
{
lockdep_set_class(&txq->_xmit_lock,
&lowpan_netdev_xmit_lock_key);
}
static int lowpan_dev_init(struct net_device *dev)
{
netdev_for_each_tx_queue(dev, lowpan_set_lockdep_class_one, NULL);
dev->qdisc_tx_busylock = &lowpan_tx_busylock;
return 0;
}
static const struct net_device_ops lowpan_netdev_ops = { static const struct net_device_ops lowpan_netdev_ops = {
.ndo_init = lowpan_dev_init,
.ndo_start_xmit = lowpan_xmit, .ndo_start_xmit = lowpan_xmit,
.ndo_set_mac_address = lowpan_set_address, .ndo_set_mac_address = lowpan_set_address,
}; };
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册