Commit a57cabe0 authored by Dimitris Michailidis's avatar Dimitris Michailidis Committed by David S. Miller

cxgb4: set the number of queues before device registration

The number of queues is known early, move the calls to
netif_set_real_num_[rt]x_queues before register_netdev.
Signed-off-by: default avatarDimitris Michailidis <dm@chelsio.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent ec164008
...@@ -2717,10 +2717,6 @@ static int cxgb_open(struct net_device *dev) ...@@ -2717,10 +2717,6 @@ static int cxgb_open(struct net_device *dev)
return err; return err;
} }
netif_set_real_num_tx_queues(dev, pi->nqsets);
err = netif_set_real_num_rx_queues(dev, pi->nqsets);
if (err)
return err;
err = link_start(dev); err = link_start(dev);
if (!err) if (!err)
netif_tx_start_all_queues(dev); netif_tx_start_all_queues(dev);
...@@ -3733,6 +3729,10 @@ static int __devinit init_one(struct pci_dev *pdev, ...@@ -3733,6 +3729,10 @@ static int __devinit init_one(struct pci_dev *pdev,
* register at least one net device. * register at least one net device.
*/ */
for_each_port(adapter, i) { for_each_port(adapter, i) {
pi = adap2pinfo(adapter, i);
netif_set_real_num_tx_queues(adapter->port[i], pi->nqsets);
netif_set_real_num_rx_queues(adapter->port[i], pi->nqsets);
err = register_netdev(adapter->port[i]); err = register_netdev(adapter->port[i]);
if (err) if (err)
dev_warn(&pdev->dev, dev_warn(&pdev->dev,
...@@ -3747,7 +3747,7 @@ static int __devinit init_one(struct pci_dev *pdev, ...@@ -3747,7 +3747,7 @@ static int __devinit init_one(struct pci_dev *pdev,
adapter->name = adapter->port[i]->name; adapter->name = adapter->port[i]->name;
__set_bit(i, &adapter->registered_device_map); __set_bit(i, &adapter->registered_device_map);
adapter->chan_map[adap2pinfo(adapter, i)->tx_chan] = i; adapter->chan_map[pi->tx_chan] = i;
} }
} }
if (!adapter->registered_device_map) { if (!adapter->registered_device_map) {
......
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