summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/cavium/thunder/nic_main.c
diff options
context:
space:
mode:
authorSunil Goutham <sgoutham@cavium.com>2016-08-12 16:51:27 +0530
committerDavid S. Miller <davem@davemloft.net>2016-08-13 11:59:30 -0700
commit3a397ebe154b385e5e3d0c7fee478ccef58742fc (patch)
treeb3c99da83f0663ae5ffd9fc2fd1b1783bd525e39 /drivers/net/ethernet/cavium/thunder/nic_main.c
parent0025d93ebb9b4f7ad7807d22fe65852f447309a1 (diff)
downloadop-kernel-dev-3a397ebe154b385e5e3d0c7fee478ccef58742fc.zip
op-kernel-dev-3a397ebe154b385e5e3d0c7fee478ccef58742fc.tar.gz
net: thunderx: Set queue count based on number of CPUs
81xx has only 4 CPUs, so it doesn't make sense to initialize entire Qset i.e 8 queues by default. Made changes to queue initialization to init queues equal to number of CPUs or 8 queues whichever is lesser. Also this will be applicable to VMs with VNIC VF attached and having less VCPUs Signed-off-by: Sunil Goutham <sgoutham@cavium.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/cavium/thunder/nic_main.c')
-rw-r--r--drivers/net/ethernet/cavium/thunder/nic_main.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/net/ethernet/cavium/thunder/nic_main.c b/drivers/net/ethernet/cavium/thunder/nic_main.c
index 4974923..0d81117 100644
--- a/drivers/net/ethernet/cavium/thunder/nic_main.c
+++ b/drivers/net/ethernet/cavium/thunder/nic_main.c
@@ -1009,6 +1009,12 @@ static int nic_num_sqs_en(struct nicpf *nic, int vf_en)
int pos, sqs_per_vf = MAX_SQS_PER_VF_SINGLE_NODE;
u16 total_vf;
+ /* Secondary Qsets are needed only if CPU count is
+ * morethan MAX_QUEUES_PER_QSET.
+ */
+ if (num_online_cpus() <= MAX_QUEUES_PER_QSET)
+ return 0;
+
/* Check if its a multi-node environment */
if (nr_node_ids > 1)
sqs_per_vf = MAX_SQS_PER_VF;
OpenPOWER on IntegriCloud