diff options
author | Sunil Goutham <sgoutham@cavium.com> | 2016-08-12 16:51:27 +0530 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-08-13 11:59:30 -0700 |
commit | 3a397ebe154b385e5e3d0c7fee478ccef58742fc (patch) | |
tree | b3c99da83f0663ae5ffd9fc2fd1b1783bd525e39 /drivers/net/ethernet/cavium/thunder/nic_main.c | |
parent | 0025d93ebb9b4f7ad7807d22fe65852f447309a1 (diff) |
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.c | 6 |
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 4974923b9d44..0d81117f019c 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; |