Skip to content

Commit 9ec5809

Browse files
committed
scsi: qla2xxx: Use ql2xnvmeenable to enable Q-Pair for FC-NVMe
(bsc#1043726,FATE#324770). suse-commit: 1ef8bbe4eb438330c504991965339ad6b4fb3331
1 parent d294450 commit 9ec5809

File tree

4 files changed

+21
-12
lines changed

4 files changed

+21
-12
lines changed

drivers/scsi/qla2xxx/qla_init.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8037,7 +8037,7 @@ struct qla_qpair *qla2xxx_create_qpair(struct scsi_qla_host *vha, int qos,
80378037
return NULL;
80388038
}
80398039

8040-
if (ql2xmqsupport) {
8040+
if (ql2xmqsupport || ql2xnvmeenable) {
80418041
qpair = kzalloc(sizeof(struct qla_qpair), GFP_KERNEL);
80428042
if (qpair == NULL) {
80438043
ql_log(ql_log_warn, vha, 0x0182,

drivers/scsi/qla2xxx/qla_isr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3409,7 +3409,7 @@ qla24xx_enable_msix(struct qla_hw_data *ha, struct rsp_que *rsp)
34093409
ha->msix_count, ret);
34103410
ha->msix_count = ret;
34113411
/* Recalculate queue values */
3412-
if (ha->mqiobase && ql2xmqsupport) {
3412+
if (ha->mqiobase && (ql2xmqsupport || ql2xnvmeenable)) {
34133413
ha->max_req_queues = ha->msix_count - 1;
34143414

34153415
/* ATIOQ needs 1 vector. That's 1 less QPair */

drivers/scsi/qla2xxx/qla_mid.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,7 @@ qla25xx_delete_queues(struct scsi_qla_host *vha)
606606
struct qla_hw_data *ha = vha->hw;
607607
struct qla_qpair *qpair, *tqpair;
608608

609-
if (ql2xmqsupport) {
609+
if (ql2xmqsupport || ql2xnvmeenable) {
610610
list_for_each_entry_safe(qpair, tqpair, &vha->qp_list,
611611
qp_list_elem)
612612
qla2xxx_delete_qpair(vha, qpair);

drivers/scsi/qla2xxx/qla_os.c

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ static int qla2x00_alloc_queues(struct qla_hw_data *ha, struct req_que *req,
432432

433433
qla_init_base_qpair(vha, req, rsp);
434434

435-
if (ql2xmqsupport && ha->max_qpairs) {
435+
if ((ql2xmqsupport || ql2xnvmeenable) && ha->max_qpairs) {
436436
ha->queue_pair_map = kcalloc(ha->max_qpairs, sizeof(struct qla_qpair *),
437437
GFP_KERNEL);
438438
if (!ha->queue_pair_map) {
@@ -1975,7 +1975,8 @@ qla2x00_iospace_config(struct qla_hw_data *ha)
19751975
/* Determine queue resources */
19761976
ha->max_req_queues = ha->max_rsp_queues = 1;
19771977
ha->msix_count = QLA_BASE_VECTORS;
1978-
if (!ql2xmqsupport || (!IS_QLA25XX(ha) && !IS_QLA81XX(ha)))
1978+
if (!ql2xmqsupport || !ql2xnvmeenable ||
1979+
(!IS_QLA25XX(ha) && !IS_QLA81XX(ha)))
19791980
goto mqiobase_exit;
19801981

19811982
ha->mqiobase = ioremap(pci_resource_start(ha->pdev, 3),
@@ -2072,7 +2073,7 @@ qla83xx_iospace_config(struct qla_hw_data *ha)
20722073
* By default, driver uses at least two msix vectors
20732074
* (default & rspq)
20742075
*/
2075-
if (ql2xmqsupport) {
2076+
if (ql2xmqsupport || ql2xnvmeenable) {
20762077
/* MB interrupt uses 1 vector */
20772078
ha->max_req_queues = ha->msix_count - 1;
20782079

@@ -3088,9 +3089,17 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
30883089

30893090
ql_dbg(ql_dbg_init, base_vha, 0x0192,
30903091
"blk/scsi-mq enabled, HW queues = %d.\n", host->nr_hw_queues);
3091-
} else
3092-
ql_dbg(ql_dbg_init, base_vha, 0x0193,
3093-
"blk/scsi-mq disabled.\n");
3092+
} else {
3093+
if (ql2xnvmeenable) {
3094+
host->nr_hw_queues = ha->max_qpairs;
3095+
ql_dbg(ql_dbg_init, base_vha, 0x0194,
3096+
"FC-NVMe support is enabled, HW queues=%d\n",
3097+
host->nr_hw_queues);
3098+
} else {
3099+
ql_dbg(ql_dbg_init, base_vha, 0x0193,
3100+
"blk/scsi-mq disabled.\n");
3101+
}
3102+
}
30943103

30953104
qlt_probe_one_stage1(base_vha, ha);
30963105

@@ -6301,7 +6310,7 @@ qla2xxx_pci_error_detected(struct pci_dev *pdev, pci_channel_state_t state)
63016310
switch (state) {
63026311
case pci_channel_io_normal:
63036312
ha->flags.eeh_busy = 0;
6304-
if (ql2xmqsupport) {
6313+
if (ql2xmqsupport || ql2xnvmeenable) {
63056314
set_bit(QPAIR_ONLINE_CHECK_NEEDED, &vha->dpc_flags);
63066315
qla2xxx_wake_dpc(vha);
63076316
}
@@ -6318,15 +6327,15 @@ qla2xxx_pci_error_detected(struct pci_dev *pdev, pci_channel_state_t state)
63186327
pci_disable_device(pdev);
63196328
/* Return back all IOs */
63206329
qla2x00_abort_all_cmds(vha, DID_RESET << 16);
6321-
if (ql2xmqsupport) {
6330+
if (ql2xmqsupport || ql2xnvmeenable) {
63226331
set_bit(QPAIR_ONLINE_CHECK_NEEDED, &vha->dpc_flags);
63236332
qla2xxx_wake_dpc(vha);
63246333
}
63256334
return PCI_ERS_RESULT_NEED_RESET;
63266335
case pci_channel_io_perm_failure:
63276336
ha->flags.pci_channel_io_perm_failure = 1;
63286337
qla2x00_abort_all_cmds(vha, DID_NO_CONNECT << 16);
6329-
if (ql2xmqsupport) {
6338+
if (ql2xmqsupport || ql2xnvmeenable) {
63306339
set_bit(QPAIR_ONLINE_CHECK_NEEDED, &vha->dpc_flags);
63316340
qla2xxx_wake_dpc(vha);
63326341
}

0 commit comments

Comments
 (0)