[PATCH 3/8] scsi: lpfc: use blk_mq_max_nr_hw_queues() to calculate io vectors
Ming Lei
ming.lei at redhat.com
Fri Jul 21 01:48:48 PDT 2023
On Wed, Jul 12, 2023 at 05:03:19PM -0700, Justin Tee wrote:
> Hi Ming,
>
> A few lines below in if (aff_mask), vectors can be overwritten again
> with min(phba->cfg_irq_chann, cpu_cnt).
>
> Perhaps we should move blk_mq_max_nr_hw_queues min comparison a little later:
>
> diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
> index 3221a934066b..20410789e8b8 100644
> --- a/drivers/scsi/lpfc/lpfc_init.c
> +++ b/drivers/scsi/lpfc/lpfc_init.c
> @@ -13025,6 +13025,8 @@ lpfc_sli4_enable_msix(struct lpfc_hba *phba)
> flags |= PCI_IRQ_AFFINITY;
> }
>
> + vectors = min_t(unsigned int, vectors, blk_mq_max_nr_hw_queues());
> +
> rc = pci_alloc_irq_vectors(phba->pcidev, 1, vectors, flags);
> if (rc < 0) {
> lpfc_printf_log(phba, KERN_INFO, LOG_INIT,
Hi Justin,
Indeed, will take it in next version.
Thanks,
Ming
More information about the Linux-nvme
mailing list