Commit 6a1ce2fb authored by Netanel Belgazal's avatar Netanel Belgazal Committed by David S. Miller

net/ena: fix queues number calculation

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: default avatarNetanel Belgazal <netanel@annapurnalabs.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent fdeea0ad
...@@ -2658,7 +2658,7 @@ static int ena_calc_io_queue_num(struct pci_dev *pdev, ...@@ -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_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, io_sq_num);
io_queue_num = min_t(int, io_queue_num, io_queue_num = min_t(int, io_queue_num,
get_feat_ctx->max_queues.max_cq_num); get_feat_ctx->max_queues.max_cq_num);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment