scsi: qedi: Use qed count from set_fp_int in msix allocation

To avoid unnecessary vector allocation when the number of fast-path queues
is less then available msix vectors, use return count from module
qed->set_fp_int.

Link: https://lore.kernel.org/r/20200908095657.26821-2-mrangankar@marvell.com
Signed-off-by: Manish Rangankar <mrangankar@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
Manish Rangankar 2020-09-08 02:56:50 -07:00 committed by Martin K. Petersen
parent 5476b7f5ae
commit 3f8ad0072b
2 changed files with 8 additions and 2 deletions

View File

@ -305,6 +305,7 @@ struct qedi_ctx {
u32 max_sqes;
u8 num_queues;
u32 max_active_conns;
s32 msix_count;
struct iscsi_cid_queue cid_que;
struct qedi_endpoint **ep_tbl;

View File

@ -1356,7 +1356,7 @@ static int qedi_request_msix_irq(struct qedi_ctx *qedi)
u16 idx;
cpu = cpumask_first(cpu_online_mask);
for (i = 0; i < qedi->int_info.msix_cnt; i++) {
for (i = 0; i < qedi->msix_count; i++) {
idx = i * qedi->dev_info.common.num_hwfns +
qedi_ops->common->get_affin_hwfn_idx(qedi->cdev);
@ -1386,7 +1386,12 @@ static int qedi_setup_int(struct qedi_ctx *qedi)
{
int rc = 0;
rc = qedi_ops->common->set_fp_int(qedi->cdev, num_online_cpus());
rc = qedi_ops->common->set_fp_int(qedi->cdev, qedi->num_queues);
if (rc < 0)
goto exit_setup_int;
qedi->msix_count = rc;
rc = qedi_ops->common->get_fp_int(qedi->cdev, &qedi->int_info);
if (rc)
goto exit_setup_int;