Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 224815
b: refs/heads/master
c: aa94210
h: refs/heads/master
i:
  224813: 7619191
  224811: 88c323b
  224807: fe256b4
  224799: 9f13e2a
v: v3
  • Loading branch information
Changli Gao authored and David S. Miller committed Dec 8, 2010
1 parent 3a3863c commit 48bb492
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 23 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: a1044e36e457fb6dbdf90ce756d578b251d99b5e
refs/heads/master: aa9421041128abb4d269ee1dc502ff65fb3b7d69
35 changes: 13 additions & 22 deletions trunk/net/core/dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -5112,11 +5112,21 @@ static int netif_alloc_rx_queues(struct net_device *dev)
}
#endif

static void netdev_init_one_queue(struct net_device *dev,
struct netdev_queue *queue, void *_unused)
{
/* Initialize queue lock */
spin_lock_init(&queue->_xmit_lock);
netdev_set_xmit_lockdep_class(&queue->_xmit_lock, dev->type);
queue->xmit_lock_owner = -1;
netdev_queue_numa_node_write(queue, -1);
queue->dev = dev;
}

static int netif_alloc_netdev_queues(struct net_device *dev)
{
unsigned int count = dev->num_tx_queues;
struct netdev_queue *tx;
int i;

BUG_ON(count < 1);

Expand All @@ -5128,27 +5138,10 @@ static int netif_alloc_netdev_queues(struct net_device *dev)
}
dev->_tx = tx;

for (i = 0; i < count; i++) {
netdev_queue_numa_node_write(&tx[i], -1);
tx[i].dev = dev;
}
return 0;
}

static void netdev_init_one_queue(struct net_device *dev,
struct netdev_queue *queue,
void *_unused)
{
/* Initialize queue lock */
spin_lock_init(&queue->_xmit_lock);
netdev_set_xmit_lockdep_class(&queue->_xmit_lock, dev->type);
queue->xmit_lock_owner = -1;
}

static void netdev_init_queues(struct net_device *dev)
{
netdev_for_each_tx_queue(dev, netdev_init_one_queue, NULL);
spin_lock_init(&dev->tx_global_lock);

return 0;
}

/**
Expand Down Expand Up @@ -5187,8 +5180,6 @@ int register_netdevice(struct net_device *dev)

dev->iflink = -1;

netdev_init_queues(dev);

/* Init, if this function is available */
if (dev->netdev_ops->ndo_init) {
ret = dev->netdev_ops->ndo_init(dev);
Expand Down

0 comments on commit 48bb492

Please sign in to comment.