Message ID | 20201201082730.24158-4-njavali@marvell.com (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
Series | qla2xxx bug fixes | expand |
> On Dec 1, 2020, at 2:27 AM, Nilesh Javali <njavali@marvell.com> wrote: > > From: Quinn Tran <qutran@marvell.com> > > Driver created too many QPairs(126) with 28xx adapter. > Limit the number of CPUs to lower wasted resources. > > Signed-off-by: Quinn Tran <qutran@marvell.com> > Signed-off-by: Nilesh Javali <njavali@marvell.com> > --- > drivers/scsi/qla2xxx/qla_isr.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c > index a24b82de4aab..77dd7630c3f8 100644 > --- a/drivers/scsi/qla2xxx/qla_isr.c > +++ b/drivers/scsi/qla2xxx/qla_isr.c > @@ -3952,10 +3952,12 @@ qla24xx_enable_msix(struct qla_hw_data *ha, struct rsp_que *rsp) > if (USER_CTRL_IRQ(ha) || !ha->mqiobase) { > /* user wants to control IRQ setting for target mode */ > ret = pci_alloc_irq_vectors(ha->pdev, min_vecs, > - ha->msix_count, PCI_IRQ_MSIX); > + min((u16)ha->msix_count, (u16)num_online_cpus()), > + PCI_IRQ_MSIX); > } else > ret = pci_alloc_irq_vectors_affinity(ha->pdev, min_vecs, > - ha->msix_count, PCI_IRQ_MSIX | PCI_IRQ_AFFINITY, > + min((u16)ha->msix_count, (u16)num_online_cpus()), > + PCI_IRQ_MSIX | PCI_IRQ_AFFINITY, > &desc); > > if (ret < 0) { > -- > 2.19.0.rc0 > Looks good. Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com> -- Himanshu Madhani Oracle Linux Engineering
diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c index a24b82de4aab..77dd7630c3f8 100644 --- a/drivers/scsi/qla2xxx/qla_isr.c +++ b/drivers/scsi/qla2xxx/qla_isr.c @@ -3952,10 +3952,12 @@ qla24xx_enable_msix(struct qla_hw_data *ha, struct rsp_que *rsp) if (USER_CTRL_IRQ(ha) || !ha->mqiobase) { /* user wants to control IRQ setting for target mode */ ret = pci_alloc_irq_vectors(ha->pdev, min_vecs, - ha->msix_count, PCI_IRQ_MSIX); + min((u16)ha->msix_count, (u16)num_online_cpus()), + PCI_IRQ_MSIX); } else ret = pci_alloc_irq_vectors_affinity(ha->pdev, min_vecs, - ha->msix_count, PCI_IRQ_MSIX | PCI_IRQ_AFFINITY, + min((u16)ha->msix_count, (u16)num_online_cpus()), + PCI_IRQ_MSIX | PCI_IRQ_AFFINITY, &desc); if (ret < 0) {