Commit c38d1baf authored by Himanshu Madhani's avatar Himanshu Madhani Committed by Martin K. Petersen

scsi: qla2xxx: Use ql2xnvmeenable to enable Q-Pair for FC-NVMe

In some environments, user can choose to not enable SCSI-MQ but wants to
use FC-NVMe feature of the driver. Since driver relies on Q-Pairs to
allocate FC-NVMe resources, use existing module parameter to create
Q-Pairs when FC-NVMe is enabled.
Signed-off-by: default avatarHimanshu Madhani <himanshu.madhani@cavium.com>
Reviewed-by: default avatarEwan D. Milne <emilne@redhat.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 4ca82047
...@@ -8036,7 +8036,7 @@ struct qla_qpair *qla2xxx_create_qpair(struct scsi_qla_host *vha, int qos, ...@@ -8036,7 +8036,7 @@ struct qla_qpair *qla2xxx_create_qpair(struct scsi_qla_host *vha, int qos,
return NULL; return NULL;
} }
if (ql2xmqsupport) { if (ql2xmqsupport || ql2xnvmeenable) {
qpair = kzalloc(sizeof(struct qla_qpair), GFP_KERNEL); qpair = kzalloc(sizeof(struct qla_qpair), GFP_KERNEL);
if (qpair == NULL) { if (qpair == NULL) {
ql_log(ql_log_warn, vha, 0x0182, ql_log(ql_log_warn, vha, 0x0182,
......
...@@ -3411,7 +3411,7 @@ qla24xx_enable_msix(struct qla_hw_data *ha, struct rsp_que *rsp) ...@@ -3411,7 +3411,7 @@ qla24xx_enable_msix(struct qla_hw_data *ha, struct rsp_que *rsp)
ha->msix_count, ret); ha->msix_count, ret);
ha->msix_count = ret; ha->msix_count = ret;
/* Recalculate queue values */ /* Recalculate queue values */
if (ha->mqiobase && ql2xmqsupport) { if (ha->mqiobase && (ql2xmqsupport || ql2xnvmeenable)) {
ha->max_req_queues = ha->msix_count - 1; ha->max_req_queues = ha->msix_count - 1;
/* ATIOQ needs 1 vector. That's 1 less QPair */ /* ATIOQ needs 1 vector. That's 1 less QPair */
......
...@@ -606,7 +606,7 @@ qla25xx_delete_queues(struct scsi_qla_host *vha) ...@@ -606,7 +606,7 @@ qla25xx_delete_queues(struct scsi_qla_host *vha)
struct qla_hw_data *ha = vha->hw; struct qla_hw_data *ha = vha->hw;
struct qla_qpair *qpair, *tqpair; struct qla_qpair *qpair, *tqpair;
if (ql2xmqsupport) { if (ql2xmqsupport || ql2xnvmeenable) {
list_for_each_entry_safe(qpair, tqpair, &vha->qp_list, list_for_each_entry_safe(qpair, tqpair, &vha->qp_list,
qp_list_elem) qp_list_elem)
qla2xxx_delete_qpair(vha, qpair); qla2xxx_delete_qpair(vha, qpair);
......
...@@ -433,7 +433,7 @@ static int qla2x00_alloc_queues(struct qla_hw_data *ha, struct req_que *req, ...@@ -433,7 +433,7 @@ static int qla2x00_alloc_queues(struct qla_hw_data *ha, struct req_que *req,
qla_init_base_qpair(vha, req, rsp); qla_init_base_qpair(vha, req, rsp);
if (ql2xmqsupport && ha->max_qpairs) { if ((ql2xmqsupport || ql2xnvmeenable) && ha->max_qpairs) {
ha->queue_pair_map = kcalloc(ha->max_qpairs, sizeof(struct qla_qpair *), ha->queue_pair_map = kcalloc(ha->max_qpairs, sizeof(struct qla_qpair *),
GFP_KERNEL); GFP_KERNEL);
if (!ha->queue_pair_map) { if (!ha->queue_pair_map) {
...@@ -1976,7 +1976,8 @@ qla2x00_iospace_config(struct qla_hw_data *ha) ...@@ -1976,7 +1976,8 @@ qla2x00_iospace_config(struct qla_hw_data *ha)
/* Determine queue resources */ /* Determine queue resources */
ha->max_req_queues = ha->max_rsp_queues = 1; ha->max_req_queues = ha->max_rsp_queues = 1;
ha->msix_count = QLA_BASE_VECTORS; ha->msix_count = QLA_BASE_VECTORS;
if (!ql2xmqsupport || (!IS_QLA25XX(ha) && !IS_QLA81XX(ha))) if (!ql2xmqsupport || !ql2xnvmeenable ||
(!IS_QLA25XX(ha) && !IS_QLA81XX(ha)))
goto mqiobase_exit; goto mqiobase_exit;
ha->mqiobase = ioremap(pci_resource_start(ha->pdev, 3), ha->mqiobase = ioremap(pci_resource_start(ha->pdev, 3),
...@@ -2073,7 +2074,7 @@ qla83xx_iospace_config(struct qla_hw_data *ha) ...@@ -2073,7 +2074,7 @@ qla83xx_iospace_config(struct qla_hw_data *ha)
* By default, driver uses at least two msix vectors * By default, driver uses at least two msix vectors
* (default & rspq) * (default & rspq)
*/ */
if (ql2xmqsupport) { if (ql2xmqsupport || ql2xnvmeenable) {
/* MB interrupt uses 1 vector */ /* MB interrupt uses 1 vector */
ha->max_req_queues = ha->msix_count - 1; ha->max_req_queues = ha->msix_count - 1;
...@@ -3089,9 +3090,17 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) ...@@ -3089,9 +3090,17 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
ql_dbg(ql_dbg_init, base_vha, 0x0192, ql_dbg(ql_dbg_init, base_vha, 0x0192,
"blk/scsi-mq enabled, HW queues = %d.\n", host->nr_hw_queues); "blk/scsi-mq enabled, HW queues = %d.\n", host->nr_hw_queues);
} else } else {
ql_dbg(ql_dbg_init, base_vha, 0x0193, if (ql2xnvmeenable) {
"blk/scsi-mq disabled.\n"); host->nr_hw_queues = ha->max_qpairs;
ql_dbg(ql_dbg_init, base_vha, 0x0194,
"FC-NVMe support is enabled, HW queues=%d\n",
host->nr_hw_queues);
} else {
ql_dbg(ql_dbg_init, base_vha, 0x0193,
"blk/scsi-mq disabled.\n");
}
}
qlt_probe_one_stage1(base_vha, ha); qlt_probe_one_stage1(base_vha, ha);
...@@ -6300,7 +6309,7 @@ qla2xxx_pci_error_detected(struct pci_dev *pdev, pci_channel_state_t state) ...@@ -6300,7 +6309,7 @@ qla2xxx_pci_error_detected(struct pci_dev *pdev, pci_channel_state_t state)
switch (state) { switch (state) {
case pci_channel_io_normal: case pci_channel_io_normal:
ha->flags.eeh_busy = 0; ha->flags.eeh_busy = 0;
if (ql2xmqsupport) { if (ql2xmqsupport || ql2xnvmeenable) {
set_bit(QPAIR_ONLINE_CHECK_NEEDED, &vha->dpc_flags); set_bit(QPAIR_ONLINE_CHECK_NEEDED, &vha->dpc_flags);
qla2xxx_wake_dpc(vha); qla2xxx_wake_dpc(vha);
} }
...@@ -6317,7 +6326,7 @@ qla2xxx_pci_error_detected(struct pci_dev *pdev, pci_channel_state_t state) ...@@ -6317,7 +6326,7 @@ qla2xxx_pci_error_detected(struct pci_dev *pdev, pci_channel_state_t state)
pci_disable_device(pdev); pci_disable_device(pdev);
/* Return back all IOs */ /* Return back all IOs */
qla2x00_abort_all_cmds(vha, DID_RESET << 16); qla2x00_abort_all_cmds(vha, DID_RESET << 16);
if (ql2xmqsupport) { if (ql2xmqsupport || ql2xnvmeenable) {
set_bit(QPAIR_ONLINE_CHECK_NEEDED, &vha->dpc_flags); set_bit(QPAIR_ONLINE_CHECK_NEEDED, &vha->dpc_flags);
qla2xxx_wake_dpc(vha); qla2xxx_wake_dpc(vha);
} }
...@@ -6325,7 +6334,7 @@ qla2xxx_pci_error_detected(struct pci_dev *pdev, pci_channel_state_t state) ...@@ -6325,7 +6334,7 @@ qla2xxx_pci_error_detected(struct pci_dev *pdev, pci_channel_state_t state)
case pci_channel_io_perm_failure: case pci_channel_io_perm_failure:
ha->flags.pci_channel_io_perm_failure = 1; ha->flags.pci_channel_io_perm_failure = 1;
qla2x00_abort_all_cmds(vha, DID_NO_CONNECT << 16); qla2x00_abort_all_cmds(vha, DID_NO_CONNECT << 16);
if (ql2xmqsupport) { if (ql2xmqsupport || ql2xnvmeenable) {
set_bit(QPAIR_ONLINE_CHECK_NEEDED, &vha->dpc_flags); set_bit(QPAIR_ONLINE_CHECK_NEEDED, &vha->dpc_flags);
qla2xxx_wake_dpc(vha); qla2xxx_wake_dpc(vha);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment