Commit ed9af2e8 authored by Tom Herbert's avatar Tom Herbert Committed by David S. Miller

net: Move TX queue allocation to alloc_netdev_mq

TX queues are now allocated in alloc_netdev_mq and freed in
free_netdev.
Signed-off-by: default avatarTom Herbert <therbert@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent cc9ff19d
...@@ -5136,10 +5136,6 @@ int register_netdevice(struct net_device *dev) ...@@ -5136,10 +5136,6 @@ int register_netdevice(struct net_device *dev)
if (ret) if (ret)
goto out; goto out;
ret = netif_alloc_netdev_queues(dev);
if (ret)
goto out;
netdev_init_queues(dev); netdev_init_queues(dev);
/* Init, if this function is available */ /* Init, if this function is available */
...@@ -5599,6 +5595,8 @@ struct net_device *alloc_netdev_mq(int sizeof_priv, const char *name, ...@@ -5599,6 +5595,8 @@ struct net_device *alloc_netdev_mq(int sizeof_priv, const char *name,
dev->num_tx_queues = queue_count; dev->num_tx_queues = queue_count;
dev->real_num_tx_queues = queue_count; dev->real_num_tx_queues = queue_count;
if (netif_alloc_netdev_queues(dev))
goto free_pcpu;
#ifdef CONFIG_RPS #ifdef CONFIG_RPS
dev->num_rx_queues = queue_count; dev->num_rx_queues = queue_count;
...@@ -5619,6 +5617,7 @@ struct net_device *alloc_netdev_mq(int sizeof_priv, const char *name, ...@@ -5619,6 +5617,7 @@ struct net_device *alloc_netdev_mq(int sizeof_priv, const char *name,
free_pcpu: free_pcpu:
free_percpu(dev->pcpu_refcnt); free_percpu(dev->pcpu_refcnt);
kfree(dev->_tx);
free_p: free_p:
kfree(p); kfree(p);
return NULL; return NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment