cxgb4vf: Set number of queues in pci probe only
authorHariprasad Shenai <hariprasad@chelsio.com>
Tue, 8 Mar 2016 05:20:20 +0000 (10:50 +0530)
committerDavid S. Miller <davem@davemloft.net>
Thu, 10 Mar 2016 21:12:25 +0000 (16:12 -0500)
Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c

index 5a3b8836847d8671f6a9a01be0f4d23f9efdfc97..1cc8a7a69457dfbb029a5ff0b7469be56ef60ce1 100644 (file)
@@ -790,10 +790,6 @@ static int cxgb4vf_open(struct net_device *dev)
        /*
         * Note that this interface is up and start everything up ...
         */
-       netif_set_real_num_tx_queues(dev, pi->nqsets);
-       err = netif_set_real_num_rx_queues(dev, pi->nqsets);
-       if (err)
-               goto err_unwind;
        err = link_start(dev);
        if (err)
                goto err_unwind;
@@ -2831,10 +2827,14 @@ static int cxgb4vf_pci_probe(struct pci_dev *pdev,
         * must register at least one net device.
         */
        for_each_port(adapter, pidx) {
+               struct port_info *pi = netdev_priv(adapter->port[pidx]);
                netdev = adapter->port[pidx];
                if (netdev == NULL)
                        continue;
 
+               netif_set_real_num_tx_queues(netdev, pi->nqsets);
+               netif_set_real_num_rx_queues(netdev, pi->nqsets);
+
                err = register_netdev(netdev);
                if (err) {
                        dev_warn(&pdev->dev, "cannot register net device %s,"