]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/blobdiff - drivers/net/ethernet/cavium/thunder/nicvf_main.c
net: thunderx: Set queue count based on number of CPUs
[mirror_ubuntu-zesty-kernel.git] / drivers / net / ethernet / cavium / thunder / nicvf_main.c
index 0c106350d5a8f4037d99bbf9ffb7a14921a529ec..d9efe2fb7b8186f23d3f8a576260760a9742116e 100644 (file)
@@ -1537,14 +1537,13 @@ static int nicvf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
                goto err_release_regions;
        }
 
-       qcount = MAX_CMP_QUEUES_PER_QS;
+       qcount = netif_get_num_default_rss_queues();
 
        /* Restrict multiqset support only for host bound VFs */
        if (pdev->is_virtfn) {
                /* Set max number of queues per VF */
-               qcount = roundup(num_online_cpus(), MAX_CMP_QUEUES_PER_QS);
-               qcount = min(qcount,
-                            (MAX_SQS_PER_VF + 1) * MAX_CMP_QUEUES_PER_QS);
+               qcount = min_t(int, num_online_cpus(),
+                              (MAX_SQS_PER_VF + 1) * MAX_CMP_QUEUES_PER_QS);
        }
 
        netdev = alloc_etherdev_mqs(sizeof(struct nicvf), qcount, qcount);