Skip to content

Commit 17e5fc5

Browse files
Christoph Hellwigmartinkpetersen
authored andcommitted
scsi: qla2xxx: fix MSI-X vector affinity
The first two or three vectors in qla2xxx adapter are global and not associated with a specific queue. They should not have IRQ affinity assigned. Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: Himanshu Madhani <himanshu.madhani@cavium.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent c3c4239 commit 17e5fc5

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

drivers/scsi/qla2xxx/qla_def.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2732,7 +2732,7 @@ struct isp_operations {
27322732
#define QLA_MSIX_FW_MODE(m) (((m) & (BIT_7|BIT_8|BIT_9)) >> 7)
27332733
#define QLA_MSIX_FW_MODE_1(m) (QLA_MSIX_FW_MODE(m) == 1)
27342734

2735-
#define QLA_MSIX_DEFAULT 0x00
2735+
#define QLA_BASE_VECTORS 2 /* default + RSP */
27362736
#define QLA_MSIX_RSP_Q 0x01
27372737
#define QLA_ATIO_VECTOR 0x02
27382738
#define QLA_MSIX_QPAIR_MULTIQ_RSP_Q 0x03

drivers/scsi/qla2xxx/qla_isr.c

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3017,13 +3017,20 @@ static struct qla_init_msix_entry qla82xx_msix_entries[] = {
30173017
static int
30183018
qla24xx_enable_msix(struct qla_hw_data *ha, struct rsp_que *rsp)
30193019
{
3020-
#define MIN_MSIX_COUNT 2
30213020
int i, ret;
30223021
struct qla_msix_entry *qentry;
30233022
scsi_qla_host_t *vha = pci_get_drvdata(ha->pdev);
3023+
struct irq_affinity desc = {
3024+
.pre_vectors = QLA_BASE_VECTORS,
3025+
};
3026+
3027+
if (QLA_TGT_MODE_ENABLED() && IS_ATIO_MSIX_CAPABLE(ha))
3028+
desc.pre_vectors++;
3029+
3030+
ret = pci_alloc_irq_vectors_affinity(ha->pdev, QLA_BASE_VECTORS,
3031+
ha->msix_count, PCI_IRQ_MSIX | PCI_IRQ_AFFINITY,
3032+
&desc);
30243033

3025-
ret = pci_alloc_irq_vectors(ha->pdev, MIN_MSIX_COUNT, ha->msix_count,
3026-
PCI_IRQ_MSIX | PCI_IRQ_AFFINITY);
30273034
if (ret < 0) {
30283035
ql_log(ql_log_fatal, vha, 0x00c7,
30293036
"MSI-X: Failed to enable support, "
@@ -3074,7 +3081,7 @@ qla24xx_enable_msix(struct qla_hw_data *ha, struct rsp_que *rsp)
30743081
}
30753082

30763083
/* Enable MSI-X vectors for the base queue */
3077-
for (i = 0; i < (QLA_MSIX_RSP_Q + 1); i++) {
3084+
for (i = 0; i < QLA_BASE_VECTORS; i++) {
30783085
qentry = &ha->msix_entries[i];
30793086
qentry->handle = rsp;
30803087
rsp->msix = qentry;

0 commit comments

Comments
 (0)