Skip to content

Commit f0783d4

Browse files
Ming Leimartinkpetersen
authored andcommitted
scsi: qla2xxx: Use correct number of vectors for online CPUs
When SCSI-MQ is enabled, in some case system would present nr_possible_cpus() which is greater than requested vectors by the driver. This results into driver being able to get larger number of MSI-X vectors than actual online CPUs. Driver then uses pci_alloc_irq_vectors_affinity() to assign 1:1 mapping and affinity for each MSI-x vector to CPUs. When the command is submitted using MSI-x vector, assigned to offline CPU, it results in an ABTS and system hang. This hang is result of a driver not being able to process interrupt on a vector assigned to an Off-line CPUs This patch fixes this issue by setting irq_offset value for the blk_mq_pci_map_queues() to use only those CPUs which has CPU mask affinity assigned and are online. By using the irq_offset value, driver will allow online cpumask to decide which vectors are used in blk_mq_pci_map_queues(). Fixes: 5601236 ("scsi: qla2xxx: Add Block Multi Queue functionality.") Cc: <stable@vger.kernel.org> #4.19 Signed-off-by: Ming Lei <ming.lei@redhat.com> Reviewed-by: Himanshu Madhani <hmadhani@marvell.com> Tested-by: Himanshu Madhani <hmadhani@marvell.com> Reviewed-by: Ewan D. Milne <emilne@redhat.com> Signed-off-by: Himanshu Madhani <hmadhani@marvell.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent 7bb25a8 commit f0783d4

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

drivers/scsi/qla2xxx/qla_def.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4394,6 +4394,8 @@ typedef struct scsi_qla_host {
43944394
uint16_t n2n_id;
43954395
struct list_head gpnid_list;
43964396
struct fab_scan scan;
4397+
4398+
unsigned int irq_offset;
43974399
} scsi_qla_host_t;
43984400

43994401
struct qla27xx_image_status {

drivers/scsi/qla2xxx/qla_isr.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3446,6 +3446,7 @@ qla24xx_enable_msix(struct qla_hw_data *ha, struct rsp_que *rsp)
34463446
"Adjusted Max no of queues pairs: %d.\n", ha->max_qpairs);
34473447
}
34483448
}
3449+
vha->irq_offset = desc.pre_vectors;
34493450
ha->msix_entries = kcalloc(ha->msix_count,
34503451
sizeof(struct qla_msix_entry),
34513452
GFP_KERNEL);

drivers/scsi/qla2xxx/qla_os.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6939,7 +6939,7 @@ static int qla2xxx_map_queues(struct Scsi_Host *shost)
69396939
if (USER_CTRL_IRQ(vha->hw))
69406940
rc = blk_mq_map_queues(qmap);
69416941
else
6942-
rc = blk_mq_pci_map_queues(qmap, vha->hw->pdev, 0);
6942+
rc = blk_mq_pci_map_queues(qmap, vha->hw->pdev, vha->irq_offset);
69436943
return rc;
69446944
}
69456945

0 commit comments

Comments
 (0)