Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 327819
b: refs/heads/master
c: 23d3b8b
h: refs/heads/master
i:
  327817: f7140b2
  327815: 5479ee8
v: v3
  • Loading branch information
Eric Dumazet authored and David S. Miller committed Sep 5, 2012
1 parent 3c5109c commit 4dea18d
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7933aa5c75b880aad6fc26f2df1e3ee6c14f166d
refs/heads/master: 23d3b8bfb8eb20e7d96afa09991e6a5ed1c83164
2 changes: 2 additions & 0 deletions trunk/include/linux/netdevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -1322,6 +1322,8 @@ struct net_device {
/* phy device may attach itself for hardware timestamping */
struct phy_device *phydev;

struct lock_class_key *qdisc_tx_busylock;

/* group the device belongs to */
int group;

Expand Down
3 changes: 2 additions & 1 deletion trunk/net/l2tp/l2tp_eth.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,15 @@ static inline struct l2tp_eth_net *l2tp_eth_pernet(struct net *net)
return net_generic(net, l2tp_eth_net_id);
}

static struct lock_class_key l2tp_eth_tx_busylock;
static int l2tp_eth_dev_init(struct net_device *dev)
{
struct l2tp_eth *priv = netdev_priv(dev);

priv->dev = dev;
eth_hw_addr_random(dev);
memset(&dev->broadcast[0], 0xff, 6);

dev->qdisc_tx_busylock = &l2tp_eth_tx_busylock;
return 0;
}

Expand Down
9 changes: 8 additions & 1 deletion trunk/net/sched/sch_generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -527,13 +527,16 @@ struct Qdisc_ops pfifo_fast_ops __read_mostly = {
};
EXPORT_SYMBOL(pfifo_fast_ops);

static struct lock_class_key qdisc_tx_busylock;

struct Qdisc *qdisc_alloc(struct netdev_queue *dev_queue,
struct Qdisc_ops *ops)
{
void *p;
struct Qdisc *sch;
unsigned int size = QDISC_ALIGN(sizeof(*sch)) + ops->priv_size;
int err = -ENOBUFS;
struct net_device *dev = dev_queue->dev;

p = kzalloc_node(size, GFP_KERNEL,
netdev_queue_numa_node_read(dev_queue));
Expand All @@ -553,12 +556,16 @@ struct Qdisc *qdisc_alloc(struct netdev_queue *dev_queue,
}
INIT_LIST_HEAD(&sch->list);
skb_queue_head_init(&sch->q);

spin_lock_init(&sch->busylock);
lockdep_set_class(&sch->busylock,
dev->qdisc_tx_busylock ?: &qdisc_tx_busylock);

sch->ops = ops;
sch->enqueue = ops->enqueue;
sch->dequeue = ops->dequeue;
sch->dev_queue = dev_queue;
dev_hold(qdisc_dev(sch));
dev_hold(dev);
atomic_set(&sch->refcnt, 1);

return sch;
Expand Down

0 comments on commit 4dea18d

Please sign in to comment.