net/ena: fix queues number calculation
authorNetanel Belgazal <netanel@annapurnalabs.com>
Thu, 9 Feb 2017 13:21:28 +0000 (15:21 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 10 Feb 2017 03:27:06 +0000 (22:27 -0500)
The ENA driver tries to open a queue per vCPU.
To determine how many vCPUs the instance have it uses num_possible_cpus()
while it should have use num_online_cpus() instead.

Signed-off-by: Netanel Belgazal <netanel@annapurnalabs.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/amazon/ena/ena_netdev.c

index d8cd9cac6cf0afe6262b7c271767de3ce93a8f05..effe686dbcdb0ae6b3c72d586dfb7698dec34d2c 100644 (file)
@@ -2658,7 +2658,7 @@ static int ena_calc_io_queue_num(struct pci_dev *pdev,
                io_sq_num = get_feat_ctx->max_queues.max_sq_num;
        }
 
-       io_queue_num = min_t(int, num_possible_cpus(), ENA_MAX_NUM_IO_QUEUES);
+       io_queue_num = min_t(int, num_online_cpus(), ENA_MAX_NUM_IO_QUEUES);
        io_queue_num = min_t(int, io_queue_num, io_sq_num);
        io_queue_num = min_t(int, io_queue_num,
                             get_feat_ctx->max_queues.max_cq_num);