]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
cxgb4: Setup FW queues before registering netdev
authorArjun Vynipadath <arjun@chelsio.com>
Fri, 23 Mar 2018 09:55:10 +0000 (15:25 +0530)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Mon, 27 Aug 2018 14:40:05 +0000 (16:40 +0200)
BugLink: http://bugs.launchpad.net/bugs/1786352
[ Upstream commit 843bd7db79c861b49e2912d723625f5fa8e94502 ]

When NetworkManager is enabled, there are chances that interface up
is called even before probe completes. This means we have not yet
allocated the FW sge queues, hence rest of ingress queue allocation
wont be proper. Fix this by calling setup_fw_sge_queues() before
register_netdev().

Fixes: 0fbc81b3ad51 ('chcr/cxgb4i/cxgbit/RDMA/cxgb4: Allocate resources dynamically for all cxgb4 ULD's')
Signed-off-by: Arjun Vynipadath <arjun@chelsio.com>
Signed-off-by: Casey Leedom <leedom@chelsio.com>
Signed-off-by: Ganesh Goudar <ganeshgr@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c

index 6bcb55f58f2b5d2b19e331dd3afe77f1e82bdda1..7d014137bce02cabbc613ca788c0fc50ab7c4d8f 100644 (file)
@@ -830,8 +830,6 @@ static int setup_fw_sge_queues(struct adapter *adap)
 
        err = t4_sge_alloc_rxq(adap, &s->fw_evtq, true, adap->port[0],
                               adap->msi_idx, NULL, fwevtq_handler, NULL, -1);
-       if (err)
-               t4_free_sge_resources(adap);
        return err;
 }
 
@@ -5221,6 +5219,13 @@ static int init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
        if (err)
                goto out_free_dev;
 
+       err = setup_fw_sge_queues(adapter);
+       if (err) {
+               dev_err(adapter->pdev_dev,
+                       "FW sge queue allocation failed, err %d", err);
+               goto out_free_dev;
+       }
+
        /*
         * The card is now ready to go.  If any errors occur during device
         * registration we do not fail the whole card but rather proceed only
@@ -5269,7 +5274,6 @@ static int init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
                cxgb4_ptp_init(adapter);
 
        print_adapter_info(adapter);
-       setup_fw_sge_queues(adapter);
        return 0;
 
 sriov:
@@ -5325,6 +5329,7 @@ free_mbox_log:
 #endif
 
  out_free_dev:
+       t4_free_sge_resources(adapter);
        free_some_resources(adapter);
        if (adapter->flags & USING_MSIX)
                free_msix_info(adapter);